diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/__init__.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/__init__.py index b93bf8fe735b..82fb90d7325f 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/__init__.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/__init__.py @@ -9,16 +9,28 @@ # regenerated. # -------------------------------------------------------------------------- -from .classic_administrator import ClassicAdministrator -from .provider_operation import ProviderOperation -from .resource_type import ResourceType -from .provider_operations_metadata import ProviderOperationsMetadata -from .permission import Permission -from .role_definition_filter import RoleDefinitionFilter -from .role_definition import RoleDefinition -from .role_assignment_filter import RoleAssignmentFilter -from .role_assignment import RoleAssignment -from .role_assignment_create_parameters import RoleAssignmentCreateParameters +try: + from .classic_administrator_py3 import ClassicAdministrator + from .provider_operation_py3 import ProviderOperation + from .resource_type_py3 import ResourceType + from .provider_operations_metadata_py3 import ProviderOperationsMetadata + from .permission_py3 import Permission + from .role_definition_filter_py3 import RoleDefinitionFilter + from .role_definition_py3 import RoleDefinition + from .role_assignment_filter_py3 import RoleAssignmentFilter + from .role_assignment_py3 import RoleAssignment + from .role_assignment_create_parameters_py3 import RoleAssignmentCreateParameters +except (SyntaxError, ImportError): + from .classic_administrator import ClassicAdministrator + from .provider_operation import ProviderOperation + from .resource_type import ResourceType + from .provider_operations_metadata import ProviderOperationsMetadata + from .permission import Permission + from .role_definition_filter import RoleDefinitionFilter + from .role_definition import RoleDefinition + from .role_assignment_filter import RoleAssignmentFilter + from .role_assignment import RoleAssignment + from .role_assignment_create_parameters import RoleAssignmentCreateParameters from .classic_administrator_paged import ClassicAdministratorPaged from .provider_operations_metadata_paged import ProviderOperationsMetadataPaged from .permission_paged import PermissionPaged diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator.py index 8fce28f9dc4a..39b18378dd01 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator.py @@ -35,10 +35,10 @@ class ClassicAdministrator(Model): 'role': {'key': 'properties.role', 'type': 'str'}, } - def __init__(self, id=None, name=None, type=None, email_address=None, role=None): - super(ClassicAdministrator, self).__init__() - self.id = id - self.name = name - self.type = type - self.email_address = email_address - self.role = role + def __init__(self, **kwargs): + super(ClassicAdministrator, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.email_address = kwargs.get('email_address', None) + self.role = kwargs.get('role', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator_py3.py new file mode 100644 index 000000000000..97298cc3e684 --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator_py3.py @@ -0,0 +1,44 @@ +# 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 ClassicAdministrator(Model): + """Classic Administrators. + + :param id: The ID of the administrator. + :type id: str + :param name: The name of the administrator. + :type name: str + :param type: The type of the administrator. + :type type: str + :param email_address: The email address of the administrator. + :type email_address: str + :param role: The role of the administrator. + :type role: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email_address': {'key': 'properties.emailAddress', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, type: str=None, email_address: str=None, role: str=None, **kwargs) -> None: + super(ClassicAdministrator, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.email_address = email_address + self.role = role diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/permission.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/permission.py index 642310e9258f..3c86802d5d9e 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/permission.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/permission.py @@ -32,9 +32,9 @@ class Permission(Model): 'not_data_actions': {'key': 'notDataActions', 'type': '[str]'}, } - def __init__(self, actions=None, not_actions=None, data_actions=None, not_data_actions=None): - super(Permission, self).__init__() - self.actions = actions - self.not_actions = not_actions - self.data_actions = data_actions - self.not_data_actions = not_data_actions + def __init__(self, **kwargs): + super(Permission, self).__init__(**kwargs) + self.actions = kwargs.get('actions', None) + self.not_actions = kwargs.get('not_actions', None) + self.data_actions = kwargs.get('data_actions', None) + self.not_data_actions = kwargs.get('not_data_actions', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/permission_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/permission_py3.py new file mode 100644 index 000000000000..1b5a16e6acac --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/permission_py3.py @@ -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 Permission(Model): + """Role definition permissions. + + :param actions: Allowed actions. + :type actions: list[str] + :param not_actions: Denied actions. + :type not_actions: list[str] + :param data_actions: Allowed Data actions. + :type data_actions: list[str] + :param not_data_actions: Denied Data actions. + :type not_data_actions: list[str] + """ + + _attribute_map = { + 'actions': {'key': 'actions', 'type': '[str]'}, + 'not_actions': {'key': 'notActions', 'type': '[str]'}, + 'data_actions': {'key': 'dataActions', 'type': '[str]'}, + 'not_data_actions': {'key': 'notDataActions', 'type': '[str]'}, + } + + def __init__(self, *, actions=None, not_actions=None, data_actions=None, not_data_actions=None, **kwargs) -> None: + super(Permission, self).__init__(**kwargs) + self.actions = actions + self.not_actions = not_actions + self.data_actions = data_actions + self.not_data_actions = not_data_actions diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operation.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operation.py index 2aa83707763f..6ffdb218c04c 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operation.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operation.py @@ -38,11 +38,11 @@ class ProviderOperation(Model): 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } - def __init__(self, name=None, display_name=None, description=None, origin=None, properties=None, is_data_action=None): - super(ProviderOperation, self).__init__() - self.name = name - self.display_name = display_name - self.description = description - self.origin = origin - self.properties = properties - self.is_data_action = is_data_action + def __init__(self, **kwargs): + super(ProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + self.is_data_action = kwargs.get('is_data_action', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operation_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operation_py3.py new file mode 100644 index 000000000000..67e16f94b8a7 --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operation_py3.py @@ -0,0 +1,48 @@ +# 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 ProviderOperation(Model): + """Operation. + + :param name: The operation name. + :type name: str + :param display_name: The operation display name. + :type display_name: str + :param description: The operation description. + :type description: str + :param origin: The operation origin. + :type origin: str + :param properties: The operation properties. + :type properties: object + :param is_data_action: The dataAction flag to specify the operation type. + :type is_data_action: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, description: str=None, origin: str=None, properties=None, is_data_action: bool=None, **kwargs) -> None: + super(ProviderOperation, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.description = description + self.origin = origin + self.properties = properties + self.is_data_action = is_data_action diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operations_metadata.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operations_metadata.py index 24b752495034..8e13bb134567 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operations_metadata.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operations_metadata.py @@ -38,11 +38,11 @@ class ProviderOperationsMetadata(Model): 'operations': {'key': 'operations', 'type': '[ProviderOperation]'}, } - def __init__(self, id=None, name=None, type=None, display_name=None, resource_types=None, operations=None): - super(ProviderOperationsMetadata, self).__init__() - self.id = id - self.name = name - self.type = type - self.display_name = display_name - self.resource_types = resource_types - self.operations = operations + def __init__(self, **kwargs): + super(ProviderOperationsMetadata, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.display_name = kwargs.get('display_name', None) + self.resource_types = kwargs.get('resource_types', None) + self.operations = kwargs.get('operations', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operations_metadata_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operations_metadata_py3.py new file mode 100644 index 000000000000..f95caeb8b68f --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operations_metadata_py3.py @@ -0,0 +1,48 @@ +# 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 ProviderOperationsMetadata(Model): + """Provider Operations metadata. + + :param id: The provider id. + :type id: str + :param name: The provider name. + :type name: str + :param type: The provider type. + :type type: str + :param display_name: The provider display name. + :type display_name: str + :param resource_types: The provider resource types + :type resource_types: list[~azure.mgmt.authorization.models.ResourceType] + :param operations: The provider operations. + :type operations: list[~azure.mgmt.authorization.models.ProviderOperation] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ResourceType]'}, + 'operations': {'key': 'operations', 'type': '[ProviderOperation]'}, + } + + def __init__(self, *, id: str=None, name: str=None, type: str=None, display_name: str=None, resource_types=None, operations=None, **kwargs) -> None: + super(ProviderOperationsMetadata, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.display_name = display_name + self.resource_types = resource_types + self.operations = operations diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type.py index 7b14f1ab2dba..9cc2ab69019f 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type.py @@ -29,8 +29,8 @@ class ResourceType(Model): 'operations': {'key': 'operations', 'type': '[ProviderOperation]'}, } - def __init__(self, name=None, display_name=None, operations=None): - super(ResourceType, self).__init__() - self.name = name - self.display_name = display_name - self.operations = operations + def __init__(self, **kwargs): + super(ResourceType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.operations = kwargs.get('operations', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type_py3.py new file mode 100644 index 000000000000..78d6a0b98a54 --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type_py3.py @@ -0,0 +1,36 @@ +# 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 ResourceType(Model): + """Resource Type. + + :param name: The resource type name. + :type name: str + :param display_name: The resource type display name. + :type display_name: str + :param operations: The resource type operations. + :type operations: list[~azure.mgmt.authorization.models.ProviderOperation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'operations': {'key': 'operations', 'type': '[ProviderOperation]'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, operations=None, **kwargs) -> None: + super(ResourceType, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.operations = operations diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment.py index af2889bbd065..599d04d0b2cf 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment.py @@ -50,12 +50,12 @@ class RoleAssignment(Model): 'can_delegate': {'key': 'properties.canDelegate', 'type': 'bool'}, } - def __init__(self, scope=None, role_definition_id=None, principal_id=None, can_delegate=None): - super(RoleAssignment, self).__init__() + def __init__(self, **kwargs): + super(RoleAssignment, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.scope = scope - self.role_definition_id = role_definition_id - self.principal_id = principal_id - self.can_delegate = can_delegate + self.scope = kwargs.get('scope', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.can_delegate = kwargs.get('can_delegate', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_create_parameters.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_create_parameters.py index 159a5b88b8fa..5da7259a980e 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_create_parameters.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_create_parameters.py @@ -33,8 +33,8 @@ class RoleAssignmentCreateParameters(Model): 'can_delegate': {'key': 'properties.canDelegate', 'type': 'bool'}, } - def __init__(self, role_definition_id=None, principal_id=None, can_delegate=None): - super(RoleAssignmentCreateParameters, self).__init__() - self.role_definition_id = role_definition_id - self.principal_id = principal_id - self.can_delegate = can_delegate + def __init__(self, **kwargs): + super(RoleAssignmentCreateParameters, self).__init__(**kwargs) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.can_delegate = kwargs.get('can_delegate', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_create_parameters_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_create_parameters_py3.py new file mode 100644 index 000000000000..7570e2aa0234 --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_create_parameters_py3.py @@ -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 RoleAssignmentCreateParameters(Model): + """Role assignment create parameters. + + :param role_definition_id: The role definition ID used in the role + assignment. + :type role_definition_id: str + :param principal_id: The principal ID assigned to the role. This maps to + the ID inside the Active Directory. It can point to a user, service + principal, or security group. + :type principal_id: str + :param can_delegate: The delgation flag used for creating a role + assignment + :type can_delegate: bool + """ + + _attribute_map = { + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'can_delegate': {'key': 'properties.canDelegate', 'type': 'bool'}, + } + + def __init__(self, *, role_definition_id: str=None, principal_id: str=None, can_delegate: bool=None, **kwargs) -> None: + super(RoleAssignmentCreateParameters, self).__init__(**kwargs) + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.can_delegate = can_delegate diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_filter.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_filter.py index 0c3d1d00755d..940b6baccc3c 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_filter.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_filter.py @@ -26,7 +26,7 @@ class RoleAssignmentFilter(Model): 'can_delegate': {'key': 'canDelegate', 'type': 'bool'}, } - def __init__(self, principal_id=None, can_delegate=None): - super(RoleAssignmentFilter, self).__init__() - self.principal_id = principal_id - self.can_delegate = can_delegate + def __init__(self, **kwargs): + super(RoleAssignmentFilter, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.can_delegate = kwargs.get('can_delegate', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_filter_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_filter_py3.py new file mode 100644 index 000000000000..cfa2af336134 --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_filter_py3.py @@ -0,0 +1,32 @@ +# 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 RoleAssignmentFilter(Model): + """Role Assignments filter. + + :param principal_id: Returns role assignment of the specific principal. + :type principal_id: str + :param can_delegate: The Delegation flag for the roleassignment + :type can_delegate: bool + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'can_delegate': {'key': 'canDelegate', 'type': 'bool'}, + } + + def __init__(self, *, principal_id: str=None, can_delegate: bool=None, **kwargs) -> None: + super(RoleAssignmentFilter, self).__init__(**kwargs) + self.principal_id = principal_id + self.can_delegate = can_delegate diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_py3.py new file mode 100644 index 000000000000..15af2402089d --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_py3.py @@ -0,0 +1,61 @@ +# 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 RoleAssignment(Model): + """Role Assignments. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role assignment ID. + :vartype id: str + :ivar name: The role assignment name. + :vartype name: str + :ivar type: The role assignment type. + :vartype type: str + :param scope: The role assignment scope. + :type scope: str + :param role_definition_id: The role definition ID. + :type role_definition_id: str + :param principal_id: The principal ID. + :type principal_id: str + :param can_delegate: The Delegation flag for the roleassignment + :type can_delegate: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'can_delegate': {'key': 'properties.canDelegate', 'type': 'bool'}, + } + + def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, can_delegate: bool=None, **kwargs) -> None: + super(RoleAssignment, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.scope = scope + self.role_definition_id = role_definition_id + self.principal_id = principal_id + self.can_delegate = can_delegate diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition.py index 86950ebb8b7b..650dfa9d5382 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition.py @@ -53,13 +53,13 @@ class RoleDefinition(Model): 'assignable_scopes': {'key': 'properties.assignableScopes', 'type': '[str]'}, } - def __init__(self, role_name=None, description=None, role_type=None, permissions=None, assignable_scopes=None): - super(RoleDefinition, self).__init__() + def __init__(self, **kwargs): + super(RoleDefinition, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.role_name = role_name - self.description = description - self.role_type = role_type - self.permissions = permissions - self.assignable_scopes = assignable_scopes + self.role_name = kwargs.get('role_name', None) + self.description = kwargs.get('description', None) + self.role_type = kwargs.get('role_type', None) + self.permissions = kwargs.get('permissions', None) + self.assignable_scopes = kwargs.get('assignable_scopes', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_filter.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_filter.py index 12ebc15ab56a..1fc9ae59aa3a 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_filter.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_filter.py @@ -17,12 +17,16 @@ class RoleDefinitionFilter(Model): :param role_name: Returns role definition with the specific name. :type role_name: str + :param type: Returns role definition with the specific type. + :type type: str """ _attribute_map = { 'role_name': {'key': 'roleName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, role_name=None): - super(RoleDefinitionFilter, self).__init__() - self.role_name = role_name + def __init__(self, **kwargs): + super(RoleDefinitionFilter, self).__init__(**kwargs) + self.role_name = kwargs.get('role_name', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_filter_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_filter_py3.py new file mode 100644 index 000000000000..e511adc3df35 --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_filter_py3.py @@ -0,0 +1,32 @@ +# 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 RoleDefinitionFilter(Model): + """Role Definitions filter. + + :param role_name: Returns role definition with the specific name. + :type role_name: str + :param type: Returns role definition with the specific type. + :type type: str + """ + + _attribute_map = { + 'role_name': {'key': 'roleName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, role_name: str=None, type: str=None, **kwargs) -> None: + super(RoleDefinitionFilter, self).__init__(**kwargs) + self.role_name = role_name + self.type = type diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_py3.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_py3.py new file mode 100644 index 000000000000..c3533531c8d3 --- /dev/null +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_py3.py @@ -0,0 +1,65 @@ +# 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 RoleDefinition(Model): + """Role definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The role definition ID. + :vartype id: str + :ivar name: The role definition name. + :vartype name: str + :ivar type: The role definition type. + :vartype type: str + :param role_name: The role name. + :type role_name: str + :param description: The role definition description. + :type description: str + :param role_type: The role type. + :type role_type: str + :param permissions: Role definition permissions. + :type permissions: list[~azure.mgmt.authorization.models.Permission] + :param assignable_scopes: Role definition assignable scopes. + :type assignable_scopes: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'role_name': {'key': 'properties.roleName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'role_type': {'key': 'properties.type', 'type': 'str'}, + 'permissions': {'key': 'properties.permissions', 'type': '[Permission]'}, + 'assignable_scopes': {'key': 'properties.assignableScopes', 'type': '[str]'}, + } + + def __init__(self, *, role_name: str=None, description: str=None, role_type: str=None, permissions=None, assignable_scopes=None, **kwargs) -> None: + super(RoleDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.role_name = role_name + self.description = description + self.role_type = role_type + self.permissions = permissions + self.assignable_scopes = assignable_scopes