Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR resources/resource-manager] Add userAssignedIdentities #2792

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# --------------------------------------------------------------------------

import uuid
import warnings
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

Expand Down Expand Up @@ -314,9 +313,6 @@ def list_for_resource(
self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config):
"""Gets policy assignments for a resource.

.. warning::
This method is deprecated

:param resource_group_name: The name of the resource group containing
the resource. The name is case insensitive.
:type resource_group_name: str
Expand All @@ -342,7 +338,6 @@ def list_for_resource(
~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignmentPaged[~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
warnings.warn("Method list_for_resource is deprecated", DeprecationWarning)
def internal_paging(next_link=None, raw=False):

if not next_link:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# regenerated.
# --------------------------------------------------------------------------

import warnings
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# --------------------------------------------------------------------------

import uuid
import warnings
from msrest.pipeline import ClientRawResponse

from .. import models
Expand Down Expand Up @@ -309,9 +308,6 @@ def list_for_resource(
self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config):
"""Gets policy assignments for a resource.

.. warning::
This method is deprecated

:param resource_group_name: The name of the resource group containing
the resource. The name is case insensitive.
:type resource_group_name: str
Expand All @@ -338,7 +334,6 @@ def list_for_resource(
:raises:
:class:`ErrorResponseException<azure.mgmt.resource.policy.v2017_06_01_preview.models.ErrorResponseException>`
"""
warnings.warn("Method list_for_resource is deprecated", DeprecationWarning)
def internal_paging(next_link=None, raw=False):

if not next_link:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# regenerated.
# --------------------------------------------------------------------------

import warnings
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from .deployment_extended_py3 import DeploymentExtended
from .plan_py3 import Plan
from .sku_py3 import Sku
from .identity_user_assigned_identities_value_py3 import IdentityUserAssignedIdentitiesValue
from .identity_py3 import Identity
from .generic_resource_py3 import GenericResource
from .resource_group_properties_py3 import ResourceGroupProperties
Expand Down Expand Up @@ -75,6 +76,7 @@
from .deployment_extended import DeploymentExtended
from .plan import Plan
from .sku import Sku
from .identity_user_assigned_identities_value import IdentityUserAssignedIdentitiesValue
from .identity import Identity
from .generic_resource import GenericResource
from .resource_group_properties import ResourceGroupProperties
Expand Down Expand Up @@ -129,6 +131,7 @@
'DeploymentExtended',
'Plan',
'Sku',
'IdentityUserAssignedIdentitiesValue',
'Identity',
'GenericResource',
'ResourceGroupProperties',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class Identity(Model):
'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
:type type: str or
~azure.mgmt.resource.resources.v2018_05_01.models.ResourceIdentityType
:param user_assigned_identities: The list of user identities associated
with the resource. The user identity dictionary key references will be ARM
resource ids in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
:type user_assigned_identities: dict[str,
~azure.mgmt.resource.resources.v2018_05_01.models.IdentityUserAssignedIdentitiesValue]
"""

_validation = {
Expand All @@ -37,10 +43,12 @@ class Identity(Model):
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'},
}

def __init__(self, **kwargs):
super(Identity, self).__init__(**kwargs)
self.principal_id = None
self.tenant_id = None
self.type = kwargs.get('type', None)
self.user_assigned_identities = kwargs.get('user_assigned_identities', None)
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class Identity(Model):
'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
:type type: str or
~azure.mgmt.resource.resources.v2018_05_01.models.ResourceIdentityType
:param user_assigned_identities: The list of user identities associated
with the resource. The user identity dictionary key references will be ARM
resource ids in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
:type user_assigned_identities: dict[str,
~azure.mgmt.resource.resources.v2018_05_01.models.IdentityUserAssignedIdentitiesValue]
"""

_validation = {
Expand All @@ -37,10 +43,12 @@ class Identity(Model):
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'},
}

def __init__(self, *, type=None, **kwargs) -> None:
def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None:
super(Identity, self).__init__(**kwargs)
self.principal_id = None
self.tenant_id = None
self.type = type
self.user_assigned_identities = user_assigned_identities
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class IdentityUserAssignedIdentitiesValue(Model):
"""IdentityUserAssignedIdentitiesValue.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar principal_id: The principal id of user assigned identity.
:vartype principal_id: str
:ivar client_id: The client id of user assigned identity.
:vartype client_id: str
"""

_validation = {
'principal_id': {'readonly': True},
'client_id': {'readonly': True},
}

_attribute_map = {
'principal_id': {'key': 'principalId', 'type': 'str'},
'client_id': {'key': 'clientId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs)
self.principal_id = None
self.client_id = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class IdentityUserAssignedIdentitiesValue(Model):
"""IdentityUserAssignedIdentitiesValue.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar principal_id: The principal id of user assigned identity.
:vartype principal_id: str
:ivar client_id: The client id of user assigned identity.
:vartype client_id: str
"""

_validation = {
'principal_id': {'readonly': True},
'client_id': {'readonly': True},
}

_attribute_map = {
'principal_id': {'key': 'principalId', 'type': 'str'},
'client_id': {'key': 'clientId', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs)
self.principal_id = None
self.client_id = None