diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models.py index 8d0d5df1bd7c..113f1d8e09ca 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models.py @@ -150,7 +150,8 @@ class AzureCliScript(DeploymentScript): ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -187,7 +188,7 @@ class AzureCliScript(DeploymentScript): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta :param az_cli_version: Required. Azure CLI module version to be used. :type az_cli_version: str @@ -239,7 +240,7 @@ def __init__(self, **kwargs): super(AzureCliScript, self).__init__(**kwargs) self.container_settings = kwargs.get('container_settings', None) self.storage_account_settings = kwargs.get('storage_account_settings', None) - self.cleanup_preference = kwargs.get('cleanup_preference', None) + self.cleanup_preference = kwargs.get('cleanup_preference', "Always") self.provisioning_state = None self.status = None self.outputs = None @@ -250,7 +251,7 @@ def __init__(self, **kwargs): self.environment_variables = kwargs.get('environment_variables', None) self.force_update_tag = kwargs.get('force_update_tag', None) self.retention_interval = kwargs.get('retention_interval', None) - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get('timeout', "P1D") self.az_cli_version = kwargs.get('az_cli_version', None) self.kind = 'AzureCLI' @@ -291,7 +292,8 @@ class AzurePowerShellScript(DeploymentScript): ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -328,7 +330,7 @@ class AzurePowerShellScript(DeploymentScript): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta :param az_power_shell_version: Required. Azure PowerShell module version to be used. @@ -381,7 +383,7 @@ def __init__(self, **kwargs): super(AzurePowerShellScript, self).__init__(**kwargs) self.container_settings = kwargs.get('container_settings', None) self.storage_account_settings = kwargs.get('storage_account_settings', None) - self.cleanup_preference = kwargs.get('cleanup_preference', None) + self.cleanup_preference = kwargs.get('cleanup_preference', "Always") self.provisioning_state = None self.status = None self.outputs = None @@ -392,7 +394,7 @@ def __init__(self, **kwargs): self.environment_variables = kwargs.get('environment_variables', None) self.force_update_tag = kwargs.get('force_update_tag', None) self.retention_interval = kwargs.get('retention_interval', None) - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get('timeout', "P1D") self.az_power_shell_version = kwargs.get('az_power_shell_version', None) self.kind = 'AzurePowerShell' @@ -450,7 +452,8 @@ class DeploymentScriptPropertiesBase(Model): ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -484,7 +487,7 @@ def __init__(self, **kwargs): super(DeploymentScriptPropertiesBase, self).__init__(**kwargs) self.container_settings = kwargs.get('container_settings', None) self.storage_account_settings = kwargs.get('storage_account_settings', None) - self.cleanup_preference = kwargs.get('cleanup_preference', None) + self.cleanup_preference = kwargs.get('cleanup_preference', "Always") self.provisioning_state = None self.status = None self.outputs = None @@ -719,7 +722,7 @@ class ScriptConfigurationBase(Model): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta """ @@ -748,7 +751,7 @@ def __init__(self, **kwargs): self.environment_variables = kwargs.get('environment_variables', None) self.force_update_tag = kwargs.get('force_update_tag', None) self.retention_interval = kwargs.get('retention_interval', None) - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get('timeout', "P1D") class ScriptLog(AzureResourceBase): @@ -917,13 +920,21 @@ def __init__(self, **kwargs): class UserAssignedIdentity(Model): """User-assigned managed identity. - :param principal_id: Azure Active Directory principal ID associated with + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Azure Active Directory principal ID associated with this identity. - :type principal_id: str - :param client_id: Client App Id associated with this identity. - :type client_id: str + :vartype principal_id: str + :ivar client_id: Client App Id associated with this identity. + :vartype client_id: str """ + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, @@ -931,5 +942,5 @@ class UserAssignedIdentity(Model): def __init__(self, **kwargs): super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - self.client_id = kwargs.get('client_id', None) + self.principal_id = None + self.client_id = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models_py3.py index 3c133d7de123..f00cfb96f655 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models_py3.py @@ -150,7 +150,8 @@ class AzureCliScript(DeploymentScript): ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -187,7 +188,7 @@ class AzureCliScript(DeploymentScript): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta :param az_cli_version: Required. Azure CLI module version to be used. :type az_cli_version: str @@ -235,7 +236,7 @@ class AzureCliScript(DeploymentScript): 'az_cli_version': {'key': 'properties.azCliVersion', 'type': 'str'}, } - def __init__(self, *, identity, location: str, retention_interval, az_cli_version: str, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + def __init__(self, *, identity, location: str, retention_interval, az_cli_version: str, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference="Always", primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout="P1D", **kwargs) -> None: super(AzureCliScript, self).__init__(identity=identity, location=location, tags=tags, **kwargs) self.container_settings = container_settings self.storage_account_settings = storage_account_settings @@ -291,7 +292,8 @@ class AzurePowerShellScript(DeploymentScript): ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -328,7 +330,7 @@ class AzurePowerShellScript(DeploymentScript): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta :param az_power_shell_version: Required. Azure PowerShell module version to be used. @@ -377,7 +379,7 @@ class AzurePowerShellScript(DeploymentScript): 'az_power_shell_version': {'key': 'properties.azPowerShellVersion', 'type': 'str'}, } - def __init__(self, *, identity, location: str, retention_interval, az_power_shell_version: str, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + def __init__(self, *, identity, location: str, retention_interval, az_power_shell_version: str, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference="Always", primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout="P1D", **kwargs) -> None: super(AzurePowerShellScript, self).__init__(identity=identity, location=location, tags=tags, **kwargs) self.container_settings = container_settings self.storage_account_settings = storage_account_settings @@ -450,7 +452,8 @@ class DeploymentScriptPropertiesBase(Model): ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -480,7 +483,7 @@ class DeploymentScriptPropertiesBase(Model): 'outputs': {'key': 'outputs', 'type': '{object}'}, } - def __init__(self, *, container_settings=None, storage_account_settings=None, cleanup_preference=None, **kwargs) -> None: + def __init__(self, *, container_settings=None, storage_account_settings=None, cleanup_preference="Always", **kwargs) -> None: super(DeploymentScriptPropertiesBase, self).__init__(**kwargs) self.container_settings = container_settings self.storage_account_settings = storage_account_settings @@ -719,7 +722,7 @@ class ScriptConfigurationBase(Model): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta """ @@ -739,7 +742,7 @@ class ScriptConfigurationBase(Model): 'timeout': {'key': 'timeout', 'type': 'duration'}, } - def __init__(self, *, retention_interval, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + def __init__(self, *, retention_interval, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout="P1D", **kwargs) -> None: super(ScriptConfigurationBase, self).__init__(**kwargs) self.primary_script_uri = primary_script_uri self.supporting_script_uris = supporting_script_uris @@ -917,19 +920,27 @@ def __init__(self, *, created_by: str=None, created_by_type=None, created_at=Non class UserAssignedIdentity(Model): """User-assigned managed identity. - :param principal_id: Azure Active Directory principal ID associated with + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Azure Active Directory principal ID associated with this identity. - :type principal_id: str - :param client_id: Client App Id associated with this identity. - :type client_id: str + :vartype principal_id: str + :ivar client_id: Client App Id associated with this identity. + :vartype client_id: str """ + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, } - def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = principal_id - self.client_id = client_id + self.principal_id = None + self.client_id = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models.py index 2dcb68147f19..7e62c6be7eae 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models.py @@ -149,7 +149,8 @@ class AzureCliScript(DeploymentScript): ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -186,7 +187,7 @@ class AzureCliScript(DeploymentScript): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta :param az_cli_version: Required. Azure CLI module version to be used. :type az_cli_version: str @@ -237,7 +238,7 @@ def __init__(self, **kwargs): super(AzureCliScript, self).__init__(**kwargs) self.container_settings = kwargs.get('container_settings', None) self.storage_account_settings = kwargs.get('storage_account_settings', None) - self.cleanup_preference = kwargs.get('cleanup_preference', None) + self.cleanup_preference = kwargs.get('cleanup_preference', "Always") self.provisioning_state = None self.status = None self.outputs = None @@ -248,7 +249,7 @@ def __init__(self, **kwargs): self.environment_variables = kwargs.get('environment_variables', None) self.force_update_tag = kwargs.get('force_update_tag', None) self.retention_interval = kwargs.get('retention_interval', None) - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get('timeout', "P1D") self.az_cli_version = kwargs.get('az_cli_version', None) self.kind = 'AzureCLI' @@ -289,7 +290,8 @@ class AzurePowerShellScript(DeploymentScript): ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -326,7 +328,7 @@ class AzurePowerShellScript(DeploymentScript): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta :param az_power_shell_version: Required. Azure PowerShell module version to be used. @@ -378,7 +380,7 @@ def __init__(self, **kwargs): super(AzurePowerShellScript, self).__init__(**kwargs) self.container_settings = kwargs.get('container_settings', None) self.storage_account_settings = kwargs.get('storage_account_settings', None) - self.cleanup_preference = kwargs.get('cleanup_preference', None) + self.cleanup_preference = kwargs.get('cleanup_preference', "Always") self.provisioning_state = None self.status = None self.outputs = None @@ -389,7 +391,7 @@ def __init__(self, **kwargs): self.environment_variables = kwargs.get('environment_variables', None) self.force_update_tag = kwargs.get('force_update_tag', None) self.retention_interval = kwargs.get('retention_interval', None) - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get('timeout', "P1D") self.az_power_shell_version = kwargs.get('az_power_shell_version', None) self.kind = 'AzurePowerShell' @@ -447,7 +449,8 @@ class DeploymentScriptPropertiesBase(Model): ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -481,7 +484,7 @@ def __init__(self, **kwargs): super(DeploymentScriptPropertiesBase, self).__init__(**kwargs) self.container_settings = kwargs.get('container_settings', None) self.storage_account_settings = kwargs.get('storage_account_settings', None) - self.cleanup_preference = kwargs.get('cleanup_preference', None) + self.cleanup_preference = kwargs.get('cleanup_preference', "Always") self.provisioning_state = None self.status = None self.outputs = None @@ -712,7 +715,7 @@ class ScriptConfigurationBase(Model): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta """ @@ -741,7 +744,7 @@ def __init__(self, **kwargs): self.environment_variables = kwargs.get('environment_variables', None) self.force_update_tag = kwargs.get('force_update_tag', None) self.retention_interval = kwargs.get('retention_interval', None) - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get('timeout', "P1D") class ScriptLog(AzureResourceBase): @@ -910,13 +913,21 @@ def __init__(self, **kwargs): class UserAssignedIdentity(Model): """User-assigned managed identity. - :param principal_id: Azure Active Directory principal ID associated with + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Azure Active Directory principal ID associated with this identity. - :type principal_id: str - :param client_id: Client App Id associated with this identity. - :type client_id: str + :vartype principal_id: str + :ivar client_id: Client App Id associated with this identity. + :vartype client_id: str """ + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, @@ -924,5 +935,5 @@ class UserAssignedIdentity(Model): def __init__(self, **kwargs): super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - self.client_id = kwargs.get('client_id', None) + self.principal_id = None + self.client_id = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models_py3.py index dd8dea762ea9..e359c87e41e2 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models_py3.py @@ -149,7 +149,8 @@ class AzureCliScript(DeploymentScript): ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -186,7 +187,7 @@ class AzureCliScript(DeploymentScript): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta :param az_cli_version: Required. Azure CLI module version to be used. :type az_cli_version: str @@ -233,7 +234,7 @@ class AzureCliScript(DeploymentScript): 'az_cli_version': {'key': 'properties.azCliVersion', 'type': 'str'}, } - def __init__(self, *, location: str, retention_interval, az_cli_version: str, identity=None, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + def __init__(self, *, location: str, retention_interval, az_cli_version: str, identity=None, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference="Always", primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout="P1D", **kwargs) -> None: super(AzureCliScript, self).__init__(identity=identity, location=location, tags=tags, **kwargs) self.container_settings = container_settings self.storage_account_settings = storage_account_settings @@ -289,7 +290,8 @@ class AzurePowerShellScript(DeploymentScript): ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -326,7 +328,7 @@ class AzurePowerShellScript(DeploymentScript): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta :param az_power_shell_version: Required. Azure PowerShell module version to be used. @@ -374,7 +376,7 @@ class AzurePowerShellScript(DeploymentScript): 'az_power_shell_version': {'key': 'properties.azPowerShellVersion', 'type': 'str'}, } - def __init__(self, *, location: str, retention_interval, az_power_shell_version: str, identity=None, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference=None, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + def __init__(self, *, location: str, retention_interval, az_power_shell_version: str, identity=None, tags=None, container_settings=None, storage_account_settings=None, cleanup_preference="Always", primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout="P1D", **kwargs) -> None: super(AzurePowerShellScript, self).__init__(identity=identity, location=location, tags=tags, **kwargs) self.container_settings = container_settings self.storage_account_settings = storage_account_settings @@ -447,7 +449,8 @@ class DeploymentScriptPropertiesBase(Model): ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.StorageAccountConfiguration :param cleanup_preference: The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. Possible - values include: 'Always', 'OnSuccess', 'OnExpiration' + values include: 'Always', 'OnSuccess', 'OnExpiration'. Default value: + "Always" . :type cleanup_preference: str or ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.CleanupOptions :ivar provisioning_state: State of the script execution. This only appears @@ -477,7 +480,7 @@ class DeploymentScriptPropertiesBase(Model): 'outputs': {'key': 'outputs', 'type': '{object}'}, } - def __init__(self, *, container_settings=None, storage_account_settings=None, cleanup_preference=None, **kwargs) -> None: + def __init__(self, *, container_settings=None, storage_account_settings=None, cleanup_preference="Always", **kwargs) -> None: super(DeploymentScriptPropertiesBase, self).__init__(**kwargs) self.container_settings = container_settings self.storage_account_settings = storage_account_settings @@ -712,7 +715,7 @@ class ScriptConfigurationBase(Model): pattern (for example P7D means one week). :type retention_interval: timedelta :param timeout: Maximum allowed script execution time specified in ISO - 8601 format. Default value is PT1H + 8601 format. Default value is P1D. Default value: "P1D" . :type timeout: timedelta """ @@ -732,7 +735,7 @@ class ScriptConfigurationBase(Model): 'timeout': {'key': 'timeout', 'type': 'duration'}, } - def __init__(self, *, retention_interval, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout=None, **kwargs) -> None: + def __init__(self, *, retention_interval, primary_script_uri: str=None, supporting_script_uris=None, script_content: str=None, arguments: str=None, environment_variables=None, force_update_tag: str=None, timeout="P1D", **kwargs) -> None: super(ScriptConfigurationBase, self).__init__(**kwargs) self.primary_script_uri = primary_script_uri self.supporting_script_uris = supporting_script_uris @@ -910,19 +913,27 @@ def __init__(self, *, created_by: str=None, created_by_type=None, created_at=Non class UserAssignedIdentity(Model): """User-assigned managed identity. - :param principal_id: Azure Active Directory principal ID associated with + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Azure Active Directory principal ID associated with this identity. - :type principal_id: str - :param client_id: Client App Id associated with this identity. - :type client_id: str + :vartype principal_id: str + :ivar client_id: Client App Id associated with this identity. + :vartype client_id: str """ + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, } - def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = principal_id - self.client_id = client_id + self.principal_id = None + self.client_id = None diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py index c826763dc418..3be67ee5c04e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py @@ -14,12 +14,12 @@ from ._models_py3 import AliasPath from ._models_py3 import AliasPathMetadata from ._models_py3 import AliasPattern - from ._models_py3 import CloudError, CloudErrorException from ._models_py3 import DataEffect from ._models_py3 import DataManifestCustomResourceFunctionDefinition from ._models_py3 import DataPolicyManifest from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import Identity from ._models_py3 import NonComplianceMessage from ._models_py3 import ParameterDefinitionsValue @@ -36,12 +36,12 @@ from ._models import AliasPath from ._models import AliasPathMetadata from ._models import AliasPattern - from ._models import CloudError, CloudErrorException from ._models import DataEffect from ._models import DataManifestCustomResourceFunctionDefinition from ._models import DataPolicyManifest from ._models import ErrorAdditionalInfo from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException from ._models import Identity from ._models import NonComplianceMessage from ._models import ParameterDefinitionsValue @@ -73,12 +73,12 @@ 'AliasPath', 'AliasPathMetadata', 'AliasPattern', - 'CloudError', 'CloudErrorException', 'DataEffect', 'DataManifestCustomResourceFunctionDefinition', 'DataPolicyManifest', 'ErrorAdditionalInfo', 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', 'Identity', 'NonComplianceMessage', 'ParameterDefinitionsValue', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models.py index 6cd04642d44f..78dbd967a188 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models.py @@ -159,36 +159,12 @@ def __init__(self, **kwargs): class CloudError(Model): - """Error response. - - Common error response for all Azure Resource Manager APIs to return error - details for failed operations. (This also follows the OData error response - format.). - - :param error: The error object. - :type error: ~azure.mgmt.resource.policy.v2020_09_01.models.ErrorDetail + """CloudError. """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, } - def __init__(self, **kwargs): - super(CloudError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - class DataEffect(Model): """The data effect definition. @@ -391,6 +367,38 @@ def __init__(self, **kwargs): self.additional_info = None +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: ~azure.mgmt.resource.policy.v2020_09_01.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class Identity(Model): """Identity for the resource. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models_py3.py index 4b68ce38b626..7dc41032f169 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models_py3.py @@ -159,36 +159,12 @@ def __init__(self, *, phrase: str=None, variable: str=None, type=None, **kwargs) class CloudError(Model): - """Error response. - - Common error response for all Azure Resource Manager APIs to return error - details for failed operations. (This also follows the OData error response - format.). - - :param error: The error object. - :type error: ~azure.mgmt.resource.policy.v2020_09_01.models.ErrorDetail + """CloudError. """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, } - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - class DataEffect(Model): """The data effect definition. @@ -391,6 +367,38 @@ def __init__(self, **kwargs) -> None: self.additional_info = None +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: ~azure.mgmt.resource.policy.v2020_09_01.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class Identity(Model): """Identity for the resource. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_data_policy_manifests_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_data_policy_manifests_operations.py index 99e83c6f1662..4b20ceff800d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_data_policy_manifests_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_data_policy_manifests_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -58,7 +57,8 @@ def get_by_policy_mode( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.DataPolicyManifest or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_by_policy_mode.metadata['url'] @@ -86,9 +86,7 @@ def get_by_policy_mode( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -127,7 +125,8 @@ def list( :return: An iterator like instance of DataPolicyManifest :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.DataPolicyManifestPaged[~azure.mgmt.resource.policy.v2020_09_01.models.DataPolicyManifest] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -164,9 +163,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_assignments_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_assignments_operations.py index e7c697f4a59e..797da68d3153 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_assignments_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_assignments_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -69,7 +68,8 @@ def delete( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -98,9 +98,7 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -145,7 +143,8 @@ def create( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create.metadata['url'] @@ -178,9 +177,7 @@ def create( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 201: @@ -221,7 +218,8 @@ def get( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -250,9 +248,7 @@ def get( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -312,7 +308,8 @@ def list_for_resource_group( :return: An iterator like instance of PolicyAssignment :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignmentPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -356,9 +353,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -445,7 +440,8 @@ def list_for_resource( :return: An iterator like instance of PolicyAssignment :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignmentPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -493,9 +489,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -549,7 +543,8 @@ def list_for_management_group( :return: An iterator like instance of PolicyAssignment :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignmentPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -592,9 +587,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -651,7 +644,8 @@ def list( :return: An iterator like instance of PolicyAssignment :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignmentPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -694,9 +688,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -737,7 +729,8 @@ def delete_by_id( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete_by_id.metadata['url'] @@ -765,9 +758,7 @@ def delete_by_id( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -814,7 +805,8 @@ def create_by_id( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_by_id.metadata['url'] @@ -846,9 +838,7 @@ def create_by_id( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 201: @@ -889,7 +879,8 @@ def get_by_id( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_by_id.metadata['url'] @@ -917,9 +908,7 @@ def get_by_id( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_definitions_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_definitions_operations.py index 74e958a1e8a0..ed8f48f04ea4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_definitions_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_definitions_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -61,7 +60,8 @@ def create_or_update( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_or_update.metadata['url'] @@ -94,9 +94,7 @@ def create_or_update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 201: @@ -126,7 +124,8 @@ def delete( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -154,9 +153,7 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -182,7 +179,8 @@ def get( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -211,9 +209,7 @@ def get( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -245,7 +241,8 @@ def get_built_in( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_built_in.metadata['url'] @@ -273,9 +270,7 @@ def get_built_in( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -312,7 +307,8 @@ def create_or_update_at_management_group( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_or_update_at_management_group.metadata['url'] @@ -345,9 +341,7 @@ def create_or_update_at_management_group( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 201: @@ -379,7 +373,8 @@ def delete_at_management_group( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete_at_management_group.metadata['url'] @@ -407,9 +402,7 @@ def delete_at_management_group( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -437,7 +430,8 @@ def get_at_management_group( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_at_management_group.metadata['url'] @@ -466,9 +460,7 @@ def get_at_management_group( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -522,7 +514,8 @@ def list( :return: An iterator like instance of PolicyDefinition :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinitionPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -565,9 +558,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -615,7 +606,8 @@ def list_built_in( :return: An iterator like instance of PolicyDefinition :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinitionPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -654,9 +646,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -712,7 +702,8 @@ def list_by_management_group( :return: An iterator like instance of PolicyDefinition :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinitionPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -755,9 +746,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_set_definitions_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_set_definitions_operations.py index 77323a4492eb..586d91fda0d2 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_set_definitions_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_set_definitions_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -61,7 +60,8 @@ def create_or_update( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_or_update.metadata['url'] @@ -94,9 +94,7 @@ def create_or_update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -128,7 +126,8 @@ def delete( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -156,9 +155,7 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -184,7 +181,8 @@ def get( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -213,9 +211,7 @@ def get( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -247,7 +243,8 @@ def get_built_in( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_built_in.metadata['url'] @@ -275,9 +272,7 @@ def get_built_in( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -332,7 +327,8 @@ def list( :return: An iterator like instance of PolicySetDefinition :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinitionPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -375,9 +371,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -422,7 +416,8 @@ def list_built_in( :return: An iterator like instance of PolicySetDefinition :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinitionPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -461,9 +456,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -500,7 +493,8 @@ def create_or_update_at_management_group( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_or_update_at_management_group.metadata['url'] @@ -533,9 +527,7 @@ def create_or_update_at_management_group( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -569,7 +561,8 @@ def delete_at_management_group( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete_at_management_group.metadata['url'] @@ -597,9 +590,7 @@ def delete_at_management_group( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -627,7 +618,8 @@ def get_at_management_group( :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_at_management_group.metadata['url'] @@ -656,9 +648,7 @@ def get_at_management_group( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -715,7 +705,8 @@ def list_by_management_group( :return: An iterator like instance of PolicySetDefinition :rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinitionPaged[~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -758,9 +749,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_resource_groups_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_resource_groups_operations.py index c9369972a2e7..2ec0f20590a3 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_resource_groups_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_resource_groups_operations.py @@ -168,7 +168,7 @@ def create_or_update( def _delete_initial( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, force_deletion_resource_types=None, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -179,6 +179,8 @@ def _delete_initial( # Construct parameters query_parameters = {} + if force_deletion_resource_types is not None: + query_parameters['forceDeletionResourceTypes'] = self._serialize.query("force_deletion_resource_types", force_deletion_resource_types, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -204,7 +206,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, force_deletion_resource_types=None, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a resource group. When you delete a resource group, all of its resources are also @@ -214,6 +216,10 @@ def delete( :param resource_group_name: The name of the resource group to delete. The name is case insensitive. :type resource_group_name: str + :param force_deletion_resource_types: The resource types you want to + force delete. Currently, only the following is supported: + forceDeletionResourceTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets + :type force_deletion_resource_types: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -227,6 +233,7 @@ def delete( """ raw_result = self._delete_initial( resource_group_name=resource_group_name, + force_deletion_resource_types=force_deletion_resource_types, custom_headers=custom_headers, raw=True, **operation_config