From 04e8425d4d7846c5123590a3619e7d91475ba56b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 29 Jan 2018 22:36:19 +0000 Subject: [PATCH 1/5] Generated from 3fe7452d75e89c2f488b6ed05e2e79507a5afdac move provider operations to new api --- .../authorization_management_client.py | 13 ++-- .../mgmt/authorization/models/__init__.py | 28 +++----- .../models/classic_administrator.py | 16 +++-- .../classic_administrator_properties.py | 31 --------- .../mgmt/authorization/models/permission.py | 11 ++- .../models/provider_operation.py | 7 +- .../models/provider_operations_metadata.py | 1 + .../authorization/models/resource_type.py | 1 + .../authorization/models/role_assignment.py | 51 +++++++++----- .../role_assignment_create_parameters.py | 24 +++++-- .../models/role_assignment_filter.py | 7 +- .../models/role_assignment_properties.py | 34 ---------- .../role_assignment_properties_with_scope.py | 35 ---------- .../authorization/models/role_definition.py | 55 ++++++++++----- .../models/role_definition_filter.py | 1 + .../models/role_definition_properties.py | 43 ------------ .../mgmt/authorization/operations/__init__.py | 4 +- .../classic_administrators_operations.py | 4 +- .../operations/permissions_operations.py | 10 +-- ...provider_operations_metadata_operations.py | 6 +- .../operations/role_assignments_operations.py | 67 +++++++------------ .../operations/role_definitions_operations.py | 16 +++-- .../azure/mgmt/authorization/version.py | 2 +- 23 files changed, 195 insertions(+), 272 deletions(-) delete mode 100644 azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator_properties.py delete mode 100644 azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_properties.py delete mode 100644 azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_properties_with_scope.py delete mode 100644 azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_properties.py diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/authorization_management_client.py b/azure-mgmt-authorization/azure/mgmt/authorization/authorization_management_client.py index f0593558014a..e77aa2fa0ef9 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/authorization_management_client.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/authorization_management_client.py @@ -14,8 +14,8 @@ from msrestazure import AzureConfiguration from .version import VERSION from .operations.classic_administrators_operations import ClassicAdministratorsOperations -from .operations.permissions_operations import PermissionsOperations from .operations.provider_operations_metadata_operations import ProviderOperationsMetadataOperations +from .operations.permissions_operations import PermissionsOperations from .operations.role_assignments_operations import RoleAssignmentsOperations from .operations.role_definitions_operations import RoleDefinitionsOperations from . import models @@ -46,7 +46,7 @@ def __init__( super(AuthorizationManagementClientConfiguration, self).__init__(base_url) - self.add_user_agent('authorizationmanagementclient/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-authorization/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials @@ -61,10 +61,10 @@ class AuthorizationManagementClient(object): :ivar classic_administrators: ClassicAdministrators operations :vartype classic_administrators: azure.mgmt.authorization.operations.ClassicAdministratorsOperations - :ivar permissions: Permissions operations - :vartype permissions: azure.mgmt.authorization.operations.PermissionsOperations :ivar provider_operations_metadata: ProviderOperationsMetadata operations :vartype provider_operations_metadata: azure.mgmt.authorization.operations.ProviderOperationsMetadataOperations + :ivar permissions: Permissions operations + :vartype permissions: azure.mgmt.authorization.operations.PermissionsOperations :ivar role_assignments: RoleAssignments operations :vartype role_assignments: azure.mgmt.authorization.operations.RoleAssignmentsOperations :ivar role_definitions: RoleDefinitions operations @@ -85,16 +85,15 @@ def __init__( self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2015-07-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.classic_administrators = ClassicAdministratorsOperations( self._client, self.config, self._serialize, self._deserialize) - self.permissions = PermissionsOperations( - self._client, self.config, self._serialize, self._deserialize) self.provider_operations_metadata = ProviderOperationsMetadataOperations( self._client, self.config, self._serialize, self._deserialize) + self.permissions = PermissionsOperations( + self._client, self.config, self._serialize, self._deserialize) self.role_assignments = RoleAssignmentsOperations( self._client, self.config, self._serialize, self._deserialize) self.role_definitions = RoleDefinitionsOperations( diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/__init__.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/__init__.py index d6929bc116e7..b93bf8fe735b 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/__init__.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/__init__.py @@ -9,44 +9,36 @@ # regenerated. # -------------------------------------------------------------------------- -from .role_assignment_filter import RoleAssignmentFilter -from .role_definition_filter import RoleDefinitionFilter -from .classic_administrator_properties import ClassicAdministratorProperties from .classic_administrator import ClassicAdministrator -from .permission import Permission from .provider_operation import ProviderOperation from .resource_type import ResourceType from .provider_operations_metadata import ProviderOperationsMetadata -from .role_assignment_properties_with_scope import RoleAssignmentPropertiesWithScope +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_properties import RoleAssignmentProperties from .role_assignment_create_parameters import RoleAssignmentCreateParameters -from .role_definition_properties import RoleDefinitionProperties -from .role_definition import RoleDefinition from .classic_administrator_paged import ClassicAdministratorPaged -from .permission_paged import PermissionPaged from .provider_operations_metadata_paged import ProviderOperationsMetadataPaged +from .permission_paged import PermissionPaged from .role_assignment_paged import RoleAssignmentPaged from .role_definition_paged import RoleDefinitionPaged __all__ = [ - 'RoleAssignmentFilter', - 'RoleDefinitionFilter', - 'ClassicAdministratorProperties', 'ClassicAdministrator', - 'Permission', 'ProviderOperation', 'ResourceType', 'ProviderOperationsMetadata', - 'RoleAssignmentPropertiesWithScope', + 'Permission', + 'RoleDefinitionFilter', + 'RoleDefinition', + 'RoleAssignmentFilter', 'RoleAssignment', - 'RoleAssignmentProperties', 'RoleAssignmentCreateParameters', - 'RoleDefinitionProperties', - 'RoleDefinition', 'ClassicAdministratorPaged', - 'PermissionPaged', 'ProviderOperationsMetadataPaged', + 'PermissionPaged', 'RoleAssignmentPaged', 'RoleDefinitionPaged', ] 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 25efd96c0bc4..8fce28f9dc4a 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator.py @@ -21,20 +21,24 @@ class ClassicAdministrator(Model): :type name: str :param type: The type of the administrator. :type type: str - :param properties: Properties for the classic administrator. - :type properties: - ~azure.mgmt.authorization.models.ClassicAdministratorProperties + :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'}, - 'properties': {'key': 'properties', 'type': 'ClassicAdministratorProperties'}, + 'email_address': {'key': 'properties.emailAddress', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, } - def __init__(self, id=None, name=None, type=None, properties=None): + 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.properties = properties + self.email_address = email_address + self.role = role diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator_properties.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator_properties.py deleted file mode 100644 index b07e4e172d7b..000000000000 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/classic_administrator_properties.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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 ClassicAdministratorProperties(Model): - """Classic Administrator properties. - - :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 = { - 'email_address': {'key': 'emailAddress', 'type': 'str'}, - 'role': {'key': 'role', 'type': 'str'}, - } - - def __init__(self, email_address=None, role=None): - 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 7efd4cdc6b8e..642310e9258f 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/permission.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/permission.py @@ -19,13 +19,22 @@ class Permission(Model): :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): + 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 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 90fc912b059a..2aa83707763f 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operation.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/provider_operation.py @@ -25,6 +25,8 @@ class ProviderOperation(Model): :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 = { @@ -33,11 +35,14 @@ class ProviderOperation(Model): '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=None, display_name=None, description=None, origin=None, properties=None): + 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 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 44e25c5a7d19..24b752495034 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 @@ -39,6 +39,7 @@ class ProviderOperationsMetadata(Model): } 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 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 b5e89bef963a..7b14f1ab2dba 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type.py @@ -30,6 +30,7 @@ class ResourceType(Model): } 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 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 f902eccea1a3..af2889bbd065 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment.py @@ -15,26 +15,47 @@ class RoleAssignment(Model): """Role Assignments. - :param id: The role assignment ID. - :type id: str - :param name: The role assignment name. - :type name: str - :param type: The role assignment type. - :type type: str - :param properties: Role assignment properties. - :type properties: - ~azure.mgmt.authorization.models.RoleAssignmentPropertiesWithScope + 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'}, - 'properties': {'key': 'properties', 'type': 'RoleAssignmentPropertiesWithScope'}, + '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, id=None, name=None, type=None, properties=None): - self.id = id - self.name = name - self.type = type - self.properties = properties + def __init__(self, scope=None, role_definition_id=None, principal_id=None, can_delegate=None): + super(RoleAssignment, self).__init__() + 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_assignment_create_parameters.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_create_parameters.py index 758231145cbc..159a5b88b8fa 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 @@ -15,14 +15,26 @@ class RoleAssignmentCreateParameters(Model): """Role assignment create parameters. - :param properties: Role assignment properties. - :type properties: - ~azure.mgmt.authorization.models.RoleAssignmentProperties + :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 = { - 'properties': {'key': 'properties', 'type': 'RoleAssignmentProperties'}, + '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, properties=None): - self.properties = properties + 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 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 9245c6be8bde..0c3d1d00755d 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 @@ -17,11 +17,16 @@ class RoleAssignmentFilter(Model): :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=None): + def __init__(self, principal_id=None, can_delegate=None): + super(RoleAssignmentFilter, self).__init__() self.principal_id = principal_id + self.can_delegate = can_delegate diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_properties.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_properties.py deleted file mode 100644 index 1548fe078839..000000000000 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_properties.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 RoleAssignmentProperties(Model): - """Role assignment properties. - - :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 - """ - - _attribute_map = { - 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__(self, role_definition_id=None, principal_id=None): - self.role_definition_id = role_definition_id - self.principal_id = principal_id diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_properties_with_scope.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_properties_with_scope.py deleted file mode 100644 index 87a5240e9024..000000000000 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_assignment_properties_with_scope.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 RoleAssignmentPropertiesWithScope(Model): - """Role assignment properties with scope. - - :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 - """ - - _attribute_map = { - 'scope': {'key': 'scope', 'type': 'str'}, - 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - } - - def __init__(self, scope=None, role_definition_id=None, principal_id=None): - self.scope = scope - self.role_definition_id = role_definition_id - self.principal_id = principal_id 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 a4a964be8195..86950ebb8b7b 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition.py @@ -15,26 +15,51 @@ class RoleDefinition(Model): """Role definition. - :param id: The role definition ID. - :type id: str - :param name: The role definition name. - :type name: str - :param type: The role definition type. - :type type: str - :param properties: Role definition properties. - :type properties: - ~azure.mgmt.authorization.models.RoleDefinitionProperties + 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'}, - 'properties': {'key': 'properties', 'type': 'RoleDefinitionProperties'}, + '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, id=None, name=None, type=None, properties=None): - self.id = id - self.name = name - self.type = type - self.properties = properties + def __init__(self, role_name=None, description=None, role_type=None, permissions=None, assignable_scopes=None): + super(RoleDefinition, self).__init__() + 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 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 4a59d8828754..12ebc15ab56a 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 @@ -24,4 +24,5 @@ class RoleDefinitionFilter(Model): } def __init__(self, role_name=None): + super(RoleDefinitionFilter, self).__init__() self.role_name = role_name diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_properties.py b/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_properties.py deleted file mode 100644 index 9f6d8c4378a4..000000000000 --- a/azure-mgmt-authorization/azure/mgmt/authorization/models/role_definition_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 RoleDefinitionProperties(Model): - """Role definition properties. - - :param role_name: The role name. - :type role_name: str - :param description: The role definition description. - :type description: str - :param type: The role type. - :type 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] - """ - - _attribute_map = { - 'role_name': {'key': 'roleName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': '[Permission]'}, - 'assignable_scopes': {'key': 'assignableScopes', 'type': '[str]'}, - } - - def __init__(self, role_name=None, description=None, type=None, permissions=None, assignable_scopes=None): - self.role_name = role_name - self.description = description - self.type = type - self.permissions = permissions - self.assignable_scopes = assignable_scopes diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/__init__.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/__init__.py index d0f4cbe64419..98bf8abf8854 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/__init__.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/__init__.py @@ -10,15 +10,15 @@ # -------------------------------------------------------------------------- from .classic_administrators_operations import ClassicAdministratorsOperations -from .permissions_operations import PermissionsOperations from .provider_operations_metadata_operations import ProviderOperationsMetadataOperations +from .permissions_operations import PermissionsOperations from .role_assignments_operations import RoleAssignmentsOperations from .role_definitions_operations import RoleDefinitionsOperations __all__ = [ 'ClassicAdministratorsOperations', - 'PermissionsOperations', 'ProviderOperationsMetadataOperations', + 'PermissionsOperations', 'RoleAssignmentsOperations', 'RoleDefinitionsOperations', ] diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/classic_administrators_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/classic_administrators_operations.py index 881f1ca1466c..9dc4c1e64a36 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/classic_administrators_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/classic_administrators_operations.py @@ -25,6 +25,8 @@ class ClassicAdministratorsOperations(object): :param deserializer: An objec model deserializer. """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +83,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/permissions_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/permissions_operations.py index 9f3fff7f2d2c..416a4c7b5e37 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/permissions_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/permissions_operations.py @@ -23,15 +23,17 @@ class PermissionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2015-07-01". + :ivar api_version: The API version to use for this operation. Constant value: "2018-01-01-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-07-01" + self.api_version = "2018-01-01-preview" self.config = config @@ -84,7 +86,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -166,7 +168,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/provider_operations_metadata_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/provider_operations_metadata_operations.py index e65699e3bc63..4357c206db33 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/provider_operations_metadata_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/provider_operations_metadata_operations.py @@ -25,6 +25,8 @@ class ProviderOperationsMetadataOperations(object): :param deserializer: An objec model deserializer. """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -79,7 +81,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -144,7 +146,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py index df2216cd437c..3988fbae1f1f 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py @@ -23,15 +23,17 @@ class RoleAssignmentsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2015-07-01". + :ivar api_version: The API version to use for this operation. Constant value: "2018-01-01-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-07-01" + self.api_version = "2018-01-01-preview" self.config = config @@ -104,7 +106,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -178,7 +180,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -240,7 +242,7 @@ def delete( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -259,7 +261,7 @@ def delete( return deserialized def create( - self, scope, role_assignment_name, properties=None, custom_headers=None, raw=False, **operation_config): + self, scope, role_assignment_name, parameters, custom_headers=None, raw=False, **operation_config): """Creates a role assignment. :param scope: The scope of the role assignment to create. The scope @@ -273,9 +275,9 @@ def create( :param role_assignment_name: The name of the role assignment to create. It can be any valid GUID. :type role_assignment_name: str - :param properties: Role assignment properties. - :type properties: - ~azure.mgmt.authorization.models.RoleAssignmentProperties + :param parameters: Parameters for the role assignment. + :type parameters: + ~azure.mgmt.authorization.models.RoleAssignmentCreateParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -286,8 +288,6 @@ def create( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.RoleAssignmentCreateParameters(properties=properties) - # Construct URL url = '/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}' path_format_arguments = { @@ -316,7 +316,7 @@ def create( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -376,7 +376,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -398,12 +398,7 @@ def delete_by_id( self, role_assignment_id, custom_headers=None, raw=False, **operation_config): """Deletes a role assignment. - :param role_assignment_id: The fully qualified ID of the role - assignment, including the scope, resource name and resource type. Use - the format, - /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - Example: - /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + :param role_assignment_id: The ID of the role assignment to delete. :type role_assignment_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -438,7 +433,7 @@ def delete_by_id( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -457,19 +452,14 @@ def delete_by_id( return deserialized def create_by_id( - self, role_assignment_id, properties=None, custom_headers=None, raw=False, **operation_config): + self, role_assignment_id, parameters, custom_headers=None, raw=False, **operation_config): """Creates a role assignment by ID. - :param role_assignment_id: The fully qualified ID of the role - assignment, including the scope, resource name and resource type. Use - the format, - /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - Example: - /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + :param role_assignment_id: The ID of the role assignment to create. :type role_assignment_id: str - :param properties: Role assignment properties. - :type properties: - ~azure.mgmt.authorization.models.RoleAssignmentProperties + :param parameters: Parameters for the role assignment. + :type parameters: + ~azure.mgmt.authorization.models.RoleAssignmentCreateParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -480,8 +470,6 @@ def create_by_id( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.RoleAssignmentCreateParameters(properties=properties) - # Construct URL url = '/{roleAssignmentId}' path_format_arguments = { @@ -509,7 +497,7 @@ def create_by_id( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -531,12 +519,7 @@ def get_by_id( self, role_assignment_id, custom_headers=None, raw=False, **operation_config): """Gets a role assignment by ID. - :param role_assignment_id: The fully qualified ID of the role - assignment, including the scope, resource name and resource type. Use - the format, - /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - Example: - /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + :param role_assignment_id: The ID of the role assignment to get. :type role_assignment_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -571,7 +554,7 @@ def get_by_id( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -641,7 +624,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -714,7 +697,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py index f20886e85470..cdc48f6f83c5 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py @@ -23,15 +23,17 @@ class RoleDefinitionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2015-07-01". + :ivar api_version: The API version to use for this operation. Constant value: "2018-01-01-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-07-01" + self.api_version = "2018-01-01-preview" self.config = config @@ -77,7 +79,7 @@ def delete( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -137,7 +139,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -203,7 +205,7 @@ def create_or_update( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [201]: exp = CloudError(response) @@ -265,7 +267,7 @@ def get_by_id( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -335,7 +337,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/version.py b/azure-mgmt-authorization/azure/mgmt/authorization/version.py index b9a4e2bd3544..53a203f32aaf 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/version.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.30.0" +VERSION = "" From eb3fbd598fbcf41c193e4c7680e3fb4d0f6377e2 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 31 Jan 2018 02:03:08 +0000 Subject: [PATCH 2/5] Generated from aa1e9fbb36dfecf49feffeff4377fc5e26236ecf address some of the comments --- .../authorization_management_client.py | 22 +++- .../classic_administrators_operations.py | 8 +- .../operations/permissions_operations.py | 19 +-- ...provider_operations_metadata_operations.py | 19 +-- .../operations/role_assignments_operations.py | 17 +-- .../operations/role_definitions_operations.py | 124 +++++++++--------- 6 files changed, 102 insertions(+), 107 deletions(-) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/authorization_management_client.py b/azure-mgmt-authorization/azure/mgmt/authorization/authorization_management_client.py index e77aa2fa0ef9..383b3427b4de 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/authorization_management_client.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/authorization_management_client.py @@ -31,16 +31,25 @@ class AuthorizationManagementClientConfiguration(AzureConfiguration): object` :param subscription_id: The ID of the target subscription. :type subscription_id: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, resource_group_name, resource_provider_namespace, base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") + if resource_group_name is None: + raise ValueError("Parameter 'resource_group_name' must not be None.") + if resource_provider_namespace is None: + raise ValueError("Parameter 'resource_provider_namespace' must not be None.") if not base_url: base_url = 'https://management.azure.com' @@ -51,6 +60,8 @@ def __init__( self.credentials = credentials self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.resource_provider_namespace = resource_provider_namespace class AuthorizationManagementClient(object): @@ -75,13 +86,18 @@ class AuthorizationManagementClient(object): object` :param subscription_id: The ID of the target subscription. :type subscription_id: str + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, resource_group_name, resource_provider_namespace, base_url=None): - self.config = AuthorizationManagementClientConfiguration(credentials, subscription_id, base_url) + self.config = AuthorizationManagementClientConfiguration(credentials, subscription_id, resource_group_name, resource_provider_namespace, base_url) self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/classic_administrators_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/classic_administrators_operations.py index 9dc4c1e64a36..f07a3ce078e5 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/classic_administrators_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/classic_administrators_operations.py @@ -23,6 +23,7 @@ class ClassicAdministratorsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-07-01". """ models = models @@ -32,16 +33,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2015-07-01" self.config = config def list( - self, api_version, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Gets service administrator, account administrator, and co-administrators for the subscription. - :param api_version: The API version to use for this operation. - :type api_version: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -64,7 +64,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/permissions_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/permissions_operations.py index 416a4c7b5e37..32321c25907d 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/permissions_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/permissions_operations.py @@ -38,12 +38,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_for_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Gets all permissions the caller has for a resource group. - :param resource_group_name: The name of the resource group to get the - permissions for. The name is case insensitive. - :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -60,7 +57,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Authorization/permissions' path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -106,15 +103,9 @@ def internal_paging(next_link=None, raw=False): return deserialized def list_for_resource( - self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + self, parent_resource_path, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): """Gets all permissions the caller has for a resource. - :param resource_group_name: The name of the resource group containing - the resource. The name is case insensitive. - :type resource_group_name: str - :param resource_provider_namespace: The namespace of the resource - provider. - :type resource_provider_namespace: str :param parent_resource_path: The parent resource identity. :type parent_resource_path: str :param resource_type: The resource type of the resource. @@ -138,8 +129,8 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/permissions' path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str'), + 'resourceProviderNamespace': self._serialize.url("self.config.resource_provider_namespace", self.config.resource_provider_namespace, 'str'), 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/provider_operations_metadata_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/provider_operations_metadata_operations.py index 4357c206db33..83966387e379 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/provider_operations_metadata_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/provider_operations_metadata_operations.py @@ -23,6 +23,7 @@ class ProviderOperationsMetadataOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2018-01-01-preview". """ models = models @@ -32,18 +33,14 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2018-01-01-preview" self.config = config def get( - self, resource_provider_namespace, api_version, expand="resourceTypes", custom_headers=None, raw=False, **operation_config): + self, expand="resourceTypes", custom_headers=None, raw=False, **operation_config): """Gets provider operations metadata for the specified resource provider. - :param resource_provider_namespace: The namespace of the resource - provider. - :type resource_provider_namespace: str - :param api_version: The API version to use for the operation. - :type api_version: str :param expand: Specifies whether to expand the values. :type expand: str :param dict custom_headers: headers that will be added to the request @@ -59,13 +56,13 @@ def get( # Construct URL url = '/providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}' path_format_arguments = { - 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str') + 'resourceProviderNamespace': self._serialize.url("self.config.resource_provider_namespace", self.config.resource_provider_namespace, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') @@ -100,11 +97,9 @@ def get( return deserialized def list( - self, api_version, expand="resourceTypes", custom_headers=None, raw=False, **operation_config): + self, expand="resourceTypes", custom_headers=None, raw=False, **operation_config): """Gets provider operations metadata for all resource providers. - :param api_version: The API version to use for this operation. - :type api_version: str :param expand: Specifies whether to expand the values. :type expand: str :param dict custom_headers: headers that will be added to the request @@ -125,7 +120,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py index 3988fbae1f1f..f4bca0545d01 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py @@ -38,14 +38,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config 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): + self, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets role assignments for a resource. - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param resource_provider_namespace: The namespace of the resource - provider. - :type resource_provider_namespace: str :param parent_resource_path: The parent resource identity. :type parent_resource_path: str :param resource_type: The resource type of the resource. @@ -74,8 +69,8 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/roleAssignments' path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str'), + 'resourceProviderNamespace': self._serialize.url("self.config.resource_provider_namespace", self.config.resource_provider_namespace, 'str'), 'parentResourcePath': self._serialize.url("parent_resource_path", parent_resource_path, 'str', skip_quote=True), 'resourceType': self._serialize.url("resource_type", resource_type, 'str', skip_quote=True), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), @@ -126,11 +121,9 @@ def internal_paging(next_link=None, raw=False): return deserialized def list_for_resource_group( - self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): + self, filter=None, custom_headers=None, raw=False, **operation_config): """Gets role assignments for a resource group. - :param resource_group_name: The name of the resource group. - :type resource_group_name: str :param filter: The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments @@ -152,7 +145,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments' path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py index cdc48f6f83c5..3e0762447b7c 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py @@ -223,68 +223,6 @@ def create_or_update( return deserialized - def get_by_id( - self, role_definition_id, custom_headers=None, raw=False, **operation_config): - """Gets a role definition by ID. - - :param role_definition_id: The fully qualified role definition ID. Use - the format, - /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} - for subscription level role definitions, or - /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} - for tenant level role definitions. - :type role_definition_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: RoleDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.authorization.models.RoleDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/{roleDefinitionId}' - path_format_arguments = { - 'roleDefinitionId': self._serialize.url("role_definition_id", role_definition_id, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('RoleDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - def list( self, scope, filter=None, custom_headers=None, raw=False, **operation_config): """Get all role definitions that are applicable at scope and above. @@ -355,3 +293,65 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + + def get_by_id( + self, role_definition_id, custom_headers=None, raw=False, **operation_config): + """Gets a role definition by ID. + + :param role_definition_id: The fully qualified role definition ID. Use + the format, + /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + for subscription level role definitions, or + /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + for tenant level role definitions. + :type role_definition_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.authorization.models.RoleDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/{roleDefinitionId}' + path_format_arguments = { + 'roleDefinitionId': self._serialize.url("role_definition_id", role_definition_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RoleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized From abba98d954c8fdbca015dbb31bd5569da6e13186 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 1 Feb 2018 01:09:44 +0000 Subject: [PATCH 3/5] Generated from d2d5d9914320bac8573f53c6582b680f2322f504 add missed out batch api in readme --- .../operations/role_definitions_operations.py | 64 ++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py index 3e0762447b7c..82becaf7c231 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py @@ -37,6 +37,68 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def get_by_id( + self, role_definition_id, custom_headers=None, raw=False, **operation_config): + """Gets a role definition by ID. + + :param role_definition_id: The fully qualified role definition ID. Use + the format, + /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + for subscription level role definitions, or + /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + for tenant level role definitions. + :type role_definition_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.authorization.models.RoleDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/{roleDefinitionId}' + path_format_arguments = { + 'roleDefinitionId': self._serialize.url("role_definition_id", role_definition_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RoleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + def delete( self, scope, role_definition_id, custom_headers=None, raw=False, **operation_config): """Deletes a role definition. @@ -294,7 +356,7 @@ def internal_paging(next_link=None, raw=False): return deserialized - def get_by_id( + def get_by_id1( self, role_definition_id, custom_headers=None, raw=False, **operation_config): """Gets a role definition by ID. From 16477599f3622f683f6a6b50a101cd470ef7f378 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 1 Feb 2018 01:33:19 +0000 Subject: [PATCH 4/5] Generated from 42f52c7c15f7d7b316a4fde6d8841dae22cc04fa fix testing error --- .../operations/role_definitions_operations.py | 64 +------------------ 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py index 82becaf7c231..3e0762447b7c 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py @@ -37,68 +37,6 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get_by_id( - self, role_definition_id, custom_headers=None, raw=False, **operation_config): - """Gets a role definition by ID. - - :param role_definition_id: The fully qualified role definition ID. Use - the format, - /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} - for subscription level role definitions, or - /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} - for tenant level role definitions. - :type role_definition_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: RoleDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.authorization.models.RoleDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/{roleDefinitionId}' - path_format_arguments = { - 'roleDefinitionId': self._serialize.url("role_definition_id", role_definition_id, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('RoleDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - def delete( self, scope, role_definition_id, custom_headers=None, raw=False, **operation_config): """Deletes a role definition. @@ -356,7 +294,7 @@ def internal_paging(next_link=None, raw=False): return deserialized - def get_by_id1( + def get_by_id( self, role_definition_id, custom_headers=None, raw=False, **operation_config): """Gets a role definition by ID. From 0fafe0bf42bc54427e908250219bdfb78b2b884d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 2 Feb 2018 00:33:44 +0000 Subject: [PATCH 5/5] Generated from dc3eead8cc10381cfcb37d54dc89c0c9d49d53cf fix linter issues --- .../operations/role_assignments_operations.py | 30 +++++++++---------- .../operations/role_definitions_operations.py | 12 ++++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py index f4bca0545d01..d4a055668d75 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_assignments_operations.py @@ -388,11 +388,11 @@ def get( return deserialized def delete_by_id( - self, role_assignment_id, custom_headers=None, raw=False, **operation_config): + self, role_id, custom_headers=None, raw=False, **operation_config): """Deletes a role assignment. - :param role_assignment_id: The ID of the role assignment to delete. - :type role_assignment_id: str + :param role_id: The ID of the role assignment to delete. + :type role_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -404,9 +404,9 @@ def delete_by_id( :raises: :class:`CloudError` """ # Construct URL - url = '/{roleAssignmentId}' + url = '/{roleId}' path_format_arguments = { - 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str', skip_quote=True) + 'roleId': self._serialize.url("role_id", role_id, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -445,11 +445,11 @@ def delete_by_id( return deserialized def create_by_id( - self, role_assignment_id, parameters, custom_headers=None, raw=False, **operation_config): + self, role_id, parameters, custom_headers=None, raw=False, **operation_config): """Creates a role assignment by ID. - :param role_assignment_id: The ID of the role assignment to create. - :type role_assignment_id: str + :param role_id: The ID of the role assignment to create. + :type role_id: str :param parameters: Parameters for the role assignment. :type parameters: ~azure.mgmt.authorization.models.RoleAssignmentCreateParameters @@ -464,9 +464,9 @@ def create_by_id( :raises: :class:`CloudError` """ # Construct URL - url = '/{roleAssignmentId}' + url = '/{roleId}' path_format_arguments = { - 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str', skip_quote=True) + 'roleId': self._serialize.url("role_id", role_id, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -509,11 +509,11 @@ def create_by_id( return deserialized def get_by_id( - self, role_assignment_id, custom_headers=None, raw=False, **operation_config): + self, role_id, custom_headers=None, raw=False, **operation_config): """Gets a role assignment by ID. - :param role_assignment_id: The ID of the role assignment to get. - :type role_assignment_id: str + :param role_id: The ID of the role assignment to get. + :type role_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -525,9 +525,9 @@ def get_by_id( :raises: :class:`CloudError` """ # Construct URL - url = '/{roleAssignmentId}' + url = '/{roleId}' path_format_arguments = { - 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str', skip_quote=True) + 'roleId': self._serialize.url("role_id", role_id, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) diff --git a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py index 3e0762447b7c..e6e1e474a139 100644 --- a/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py +++ b/azure-mgmt-authorization/azure/mgmt/authorization/operations/role_definitions_operations.py @@ -295,16 +295,16 @@ def internal_paging(next_link=None, raw=False): return deserialized def get_by_id( - self, role_definition_id, custom_headers=None, raw=False, **operation_config): + self, role_id, custom_headers=None, raw=False, **operation_config): """Gets a role definition by ID. - :param role_definition_id: The fully qualified role definition ID. Use - the format, + :param role_id: The fully qualified role definition ID. Use the + format, /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role definitions. - :type role_definition_id: str + :type role_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -316,9 +316,9 @@ def get_by_id( :raises: :class:`CloudError` """ # Construct URL - url = '/{roleDefinitionId}' + url = '/{roleId}' path_format_arguments = { - 'roleDefinitionId': self._serialize.url("role_definition_id", role_definition_id, 'str', skip_quote=True) + 'roleId': self._serialize.url("role_id", role_id, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments)