From ab8fdb6ed4eeb2cca825c0bdb366b7b1475768c8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 7 Dec 2020 07:18:14 +0000 Subject: [PATCH] CodeGen from PR 11975 in Azure/azure-rest-api-specs Merge 6151dc206734da444c22751c1308ade053204d71 into ffc6f2a61304409d0bb66174dbb0654cd820b0bb --- .../v2018_01_01_preview/models/__init__.py | 6 ++ .../v2018_01_01_preview/models/_models.py | 37 ++++++++++ .../v2018_01_01_preview/models/_models_py3.py | 37 ++++++++++ .../v2018_07_01_preview/models/__init__.py | 6 ++ .../v2018_07_01_preview/models/_models.py | 37 ++++++++++ .../v2018_07_01_preview/models/_models_py3.py | 37 ++++++++++ .../v2020_04_01_preview/models/__init__.py | 6 ++ .../v2020_04_01_preview/models/_models.py | 68 +++++++++++++++++- .../v2020_04_01_preview/models/_models_py3.py | 70 +++++++++++++++++-- .../_role_assignments_operations.py | 42 +++++------ 10 files changed, 319 insertions(+), 27 deletions(-) diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/__init__.py index d8f1cd2bf98b..efd6532b256b 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/__init__.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/__init__.py @@ -10,6 +10,8 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import Error + from ._models_py3 import ErrorError from ._models_py3 import Permission from ._models_py3 import ProviderOperation from ._models_py3 import ProviderOperationsMetadata @@ -20,6 +22,8 @@ from ._models_py3 import RoleDefinition from ._models_py3 import RoleDefinitionFilter except (SyntaxError, ImportError): + from ._models import Error + from ._models import ErrorError from ._models import Permission from ._models import ProviderOperation from ._models import ProviderOperationsMetadata @@ -35,6 +39,8 @@ from ._paged_models import RoleDefinitionPaged __all__ = [ + 'Error', + 'ErrorError', 'Permission', 'ProviderOperation', 'ProviderOperationsMetadata', diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models.py index 0dbfaf8253cc..7af84627c218 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models.py @@ -20,6 +20,43 @@ class CloudError(Model): } +class Error(Model): + """Object to be thrown in case of an unsuccessful response. + + :param error: + :type error: + ~azure.mgmt.authorization.v2018_01_01_preview.models.ErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorError'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorError(Model): + """ErrorError. + + :param code: Brief error code + :type code: str + :param message: Longer message explaining the details of the error + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + class Permission(Model): """Role definition permissions. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models_py3.py index 491028a4d4de..c61706263e16 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_01_01_preview/models/_models_py3.py @@ -20,6 +20,43 @@ class CloudError(Model): } +class Error(Model): + """Object to be thrown in case of an unsuccessful response. + + :param error: + :type error: + ~azure.mgmt.authorization.v2018_01_01_preview.models.ErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorError'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error = error + + +class ErrorError(Model): + """ErrorError. + + :param code: Brief error code + :type code: str + :param message: Longer message explaining the details of the error + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorError, self).__init__(**kwargs) + self.code = code + self.message = message + + class Permission(Model): """Role definition permissions. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/__init__.py index 66060cabcd57..a33ad2531299 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/__init__.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/__init__.py @@ -13,11 +13,15 @@ from ._models_py3 import DenyAssignment from ._models_py3 import DenyAssignmentFilter from ._models_py3 import DenyAssignmentPermission + from ._models_py3 import Error + from ._models_py3 import ErrorError from ._models_py3 import Principal except (SyntaxError, ImportError): from ._models import DenyAssignment from ._models import DenyAssignmentFilter from ._models import DenyAssignmentPermission + from ._models import Error + from ._models import ErrorError from ._models import Principal from ._paged_models import DenyAssignmentPaged @@ -25,6 +29,8 @@ 'DenyAssignment', 'DenyAssignmentFilter', 'DenyAssignmentPermission', + 'Error', + 'ErrorError', 'Principal', 'DenyAssignmentPaged', ] diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models.py index 3f34d4eccca2..ff9d5d07b6a4 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models.py @@ -152,6 +152,43 @@ def __init__(self, **kwargs): self.not_data_actions = kwargs.get('not_data_actions', None) +class Error(Model): + """Object to be thrown in case of an unsuccessful response. + + :param error: Object to be thrown in case of an unsuccessful response + :type error: + ~azure.mgmt.authorization.v2018_07_01_preview.models.ErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorError'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorError(Model): + """Object to be thrown in case of an unsuccessful response. + + :param code: Brief error code + :type code: str + :param message: Longer message explaining the details of the error + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + class Principal(Model): """Deny assignment principal. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models_py3.py index ea24aa033cbd..39ba23e2271a 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_07_01_preview/models/_models_py3.py @@ -152,6 +152,43 @@ def __init__(self, *, actions=None, not_actions=None, data_actions=None, not_dat self.not_data_actions = not_data_actions +class Error(Model): + """Object to be thrown in case of an unsuccessful response. + + :param error: Object to be thrown in case of an unsuccessful response + :type error: + ~azure.mgmt.authorization.v2018_07_01_preview.models.ErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorError'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error = error + + +class ErrorError(Model): + """Object to be thrown in case of an unsuccessful response. + + :param code: Brief error code + :type code: str + :param message: Longer message explaining the details of the error + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorError, self).__init__(**kwargs) + self.code = code + self.message = message + + class Principal(Model): """Deny assignment principal. diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py index 7fa9d33fff9d..d1745bfa1189 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/__init__.py @@ -10,10 +10,14 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import Error + from ._models_py3 import ErrorError from ._models_py3 import RoleAssignment from ._models_py3 import RoleAssignmentCreateParameters from ._models_py3 import RoleAssignmentFilter except (SyntaxError, ImportError): + from ._models import Error + from ._models import ErrorError from ._models import RoleAssignment from ._models import RoleAssignmentCreateParameters from ._models import RoleAssignmentFilter @@ -23,6 +27,8 @@ ) __all__ = [ + 'Error', + 'ErrorError', 'RoleAssignment', 'RoleAssignmentCreateParameters', 'RoleAssignmentFilter', diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py index ca78bb76ffd1..71065e4979b0 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models.py @@ -20,6 +20,43 @@ class CloudError(Model): } +class Error(Model): + """Object to be thrown in case of an unsuccessful response. + + :param error: Object to be thrown in case of an unsuccessful response + :type error: + ~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorError'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorError(Model): + """Object to be thrown in case of an unsuccessful response. + + :param code: Brief error code + :type code: str + :param message: Longer message explaining the details of the error + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + class RoleAssignment(Model): """Role Assignments. @@ -54,8 +91,19 @@ class RoleAssignment(Model): StringEqualsIgnoreCase 'foo_storage_container' :type condition: str :param condition_version: Version of the condition. Currently accepted - values are '1.0' or '2.0' + value is '2.0' :type condition_version: str + :param created_on: Time it was created + :type created_on: datetime + :param updated_on: Time it was updated + :type updated_on: datetime + :param created_by: Id of the user who created the assignment + :type created_by: str + :param updated_by: Id of the user who updated the assignment + :type updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str """ _validation = { @@ -76,6 +124,11 @@ class RoleAssignment(Model): 'description': {'key': 'properties.description', 'type': 'str'}, 'condition': {'key': 'properties.condition', 'type': 'str'}, 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'updated_on': {'key': 'properties.updatedOn', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'str'}, + 'delegated_managed_identity_resource_id': {'key': 'properties.delegatedManagedIdentityResourceId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -91,6 +144,11 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) self.condition = kwargs.get('condition', None) self.condition_version = kwargs.get('condition_version', None) + self.created_on = kwargs.get('created_on', None) + self.updated_on = kwargs.get('updated_on', None) + self.created_by = kwargs.get('created_by', None) + self.updated_by = kwargs.get('updated_by', None) + self.delegated_managed_identity_resource_id = kwargs.get('delegated_managed_identity_resource_id', None) class RoleAssignmentCreateParameters(Model): @@ -116,9 +174,13 @@ class RoleAssignmentCreateParameters(Model): :type can_delegate: bool :param description: Description of role assignment :type description: str - :param condition: The conditions on the role assignment + :param condition: The conditions on the role assignment. This limits the + resources it can be assigned to. e.g.: + @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + StringEqualsIgnoreCase 'foo_storage_container' :type condition: str - :param condition_version: Version of the condition + :param condition_version: Version of the condition. Currently accepted + value is '2.0' :type condition_version: str """ diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py index 2d4acd255fca..4b3c50c334a0 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/models/_models_py3.py @@ -20,6 +20,43 @@ class CloudError(Model): } +class Error(Model): + """Object to be thrown in case of an unsuccessful response. + + :param error: Object to be thrown in case of an unsuccessful response + :type error: + ~azure.mgmt.authorization.v2020_04_01_preview.models.ErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorError'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error = error + + +class ErrorError(Model): + """Object to be thrown in case of an unsuccessful response. + + :param code: Brief error code + :type code: str + :param message: Longer message explaining the details of the error + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorError, self).__init__(**kwargs) + self.code = code + self.message = message + + class RoleAssignment(Model): """Role Assignments. @@ -54,8 +91,19 @@ class RoleAssignment(Model): StringEqualsIgnoreCase 'foo_storage_container' :type condition: str :param condition_version: Version of the condition. Currently accepted - values are '1.0' or '2.0' + value is '2.0' :type condition_version: str + :param created_on: Time it was created + :type created_on: datetime + :param updated_on: Time it was updated + :type updated_on: datetime + :param created_by: Id of the user who created the assignment + :type created_by: str + :param updated_by: Id of the user who updated the assignment + :type updated_by: str + :param delegated_managed_identity_resource_id: Id of the delegated managed + identity resource + :type delegated_managed_identity_resource_id: str """ _validation = { @@ -76,9 +124,14 @@ class RoleAssignment(Model): 'description': {'key': 'properties.description', 'type': 'str'}, 'condition': {'key': 'properties.condition', 'type': 'str'}, 'condition_version': {'key': 'properties.conditionVersion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'updated_on': {'key': 'properties.updatedOn', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'str'}, + 'delegated_managed_identity_resource_id': {'key': 'properties.delegatedManagedIdentityResourceId', 'type': 'str'}, } - def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, can_delegate: bool=None, description: str=None, condition: str=None, condition_version: str=None, **kwargs) -> None: + def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_id: str=None, principal_type=None, can_delegate: bool=None, description: str=None, condition: str=None, condition_version: str=None, created_on=None, updated_on=None, created_by: str=None, updated_by: str=None, delegated_managed_identity_resource_id: str=None, **kwargs) -> None: super(RoleAssignment, self).__init__(**kwargs) self.id = None self.name = None @@ -91,6 +144,11 @@ def __init__(self, *, scope: str=None, role_definition_id: str=None, principal_i self.description = description self.condition = condition self.condition_version = condition_version + self.created_on = created_on + self.updated_on = updated_on + self.created_by = created_by + self.updated_by = updated_by + self.delegated_managed_identity_resource_id = delegated_managed_identity_resource_id class RoleAssignmentCreateParameters(Model): @@ -116,9 +174,13 @@ class RoleAssignmentCreateParameters(Model): :type can_delegate: bool :param description: Description of role assignment :type description: str - :param condition: The conditions on the role assignment + :param condition: The conditions on the role assignment. This limits the + resources it can be assigned to. e.g.: + @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + StringEqualsIgnoreCase 'foo_storage_container' :type condition: str - :param condition_version: Version of the condition + :param condition_version: Version of the condition. Currently accepted + value is '2.0' :type condition_version: str """ diff --git a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py index 2fe33743dac8..13a2855f11f1 100644 --- a/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py +++ b/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2020_04_01_preview/operations/_role_assignments_operations.py @@ -147,7 +147,7 @@ def list_for_resource_group( overrides`. :return: An iterator like instance of RoleAssignment :rtype: - ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] + object[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -189,7 +189,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 400]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -200,7 +200,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.RoleAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.object(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments'} @@ -251,7 +251,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 204, 412]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -290,10 +290,8 @@ def create( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: RoleAssignment or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment or - ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -326,7 +324,7 @@ def create( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201]: + if response.status_code not in [201, 400, 409]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -334,6 +332,10 @@ def create( deserialized = None if response.status_code == 201: deserialized = self._deserialize('RoleAssignment', response) + if response.status_code == 400: + deserialized = self._deserialize('Error', response) + if response.status_code == 409: + deserialized = self._deserialize('Error', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -355,10 +357,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: RoleAssignment or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment or - ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -387,7 +387,7 @@ def get( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 400, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -395,6 +395,8 @@ def get( deserialized = None if response.status_code == 200: deserialized = self._deserialize('RoleAssignment', response) + if response.status_code == 400: + deserialized = self._deserialize('Error', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -600,7 +602,7 @@ def list( overrides`. :return: An iterator like instance of RoleAssignment :rtype: - ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] + object[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -641,7 +643,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 400]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -652,7 +654,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.RoleAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.object(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments'} @@ -675,7 +677,7 @@ def list_for_scope( overrides`. :return: An iterator like instance of RoleAssignment :rtype: - ~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignmentPaged[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] + object[~azure.mgmt.authorization.v2020_04_01_preview.models.RoleAssignment] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -716,7 +718,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 400]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -727,7 +729,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.RoleAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.object(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_for_scope.metadata = {'url': '/{scope}/providers/Microsoft.Authorization/roleAssignments'}