diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_deployment_scripts_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_deployment_scripts_operations.py index 1c8f358dcfb8..842c3a0827b4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_deployment_scripts_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_deployment_scripts_operations.py @@ -47,7 +47,7 @@ def _create_initial( url = self.create.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -174,7 +174,7 @@ def update( url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -243,7 +243,7 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -304,7 +304,7 @@ def delete( url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -424,7 +424,7 @@ def get_logs( url = self.get_logs.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -491,7 +491,7 @@ def get_logs_default( url = self.get_logs_default.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'scriptName': self._serialize.url("script_name", script_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -554,7 +554,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_configuration.py index 306faab728ec..5b10350e1f05 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_configuration.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_configuration.py @@ -21,7 +21,7 @@ class ResourceManagementClientConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: The ID of the target subscription. + :param subscription_id: The Microsoft Azure subscription ID. :type subscription_id: str :param str base_url: Service URL """ diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py index 7498b4ce9b29..0498a296e81a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py @@ -46,7 +46,7 @@ class ResourceManagementClient(MultiApiClientMixin, SDKClient): :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2020-10-01' + DEFAULT_API_VERSION = '2021-04-01' _PROFILE_TAG = "azure.mgmt.resource.resources.ResourceManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -85,6 +85,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-10-01: :mod:`v2019_10_01.models` * 2020-06-01: :mod:`v2020_06_01.models` * 2020-10-01: :mod:`v2020_10_01.models` + * 2021-01-01: :mod:`v2021_01_01.models` + * 2021-04-01: :mod:`v2021_04_01.models` """ if api_version == '2016-02-01': from .v2016_02_01 import models @@ -125,6 +127,12 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-10-01': from .v2020_10_01 import models return models + elif api_version == '2021-01-01': + from .v2021_01_01 import models + return models + elif api_version == '2021-04-01': + from .v2021_04_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -144,6 +152,8 @@ def deployment_operations(self): * 2019-10-01: :class:`DeploymentOperations` * 2020-06-01: :class:`DeploymentOperations` * 2020-10-01: :class:`DeploymentOperations` + * 2021-01-01: :class:`DeploymentOperations` + * 2021-04-01: :class:`DeploymentOperations` """ api_version = self._get_api_version('deployment_operations') if api_version == '2016-02-01': @@ -172,6 +182,10 @@ def deployment_operations(self): from .v2020_06_01.operations import DeploymentOperations as OperationClass elif api_version == '2020-10-01': from .v2020_10_01.operations import DeploymentOperations as OperationClass + elif api_version == '2021-01-01': + from .v2021_01_01.operations import DeploymentOperations as OperationClass + elif api_version == '2021-04-01': + from .v2021_04_01.operations import DeploymentOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -193,6 +207,8 @@ def deployments(self): * 2019-10-01: :class:`DeploymentsOperations` * 2020-06-01: :class:`DeploymentsOperations` * 2020-10-01: :class:`DeploymentsOperations` + * 2021-01-01: :class:`DeploymentsOperations` + * 2021-04-01: :class:`DeploymentsOperations` """ api_version = self._get_api_version('deployments') if api_version == '2016-02-01': @@ -221,6 +237,10 @@ def deployments(self): from .v2020_06_01.operations import DeploymentsOperations as OperationClass elif api_version == '2020-10-01': from .v2020_10_01.operations import DeploymentsOperations as OperationClass + elif api_version == '2021-01-01': + from .v2021_01_01.operations import DeploymentsOperations as OperationClass + elif api_version == '2021-04-01': + from .v2021_04_01.operations import DeploymentsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -238,6 +258,8 @@ def operations(self): * 2019-10-01: :class:`Operations` * 2020-06-01: :class:`Operations` * 2020-10-01: :class:`Operations` + * 2021-01-01: :class:`Operations` + * 2021-04-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-05-01': @@ -258,6 +280,10 @@ def operations(self): from .v2020_06_01.operations import Operations as OperationClass elif api_version == '2020-10-01': from .v2020_10_01.operations import Operations as OperationClass + elif api_version == '2021-01-01': + from .v2021_01_01.operations import Operations as OperationClass + elif api_version == '2021-04-01': + from .v2021_04_01.operations import Operations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -267,10 +293,16 @@ def provider_resource_types(self): """Instance depends on the API version: * 2020-10-01: :class:`ProviderResourceTypesOperations` + * 2021-01-01: :class:`ProviderResourceTypesOperations` + * 2021-04-01: :class:`ProviderResourceTypesOperations` """ api_version = self._get_api_version('provider_resource_types') if api_version == '2020-10-01': from .v2020_10_01.operations import ProviderResourceTypesOperations as OperationClass + elif api_version == '2021-01-01': + from .v2021_01_01.operations import ProviderResourceTypesOperations as OperationClass + elif api_version == '2021-04-01': + from .v2021_04_01.operations import ProviderResourceTypesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -292,6 +324,8 @@ def providers(self): * 2019-10-01: :class:`ProvidersOperations` * 2020-06-01: :class:`ProvidersOperations` * 2020-10-01: :class:`ProvidersOperations` + * 2021-01-01: :class:`ProvidersOperations` + * 2021-04-01: :class:`ProvidersOperations` """ api_version = self._get_api_version('providers') if api_version == '2016-02-01': @@ -320,6 +354,10 @@ def providers(self): from .v2020_06_01.operations import ProvidersOperations as OperationClass elif api_version == '2020-10-01': from .v2020_10_01.operations import ProvidersOperations as OperationClass + elif api_version == '2021-01-01': + from .v2021_01_01.operations import ProvidersOperations as OperationClass + elif api_version == '2021-04-01': + from .v2021_04_01.operations import ProvidersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -341,6 +379,8 @@ def resource_groups(self): * 2019-10-01: :class:`ResourceGroupsOperations` * 2020-06-01: :class:`ResourceGroupsOperations` * 2020-10-01: :class:`ResourceGroupsOperations` + * 2021-01-01: :class:`ResourceGroupsOperations` + * 2021-04-01: :class:`ResourceGroupsOperations` """ api_version = self._get_api_version('resource_groups') if api_version == '2016-02-01': @@ -369,6 +409,10 @@ def resource_groups(self): from .v2020_06_01.operations import ResourceGroupsOperations as OperationClass elif api_version == '2020-10-01': from .v2020_10_01.operations import ResourceGroupsOperations as OperationClass + elif api_version == '2021-01-01': + from .v2021_01_01.operations import ResourceGroupsOperations as OperationClass + elif api_version == '2021-04-01': + from .v2021_04_01.operations import ResourceGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -390,6 +434,8 @@ def resources(self): * 2019-10-01: :class:`ResourcesOperations` * 2020-06-01: :class:`ResourcesOperations` * 2020-10-01: :class:`ResourcesOperations` + * 2021-01-01: :class:`ResourcesOperations` + * 2021-04-01: :class:`ResourcesOperations` """ api_version = self._get_api_version('resources') if api_version == '2016-02-01': @@ -418,6 +464,10 @@ def resources(self): from .v2020_06_01.operations import ResourcesOperations as OperationClass elif api_version == '2020-10-01': from .v2020_10_01.operations import ResourcesOperations as OperationClass + elif api_version == '2021-01-01': + from .v2021_01_01.operations import ResourcesOperations as OperationClass + elif api_version == '2021-04-01': + from .v2021_04_01.operations import ResourcesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -439,6 +489,8 @@ def tags(self): * 2019-10-01: :class:`TagsOperations` * 2020-06-01: :class:`TagsOperations` * 2020-10-01: :class:`TagsOperations` + * 2021-01-01: :class:`TagsOperations` + * 2021-04-01: :class:`TagsOperations` """ api_version = self._get_api_version('tags') if api_version == '2016-02-01': @@ -467,6 +519,10 @@ def tags(self): from .v2020_06_01.operations import TagsOperations as OperationClass elif api_version == '2020-10-01': from .v2020_10_01.operations import TagsOperations as OperationClass + elif api_version == '2021-01-01': + from .v2021_01_01.operations import TagsOperations as OperationClass + elif api_version == '2021-04-01': + from .v2021_04_01.operations import TagsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/models.py index 3a453a73ab82..c74fa9c6c01c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/models.py @@ -4,4 +4,4 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2020_10_01.models import * +from .v2021_04_01.models import * diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py index ef78f45062ce..f294df341a5d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py @@ -52,6 +52,7 @@ from ._models_py3 import TargetResource from ._models_py3 import TemplateHashResult from ._models_py3 import TemplateLink + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import AliasPathType from ._models import AliasType @@ -95,6 +96,7 @@ from ._models import TargetResource from ._models import TemplateHashResult from ._models import TemplateLink + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -149,6 +151,7 @@ 'TargetResource', 'TemplateHashResult', 'TemplateLink', + 'ZoneMapping', 'DeploymentExtendedPaged', 'ProviderPaged', 'GenericResourceExpandedPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models.py index f99a383e3926..4136f2aeaf65 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models.py @@ -964,6 +964,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2016_09_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2016_09_01.models.ZoneMapping] :param properties: The properties. :type properties: dict[str, str] """ @@ -973,6 +976,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -982,6 +986,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.properties = kwargs.get('properties', None) @@ -1401,3 +1406,23 @@ def __init__(self, **kwargs): super(TemplateLink, self).__init__(**kwargs) self.uri = kwargs.get('uri', None) self.content_version = kwargs.get('content_version', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py index 02ce00348ede..ca73accdbbb8 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py @@ -964,6 +964,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2016_09_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2016_09_01.models.ZoneMapping] :param properties: The properties. :type properties: dict[str, str] """ @@ -973,15 +976,17 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.properties = properties @@ -1401,3 +1406,23 @@ def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: super(TemplateLink, self).__init__(**kwargs) self.uri = uri self.content_version = content_version + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py index 6d69aa4efb8f..114645d3a9c1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py @@ -53,6 +53,7 @@ from ._models_py3 import TargetResource from ._models_py3 import TemplateHashResult from ._models_py3 import TemplateLink + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import AliasPathType from ._models import AliasType @@ -97,6 +98,7 @@ from ._models import TargetResource from ._models import TemplateHashResult from ._models import TemplateLink + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -152,6 +154,7 @@ 'TargetResource', 'TemplateHashResult', 'TemplateLink', + 'ZoneMapping', 'DeploymentExtendedPaged', 'ProviderPaged', 'GenericResourceExpandedPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models.py index be4c4ab67698..0d0a44d48c3e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models.py @@ -968,6 +968,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2017_05_10.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2017_05_10.models.ZoneMapping] :param properties: The properties. :type properties: dict[str, str] """ @@ -977,6 +980,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -986,6 +990,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.properties = kwargs.get('properties', None) @@ -1435,3 +1440,23 @@ def __init__(self, **kwargs): super(TemplateLink, self).__init__(**kwargs) self.uri = kwargs.get('uri', None) self.content_version = kwargs.get('content_version', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py index 9ba7ee951b1b..a6e3bc0900bc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py @@ -968,6 +968,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2017_05_10.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2017_05_10.models.ZoneMapping] :param properties: The properties. :type properties: dict[str, str] """ @@ -977,15 +980,17 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.properties = properties @@ -1435,3 +1440,23 @@ def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: super(TemplateLink, self).__init__(**kwargs) self.uri = uri self.content_version = content_version + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py index ab9bcea6f39e..3828619457bc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py @@ -55,6 +55,7 @@ from ._models_py3 import TargetResource from ._models_py3 import TemplateHashResult from ._models_py3 import TemplateLink + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import AliasPathType from ._models import AliasType @@ -101,6 +102,7 @@ from ._models import TargetResource from ._models import TemplateHashResult from ._models import TemplateLink + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -159,6 +161,7 @@ 'TargetResource', 'TemplateHashResult', 'TemplateLink', + 'ZoneMapping', 'DeploymentExtendedPaged', 'ProviderPaged', 'GenericResourceExpandedPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models.py index fb89edec8abc..d2e8e52c7463 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models.py @@ -1037,6 +1037,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2018_02_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2018_02_01.models.ZoneMapping] :param properties: The properties. :type properties: dict[str, str] """ @@ -1046,6 +1049,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -1055,6 +1059,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.properties = kwargs.get('properties', None) @@ -1504,3 +1509,23 @@ def __init__(self, **kwargs): super(TemplateLink, self).__init__(**kwargs) self.uri = kwargs.get('uri', None) self.content_version = kwargs.get('content_version', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py index d22a65de6c23..33424ed94f1b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py @@ -1037,6 +1037,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2018_02_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2018_02_01.models.ZoneMapping] :param properties: The properties. :type properties: dict[str, str] """ @@ -1046,15 +1049,17 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.properties = properties @@ -1504,3 +1509,23 @@ def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: super(TemplateLink, self).__init__(**kwargs) self.uri = uri self.content_version = content_version + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py index a4e62c5bf265..38e08275f74c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py @@ -58,6 +58,7 @@ from ._models_py3 import TargetResource from ._models_py3 import TemplateHashResult from ._models_py3 import TemplateLink + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import AliasPathType from ._models import AliasType @@ -107,6 +108,7 @@ from ._models import TargetResource from ._models import TemplateHashResult from ._models import TemplateLink + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -169,6 +171,7 @@ 'TargetResource', 'TemplateHashResult', 'TemplateLink', + 'ZoneMapping', 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models.py index 559bf85d5d6f..d7bdc96b64cd 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models.py @@ -1134,6 +1134,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2018_05_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2018_05_01.models.ZoneMapping] :param properties: The properties. :type properties: dict[str, str] """ @@ -1143,6 +1146,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -1152,6 +1156,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.properties = kwargs.get('properties', None) @@ -1607,3 +1612,23 @@ def __init__(self, **kwargs): super(TemplateLink, self).__init__(**kwargs) self.uri = kwargs.get('uri', None) self.content_version = kwargs.get('content_version', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py index 58e11e1a10e0..690ed131b117 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py @@ -1134,6 +1134,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2018_05_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2018_05_01.models.ZoneMapping] :param properties: The properties. :type properties: dict[str, str] """ @@ -1143,15 +1146,17 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.properties = properties @@ -1607,3 +1612,23 @@ def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: super(TemplateLink, self).__init__(**kwargs) self.uri = uri self.content_version = content_version + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/__init__.py index a4e62c5bf265..38e08275f74c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/__init__.py @@ -58,6 +58,7 @@ from ._models_py3 import TargetResource from ._models_py3 import TemplateHashResult from ._models_py3 import TemplateLink + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import AliasPathType from ._models import AliasType @@ -107,6 +108,7 @@ from ._models import TargetResource from ._models import TemplateHashResult from ._models import TemplateLink + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -169,6 +171,7 @@ 'TargetResource', 'TemplateHashResult', 'TemplateLink', + 'ZoneMapping', 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models.py index 7e077d189c98..d7d599c192cc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models.py @@ -1140,6 +1140,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_03_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_03_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1152,6 +1155,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -1162,6 +1166,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.capabilities = kwargs.get('capabilities', None) self.properties = kwargs.get('properties', None) @@ -1618,3 +1623,23 @@ def __init__(self, **kwargs): super(TemplateLink, self).__init__(**kwargs) self.uri = kwargs.get('uri', None) self.content_version = kwargs.get('content_version', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models_py3.py index 2beea96db371..4d33c9699a9b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models_py3.py @@ -1140,6 +1140,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_03_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_03_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1152,16 +1155,18 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, capabilities: str=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.capabilities = capabilities self.properties = properties @@ -1618,3 +1623,23 @@ def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: super(TemplateLink, self).__init__(**kwargs) self.uri = uri self.content_version = content_version + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py index a4e62c5bf265..38e08275f74c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py @@ -58,6 +58,7 @@ from ._models_py3 import TargetResource from ._models_py3 import TemplateHashResult from ._models_py3 import TemplateLink + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import AliasPathType from ._models import AliasType @@ -107,6 +108,7 @@ from ._models import TargetResource from ._models import TemplateHashResult from ._models import TemplateLink + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -169,6 +171,7 @@ 'TargetResource', 'TemplateHashResult', 'TemplateLink', + 'ZoneMapping', 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models.py index fc9b7b2831da..915c04adc45d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models.py @@ -1150,6 +1150,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_05_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_05_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1162,6 +1165,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -1172,6 +1176,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.capabilities = kwargs.get('capabilities', None) self.properties = kwargs.get('properties', None) @@ -1628,3 +1633,23 @@ def __init__(self, **kwargs): super(TemplateLink, self).__init__(**kwargs) self.uri = kwargs.get('uri', None) self.content_version = kwargs.get('content_version', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py index e2c3da6ba92b..aca34ffb9dc5 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py @@ -1150,6 +1150,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_05_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_05_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1162,16 +1165,18 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, capabilities: str=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.capabilities = capabilities self.properties = properties @@ -1628,3 +1633,23 @@ def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: super(TemplateLink, self).__init__(**kwargs) self.uri = uri self.content_version = content_version + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py index a4e62c5bf265..38e08275f74c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py @@ -58,6 +58,7 @@ from ._models_py3 import TargetResource from ._models_py3 import TemplateHashResult from ._models_py3 import TemplateLink + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import AliasPathType from ._models import AliasType @@ -107,6 +108,7 @@ from ._models import TargetResource from ._models import TemplateHashResult from ._models import TemplateLink + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -169,6 +171,7 @@ 'TargetResource', 'TemplateHashResult', 'TemplateLink', + 'ZoneMapping', 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models.py index d68e9e9a7465..ee75e1fc2e0e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models.py @@ -1150,6 +1150,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_05_10.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_05_10.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1162,6 +1165,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -1172,6 +1176,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.capabilities = kwargs.get('capabilities', None) self.properties = kwargs.get('properties', None) @@ -1628,3 +1633,23 @@ def __init__(self, **kwargs): super(TemplateLink, self).__init__(**kwargs) self.uri = kwargs.get('uri', None) self.content_version = kwargs.get('content_version', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py index e62257abc561..f3c4676986b9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py @@ -1150,6 +1150,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_05_10.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_05_10.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1162,16 +1165,18 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, capabilities: str=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.capabilities = capabilities self.properties = properties @@ -1628,3 +1633,23 @@ def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: super(TemplateLink, self).__init__(**kwargs) self.uri = uri self.content_version = content_version + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py index 2f02c0c85ca9..c576c297906c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py @@ -63,6 +63,7 @@ from ._models_py3 import WhatIfChange from ._models_py3 import WhatIfOperationResult from ._models_py3 import WhatIfPropertyChange + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import AliasPathType from ._models import AliasType @@ -117,6 +118,7 @@ from ._models import WhatIfChange from ._models import WhatIfOperationResult from ._models import WhatIfPropertyChange + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -187,6 +189,7 @@ 'WhatIfChange', 'WhatIfOperationResult', 'WhatIfPropertyChange', + 'ZoneMapping', 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models.py index 96f9b92f39d4..3946c0edf9f6 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models.py @@ -1262,6 +1262,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_07_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_07_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1274,6 +1277,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -1284,6 +1288,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.capabilities = kwargs.get('capabilities', None) self.properties = kwargs.get('properties', None) @@ -1816,3 +1821,23 @@ def __init__(self, **kwargs): self.before = kwargs.get('before', None) self.after = kwargs.get('after', None) self.children = kwargs.get('children', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py index 98ae10cab768..5c955cd1cc53 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py @@ -1262,6 +1262,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_07_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_07_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1274,16 +1277,18 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, capabilities: str=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.capabilities = capabilities self.properties = properties @@ -1816,3 +1821,23 @@ def __init__(self, *, path: str, property_change_type, before=None, after=None, self.before = before self.after = after self.children = children + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py index 1b7c3ec2fdd3..1775935b4fac 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py @@ -64,6 +64,7 @@ from ._models_py3 import WhatIfChange from ._models_py3 import WhatIfOperationResult from ._models_py3 import WhatIfPropertyChange + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import AliasPathType from ._models import AliasType @@ -119,6 +120,7 @@ from ._models import WhatIfChange from ._models import WhatIfOperationResult from ._models import WhatIfPropertyChange + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -190,6 +192,7 @@ 'WhatIfChange', 'WhatIfOperationResult', 'WhatIfPropertyChange', + 'ZoneMapping', 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models.py index e4096d4c205a..38eaff715dfb 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models.py @@ -1262,6 +1262,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_08_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_08_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1274,6 +1277,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -1284,6 +1288,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.capabilities = kwargs.get('capabilities', None) self.properties = kwargs.get('properties', None) @@ -1844,3 +1849,23 @@ def __init__(self, **kwargs): self.before = kwargs.get('before', None) self.after = kwargs.get('after', None) self.children = kwargs.get('children', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py index c107a89cec48..a94dabe7b048 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py @@ -1262,6 +1262,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_08_01.models.AliasType] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_08_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1274,16 +1277,18 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[AliasType]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, capabilities: str=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.capabilities = capabilities self.properties = properties @@ -1844,3 +1849,23 @@ def __init__(self, *, path: str, property_change_type, before=None, after=None, self.before = before self.after = after self.children = children + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_resource_groups_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_resource_groups_operations.py index e7d76639c443..f97a21b098c7 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_resource_groups_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_resource_groups_operations.py @@ -387,7 +387,7 @@ def _export_template_initial( url = self.export_template.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py index 79a720cc9077..0feb0963eac9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py @@ -70,6 +70,7 @@ from ._models_py3 import WhatIfChange from ._models_py3 import WhatIfOperationResult from ._models_py3 import WhatIfPropertyChange + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import Alias from ._models import AliasPath @@ -131,6 +132,7 @@ from ._models import WhatIfChange from ._models import WhatIfOperationResult from ._models import WhatIfPropertyChange + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -212,6 +214,7 @@ 'WhatIfChange', 'WhatIfOperationResult', 'WhatIfPropertyChange', + 'ZoneMapping', 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py index 8a55a291638d..d4ae5d726778 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models.py @@ -1355,6 +1355,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_10_01.models.Alias] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_10_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1367,6 +1370,7 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[Alias]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } @@ -1377,6 +1381,7 @@ def __init__(self, **kwargs): self.locations = kwargs.get('locations', None) self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) + self.zone_mappings = kwargs.get('zone_mappings', None) self.capabilities = kwargs.get('capabilities', None) self.properties = kwargs.get('properties', None) @@ -2070,3 +2075,23 @@ def __init__(self, **kwargs): self.before = kwargs.get('before', None) self.after = kwargs.get('after', None) self.children = kwargs.get('children', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py index f7c7a3faca5b..8bfaad4f8ff7 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py @@ -1355,6 +1355,9 @@ class ProviderResourceType(Model): list[~azure.mgmt.resource.resources.v2019_10_01.models.Alias] :param api_versions: The API version. :type api_versions: list[str] + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2019_10_01.models.ZoneMapping] :param capabilities: The additional capabilities offered by this resource type. :type capabilities: str @@ -1367,16 +1370,18 @@ class ProviderResourceType(Model): 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases': {'key': 'aliases', 'type': '[Alias]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, capabilities: str=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions + self.zone_mappings = zone_mappings self.capabilities = capabilities self.properties = properties @@ -2070,3 +2075,23 @@ def __init__(self, *, path: str, property_change_type, before=None, after=None, self.before = before self.after = after self.children = children + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_resource_groups_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_resource_groups_operations.py index b61989570e8a..10be0f52cac6 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_resource_groups_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_resource_groups_operations.py @@ -387,7 +387,7 @@ def _export_template_initial( url = self.export_template.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/__init__.py index fe0051b633b0..f2e6fd8725cd 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/__init__.py @@ -74,6 +74,7 @@ from ._models_py3 import WhatIfChange from ._models_py3 import WhatIfOperationResult from ._models_py3 import WhatIfPropertyChange + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import Alias from ._models import AliasPath @@ -139,6 +140,7 @@ from ._models import WhatIfChange from ._models import WhatIfOperationResult from ._models import WhatIfPropertyChange + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -228,6 +230,7 @@ 'WhatIfChange', 'WhatIfOperationResult', 'WhatIfPropertyChange', + 'ZoneMapping', 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models.py index 71a54dc39351..d202fe6a8526 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models.py @@ -1051,7 +1051,6 @@ class GenericResource(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, } _attribute_map = { @@ -1121,7 +1120,6 @@ class GenericResourceExpanded(GenericResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, 'created_time': {'readonly': True}, 'changed_time': {'readonly': True}, 'provisioning_state': {'readonly': True}, @@ -1490,6 +1488,9 @@ class ProviderResourceType(Model): :type api_versions: list[str] :ivar default_api_version: The default API version. :vartype default_api_version: str + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2020_06_01.models.ZoneMapping] :ivar api_profiles: The API profiles for the resource provider. :vartype api_profiles: list[~azure.mgmt.resource.resources.v2020_06_01.models.ApiProfile] @@ -1511,6 +1512,7 @@ class ProviderResourceType(Model): 'aliases': {'key': 'aliases', 'type': '[Alias]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'api_profiles': {'key': 'apiProfiles', 'type': '[ApiProfile]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, @@ -1523,6 +1525,7 @@ def __init__(self, **kwargs): self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) self.default_api_version = None + self.zone_mappings = kwargs.get('zone_mappings', None) self.api_profiles = None self.capabilities = kwargs.get('capabilities', None) self.properties = kwargs.get('properties', None) @@ -2244,3 +2247,23 @@ def __init__(self, **kwargs): self.before = kwargs.get('before', None) self.after = kwargs.get('after', None) self.children = kwargs.get('children', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models_py3.py index a8c6124537a6..9900e79aa89e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models_py3.py @@ -1051,7 +1051,6 @@ class GenericResource(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, } _attribute_map = { @@ -1121,7 +1120,6 @@ class GenericResourceExpanded(GenericResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, 'created_time': {'readonly': True}, 'changed_time': {'readonly': True}, 'provisioning_state': {'readonly': True}, @@ -1490,6 +1488,9 @@ class ProviderResourceType(Model): :type api_versions: list[str] :ivar default_api_version: The default API version. :vartype default_api_version: str + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2020_06_01.models.ZoneMapping] :ivar api_profiles: The API profiles for the resource provider. :vartype api_profiles: list[~azure.mgmt.resource.resources.v2020_06_01.models.ApiProfile] @@ -1511,18 +1512,20 @@ class ProviderResourceType(Model): 'aliases': {'key': 'aliases', 'type': '[Alias]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'api_profiles': {'key': 'apiProfiles', 'type': '[ApiProfile]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, aliases=None, api_versions=None, zone_mappings=None, capabilities: str=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations self.aliases = aliases self.api_versions = api_versions self.default_api_version = None + self.zone_mappings = zone_mappings self.api_profiles = None self.capabilities = capabilities self.properties = properties @@ -2244,3 +2247,23 @@ def __init__(self, *, path: str, property_change_type, before=None, after=None, self.before = before self.after = after self.children = children + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_deployment_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_deployment_operations.py index ed250f1ff10c..43da047a58ce 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_deployment_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_deployment_operations.py @@ -64,7 +64,7 @@ def get_at_scope( url = self.get_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -129,7 +129,7 @@ def prepare_request(next_link=None): url = self.list_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -200,7 +200,7 @@ def get_at_tenant_scope( # Construct URL url = self.get_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -262,7 +262,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -336,7 +336,7 @@ def get_at_management_group_scope( url = self.get_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -401,7 +401,7 @@ def prepare_request(next_link=None): url = self.list_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -472,7 +472,7 @@ def get_at_subscription_scope( # Construct URL url = self.get_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -535,7 +535,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -610,8 +610,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -677,8 +677,8 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), '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/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_deployments_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_deployments_operations.py index 160c10196a77..3d07caf5ec79 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_deployments_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_deployments_operations.py @@ -48,7 +48,7 @@ def _delete_at_scope_initial( url = self.delete_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -151,7 +151,7 @@ def check_existence_at_scope( url = self.check_existence_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -191,7 +191,7 @@ def _create_or_update_at_scope_initial( url = self.create_or_update_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -312,7 +312,7 @@ def get_at_scope( url = self.get_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -377,7 +377,7 @@ def cancel_at_scope( url = self.cancel_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -415,7 +415,7 @@ def _validate_at_scope_initial( url = self.validate_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -535,7 +535,7 @@ def export_template_at_scope( url = self.export_template_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -657,7 +657,7 @@ def _delete_at_tenant_scope_initial( # Construct URL url = self.delete_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -754,7 +754,7 @@ def check_existence_at_tenant_scope( # Construct URL url = self.check_existence_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -793,7 +793,7 @@ def _create_or_update_at_tenant_scope_initial( # Construct URL url = self.create_or_update_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -908,7 +908,7 @@ def get_at_tenant_scope( # Construct URL url = self.get_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -970,7 +970,7 @@ def cancel_at_tenant_scope( # Construct URL url = self.cancel_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1007,7 +1007,7 @@ def _validate_at_tenant_scope_initial( # Construct URL url = self.validate_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1109,7 +1109,7 @@ def _what_if_at_tenant_scope_initial( # Construct URL url = self.what_if_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1234,7 +1234,7 @@ def export_template_at_tenant_scope( # Construct URL url = self.export_template_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1351,7 +1351,7 @@ def _delete_at_management_group_scope_initial( url = self.delete_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1454,7 +1454,7 @@ def check_existence_at_management_group_scope( url = self.check_existence_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1494,7 +1494,7 @@ def _create_or_update_at_management_group_scope_initial( url = self.create_or_update_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1615,7 +1615,7 @@ def get_at_management_group_scope( url = self.get_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1680,7 +1680,7 @@ def cancel_at_management_group_scope( url = self.cancel_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1718,7 +1718,7 @@ def _validate_at_management_group_scope_initial( url = self.validate_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1824,7 +1824,7 @@ def _what_if_at_management_group_scope_initial( url = self.what_if_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1955,7 +1955,7 @@ def export_template_at_management_group_scope( url = self.export_template_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -2077,7 +2077,7 @@ def _delete_at_subscription_scope_initial( # Construct URL url = self.delete_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2175,7 +2175,7 @@ def check_existence_at_subscription_scope( # Construct URL url = self.check_existence_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2215,7 +2215,7 @@ def _create_or_update_at_subscription_scope_initial( # Construct URL url = self.create_or_update_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2331,7 +2331,7 @@ def get_at_subscription_scope( # Construct URL url = self.get_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2394,7 +2394,7 @@ def cancel_at_subscription_scope( # Construct URL url = self.cancel_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2432,7 +2432,7 @@ def _validate_at_subscription_scope_initial( # Construct URL url = self.validate_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2535,7 +2535,7 @@ def _what_if_at_subscription_scope_initial( # Construct URL url = self.what_if_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2661,7 +2661,7 @@ def export_template_at_subscription_scope( # Construct URL url = self.export_template_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2782,8 +2782,8 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2889,8 +2889,8 @@ def check_existence( # Construct URL url = self.check_existence.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2930,8 +2930,8 @@ def _create_or_update_initial( # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3055,8 +3055,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3122,8 +3122,8 @@ def cancel( # Construct URL url = self.cancel.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3161,8 +3161,8 @@ def _validate_initial( # Construct URL url = self.validate.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3269,8 +3269,8 @@ def _what_if_initial( # Construct URL url = self.what_if.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3403,8 +3403,8 @@ def export_template( # Construct URL url = self.export_template.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3471,7 +3471,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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/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 2ec0f20590a3..226363ddc747 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 @@ -60,7 +60,7 @@ def check_existence( # Construct URL url = self.check_existence.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -121,7 +121,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -168,19 +168,19 @@ def create_or_update( def _delete_initial( - self, resource_group_name, force_deletion_resource_types=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, force_deletion_types=None, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # 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') + if force_deletion_types is not None: + query_parameters['forceDeletionTypes'] = self._serialize.query("force_deletion_types", force_deletion_types, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -206,7 +206,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, force_deletion_resource_types=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, force_deletion_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 @@ -216,10 +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 force_deletion_types: The resource types you want to force + delete. Currently, only the following is supported: + forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets + :type force_deletion_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 @@ -233,7 +233,7 @@ def delete( """ raw_result = self._delete_initial( resource_group_name=resource_group_name, - force_deletion_resource_types=force_deletion_resource_types, + force_deletion_types=force_deletion_types, custom_headers=custom_headers, raw=True, **operation_config @@ -274,7 +274,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -342,7 +342,7 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -394,7 +394,7 @@ def _export_template_initial( url = self.export_template.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_resources_operations.py index 57293272d622..8e6d616dce5f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_resources_operations.py @@ -91,7 +91,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -153,7 +153,7 @@ def _move_resources_initial( # Construct URL url = self.move_resources.metadata['url'] path_format_arguments = { - 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -247,7 +247,7 @@ def _validate_move_resources_initial( # Construct URL url = self.validate_move_resources.metadata['url'] path_format_arguments = { - 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -467,7 +467,7 @@ def check_existence( # Construct URL url = self.check_existence.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), @@ -511,7 +511,7 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), @@ -607,7 +607,7 @@ def _create_or_update_initial( # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), @@ -727,7 +727,7 @@ def _update_initial( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), @@ -871,7 +871,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/__init__.py index 0715fb7047d8..765281ad4177 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/__init__.py @@ -76,6 +76,7 @@ from ._models_py3 import WhatIfChange from ._models_py3 import WhatIfOperationResult from ._models_py3 import WhatIfPropertyChange + from ._models_py3 import ZoneMapping except (SyntaxError, ImportError): from ._models import Alias from ._models import AliasPath @@ -143,6 +144,7 @@ from ._models import WhatIfChange from ._models import WhatIfOperationResult from ._models import WhatIfPropertyChange + from ._models import ZoneMapping from ._paged_models import DeploymentExtendedPaged from ._paged_models import DeploymentOperationPaged from ._paged_models import GenericResourceExpandedPaged @@ -234,6 +236,7 @@ 'WhatIfChange', 'WhatIfOperationResult', 'WhatIfPropertyChange', + 'ZoneMapping', 'OperationPaged', 'DeploymentExtendedPaged', 'ProviderPaged', diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models.py index 15498ea29303..ea309c39d54d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models.py @@ -1051,7 +1051,6 @@ class GenericResource(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, } _attribute_map = { @@ -1121,7 +1120,6 @@ class GenericResourceExpanded(GenericResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, 'created_time': {'readonly': True}, 'changed_time': {'readonly': True}, 'provisioning_state': {'readonly': True}, @@ -1518,6 +1516,9 @@ class ProviderResourceType(Model): :type api_versions: list[str] :ivar default_api_version: The default API version. :vartype default_api_version: str + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2020_10_01.models.ZoneMapping] :ivar api_profiles: The API profiles for the resource provider. :vartype api_profiles: list[~azure.mgmt.resource.resources.v2020_10_01.models.ApiProfile] @@ -1540,6 +1541,7 @@ class ProviderResourceType(Model): 'aliases': {'key': 'aliases', 'type': '[Alias]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'api_profiles': {'key': 'apiProfiles', 'type': '[ApiProfile]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, @@ -1553,6 +1555,7 @@ def __init__(self, **kwargs): self.aliases = kwargs.get('aliases', None) self.api_versions = kwargs.get('api_versions', None) self.default_api_version = None + self.zone_mappings = kwargs.get('zone_mappings', None) self.api_profiles = None self.capabilities = kwargs.get('capabilities', None) self.properties = kwargs.get('properties', None) @@ -2309,3 +2312,23 @@ def __init__(self, **kwargs): self.before = kwargs.get('before', None) self.after = kwargs.get('after', None) self.children = kwargs.get('children', None) + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ZoneMapping, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models_py3.py index a1fc1aaf115e..38a2468a11e7 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models_py3.py @@ -1051,7 +1051,6 @@ class GenericResource(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, } _attribute_map = { @@ -1121,7 +1120,6 @@ class GenericResourceExpanded(GenericResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, 'created_time': {'readonly': True}, 'changed_time': {'readonly': True}, 'provisioning_state': {'readonly': True}, @@ -1518,6 +1516,9 @@ class ProviderResourceType(Model): :type api_versions: list[str] :ivar default_api_version: The default API version. :vartype default_api_version: str + :param zone_mappings: + :type zone_mappings: + list[~azure.mgmt.resource.resources.v2020_10_01.models.ZoneMapping] :ivar api_profiles: The API profiles for the resource provider. :vartype api_profiles: list[~azure.mgmt.resource.resources.v2020_10_01.models.ApiProfile] @@ -1540,12 +1541,13 @@ class ProviderResourceType(Model): 'aliases': {'key': 'aliases', 'type': '[Alias]'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'zone_mappings': {'key': 'zoneMappings', 'type': '[ZoneMapping]'}, 'api_profiles': {'key': 'apiProfiles', 'type': '[ApiProfile]'}, 'capabilities': {'key': 'capabilities', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, } - def __init__(self, *, resource_type: str=None, locations=None, location_mappings=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, resource_type: str=None, locations=None, location_mappings=None, aliases=None, api_versions=None, zone_mappings=None, capabilities: str=None, properties=None, **kwargs) -> None: super(ProviderResourceType, self).__init__(**kwargs) self.resource_type = resource_type self.locations = locations @@ -1553,6 +1555,7 @@ def __init__(self, *, resource_type: str=None, locations=None, location_mappings self.aliases = aliases self.api_versions = api_versions self.default_api_version = None + self.zone_mappings = zone_mappings self.api_profiles = None self.capabilities = capabilities self.properties = properties @@ -2309,3 +2312,23 @@ def __init__(self, *, path: str, property_change_type, before=None, after=None, self.before = before self.after = after self.children = children + + +class ZoneMapping(Model): + """ZoneMapping. + + :param location: The location of the zone mapping. + :type location: str + :param zones: + :type zones: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, zones=None, **kwargs) -> None: + super(ZoneMapping, self).__init__(**kwargs) + self.location = location + self.zones = zones diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_deployment_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_deployment_operations.py index f8b594704c2b..434ad758eb47 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_deployment_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_deployment_operations.py @@ -64,7 +64,7 @@ def get_at_scope( url = self.get_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -129,7 +129,7 @@ def prepare_request(next_link=None): url = self.list_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -200,7 +200,7 @@ def get_at_tenant_scope( # Construct URL url = self.get_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -262,7 +262,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -336,7 +336,7 @@ def get_at_management_group_scope( url = self.get_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -401,7 +401,7 @@ def prepare_request(next_link=None): url = self.list_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -472,7 +472,7 @@ def get_at_subscription_scope( # Construct URL url = self.get_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -535,7 +535,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -610,8 +610,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -677,8 +677,8 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), '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/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_deployments_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_deployments_operations.py index 21d45ba8c551..2849a9d3c31e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_deployments_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_deployments_operations.py @@ -48,7 +48,7 @@ def _delete_at_scope_initial( url = self.delete_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -151,7 +151,7 @@ def check_existence_at_scope( url = self.check_existence_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -191,7 +191,7 @@ def _create_or_update_at_scope_initial( url = self.create_or_update_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -312,7 +312,7 @@ def get_at_scope( url = self.get_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -377,7 +377,7 @@ def cancel_at_scope( url = self.cancel_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -415,7 +415,7 @@ def _validate_at_scope_initial( url = self.validate_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -535,7 +535,7 @@ def export_template_at_scope( url = self.export_template_at_scope.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -657,7 +657,7 @@ def _delete_at_tenant_scope_initial( # Construct URL url = self.delete_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -754,7 +754,7 @@ def check_existence_at_tenant_scope( # Construct URL url = self.check_existence_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -793,7 +793,7 @@ def _create_or_update_at_tenant_scope_initial( # Construct URL url = self.create_or_update_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -908,7 +908,7 @@ def get_at_tenant_scope( # Construct URL url = self.get_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -970,7 +970,7 @@ def cancel_at_tenant_scope( # Construct URL url = self.cancel_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1007,7 +1007,7 @@ def _validate_at_tenant_scope_initial( # Construct URL url = self.validate_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1109,7 +1109,7 @@ def _what_if_at_tenant_scope_initial( # Construct URL url = self.what_if_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1234,7 +1234,7 @@ def export_template_at_tenant_scope( # Construct URL url = self.export_template_at_tenant_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1351,7 +1351,7 @@ def _delete_at_management_group_scope_initial( url = self.delete_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1454,7 +1454,7 @@ def check_existence_at_management_group_scope( url = self.check_existence_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1494,7 +1494,7 @@ def _create_or_update_at_management_group_scope_initial( url = self.create_or_update_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1615,7 +1615,7 @@ def get_at_management_group_scope( url = self.get_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1680,7 +1680,7 @@ def cancel_at_management_group_scope( url = self.cancel_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1718,7 +1718,7 @@ def _validate_at_management_group_scope_initial( url = self.validate_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1824,7 +1824,7 @@ def _what_if_at_management_group_scope_initial( url = self.what_if_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -1955,7 +1955,7 @@ def export_template_at_management_group_scope( url = self.export_template_at_management_group_scope.metadata['url'] path_format_arguments = { 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -2077,7 +2077,7 @@ def _delete_at_subscription_scope_initial( # Construct URL url = self.delete_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2175,7 +2175,7 @@ def check_existence_at_subscription_scope( # Construct URL url = self.check_existence_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2215,7 +2215,7 @@ def _create_or_update_at_subscription_scope_initial( # Construct URL url = self.create_or_update_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2331,7 +2331,7 @@ def get_at_subscription_scope( # Construct URL url = self.get_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2394,7 +2394,7 @@ def cancel_at_subscription_scope( # Construct URL url = self.cancel_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2432,7 +2432,7 @@ def _validate_at_subscription_scope_initial( # Construct URL url = self.validate_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2535,7 +2535,7 @@ def _what_if_at_subscription_scope_initial( # Construct URL url = self.what_if_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2661,7 +2661,7 @@ def export_template_at_subscription_scope( # Construct URL url = self.export_template_at_subscription_scope.metadata['url'] path_format_arguments = { - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2782,8 +2782,8 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2889,8 +2889,8 @@ def check_existence( # Construct URL url = self.check_existence.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2930,8 +2930,8 @@ def _create_or_update_initial( # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3055,8 +3055,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3122,8 +3122,8 @@ def cancel( # Construct URL url = self.cancel.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3161,8 +3161,8 @@ def _validate_initial( # Construct URL url = self.validate.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3269,8 +3269,8 @@ def _what_if_initial( # Construct URL url = self.what_if.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3403,8 +3403,8 @@ def export_template( # Construct URL url = self.export_template.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3471,7 +3471,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_resource_groups_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_resource_groups_operations.py index 8697f7e68feb..bb6827c3f1df 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_resource_groups_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_resource_groups_operations.py @@ -60,7 +60,7 @@ def check_existence( # Construct URL url = self.check_existence.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -121,7 +121,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -172,7 +172,7 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -267,7 +267,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -335,7 +335,7 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -387,7 +387,7 @@ def _export_template_initial( url = self.export_template.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1) } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_resources_operations.py index e0b04ed4b74c..7f79bd9bdd97 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_resources_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_resources_operations.py @@ -91,7 +91,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -153,7 +153,7 @@ def _move_resources_initial( # Construct URL url = self.move_resources.metadata['url'] path_format_arguments = { - 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -247,7 +247,7 @@ def _validate_move_resources_initial( # Construct URL url = self.validate_move_resources.metadata['url'] path_format_arguments = { - 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -467,7 +467,7 @@ def check_existence( # Construct URL url = self.check_existence.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), @@ -511,7 +511,7 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), @@ -607,7 +607,7 @@ def _create_or_update_initial( # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), @@ -727,7 +727,7 @@ def _update_initial( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), @@ -871,7 +871,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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), diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/__init__.py new file mode 100644 index 000000000000..68bc897193ac --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import ResourceManagementClientConfiguration +from ._resource_management_client import ResourceManagementClient +__all__ = ['ResourceManagementClient', 'ResourceManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_configuration.py new file mode 100644 index 000000000000..3b326f792363 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_configuration.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class ResourceManagementClientConfiguration(AzureConfiguration): + """Configuration for ResourceManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ResourceManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py new file mode 100644 index 000000000000..fcd8b5fb4817 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py @@ -0,0 +1,84 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import ResourceManagementClientConfiguration +from .operations import Operations +from .operations import DeploymentsOperations +from .operations import ProvidersOperations +from .operations import ProviderResourceTypesOperations +from .operations import ResourcesOperations +from .operations import ResourceGroupsOperations +from .operations import TagsOperations +from .operations import DeploymentOperations +from . import models + + +class ResourceManagementClient(SDKClient): + """Provides operations for working with resources and resource groups. + + :ivar config: Configuration for client. + :vartype config: ResourceManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.resource.resources.v2021_01_01.operations.Operations + :ivar deployments: Deployments operations + :vartype deployments: azure.mgmt.resource.resources.v2021_01_01.operations.DeploymentsOperations + :ivar providers: Providers operations + :vartype providers: azure.mgmt.resource.resources.v2021_01_01.operations.ProvidersOperations + :ivar provider_resource_types: ProviderResourceTypes operations + :vartype provider_resource_types: azure.mgmt.resource.resources.v2021_01_01.operations.ProviderResourceTypesOperations + :ivar resources: Resources operations + :vartype resources: azure.mgmt.resource.resources.v2021_01_01.operations.ResourcesOperations + :ivar resource_groups: ResourceGroups operations + :vartype resource_groups: azure.mgmt.resource.resources.v2021_01_01.operations.ResourceGroupsOperations + :ivar tags: Tags operations + :vartype tags: azure.mgmt.resource.resources.v2021_01_01.operations.TagsOperations + :ivar deployment_operations: DeploymentOperations operations + :vartype deployment_operations: azure.mgmt.resource.resources.v2021_01_01.operations.DeploymentOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ResourceManagementClientConfiguration(credentials, subscription_id, base_url) + super(ResourceManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-01-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.providers = ProvidersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.provider_resource_types = ProviderResourceTypesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.resources = ResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.resource_groups = ResourceGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tags = TagsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.deployment_operations = DeploymentOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/__init__.py new file mode 100644 index 000000000000..06c8f8c92c71 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/__init__.py @@ -0,0 +1,263 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Alias + from ._models_py3 import AliasPath + from ._models_py3 import AliasPathMetadata + from ._models_py3 import AliasPattern + from ._models_py3 import ApiProfile + from ._models_py3 import BasicDependency + from ._models_py3 import DebugSetting + from ._models_py3 import Dependency + from ._models_py3 import Deployment + from ._models_py3 import DeploymentExportResult + from ._models_py3 import DeploymentExtended + from ._models_py3 import DeploymentExtendedFilter + from ._models_py3 import DeploymentOperation + from ._models_py3 import DeploymentOperationProperties + from ._models_py3 import DeploymentProperties + from ._models_py3 import DeploymentPropertiesExtended + from ._models_py3 import DeploymentValidateResult + from ._models_py3 import DeploymentWhatIf + from ._models_py3 import DeploymentWhatIfProperties + from ._models_py3 import DeploymentWhatIfSettings + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse + from ._models_py3 import ExportTemplateRequest + from ._models_py3 import ExpressionEvaluationOptions + from ._models_py3 import ExtendedLocation + from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded + from ._models_py3 import GenericResourceFilter + from ._models_py3 import HttpMessage + from ._models_py3 import Identity + from ._models_py3 import IdentityUserAssignedIdentitiesValue + from ._models_py3 import OnErrorDeployment + from ._models_py3 import OnErrorDeploymentExtended + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ParametersLink + from ._models_py3 import Plan + from ._models_py3 import Provider + from ._models_py3 import ProviderExtendedLocation + from ._models_py3 import ProviderResourceType + from ._models_py3 import ProviderResourceTypeListResult + from ._models_py3 import Resource + from ._models_py3 import ResourceGroup + from ._models_py3 import ResourceGroupExportResult + from ._models_py3 import ResourceGroupFilter + from ._models_py3 import ResourceGroupPatchable + from ._models_py3 import ResourceGroupProperties + from ._models_py3 import ResourceProviderOperationDisplayProperties + from ._models_py3 import ResourceReference + from ._models_py3 import ResourcesMoveInfo + from ._models_py3 import ScopedDeployment + from ._models_py3 import ScopedDeploymentWhatIf + from ._models_py3 import Sku + from ._models_py3 import StatusMessage + from ._models_py3 import SubResource + from ._models_py3 import TagCount + from ._models_py3 import TagDetails + from ._models_py3 import Tags + from ._models_py3 import TagsPatchResource + from ._models_py3 import TagsResource + from ._models_py3 import TagValue + from ._models_py3 import TargetResource + from ._models_py3 import TemplateHashResult + from ._models_py3 import TemplateLink + from ._models_py3 import WhatIfChange + from ._models_py3 import WhatIfOperationResult + from ._models_py3 import WhatIfPropertyChange +except (SyntaxError, ImportError): + from ._models import Alias + from ._models import AliasPath + from ._models import AliasPathMetadata + from ._models import AliasPattern + from ._models import ApiProfile + from ._models import BasicDependency + from ._models import DebugSetting + from ._models import Dependency + from ._models import Deployment + from ._models import DeploymentExportResult + from ._models import DeploymentExtended + from ._models import DeploymentExtendedFilter + from ._models import DeploymentOperation + from ._models import DeploymentOperationProperties + from ._models import DeploymentProperties + from ._models import DeploymentPropertiesExtended + from ._models import DeploymentValidateResult + from ._models import DeploymentWhatIf + from ._models import DeploymentWhatIfProperties + from ._models import DeploymentWhatIfSettings + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse + from ._models import ExportTemplateRequest + from ._models import ExpressionEvaluationOptions + from ._models import ExtendedLocation + from ._models import GenericResource + from ._models import GenericResourceExpanded + from ._models import GenericResourceFilter + from ._models import HttpMessage + from ._models import Identity + from ._models import IdentityUserAssignedIdentitiesValue + from ._models import OnErrorDeployment + from ._models import OnErrorDeploymentExtended + from ._models import Operation + from ._models import OperationDisplay + from ._models import ParametersLink + from ._models import Plan + from ._models import Provider + from ._models import ProviderExtendedLocation + from ._models import ProviderResourceType + from ._models import ProviderResourceTypeListResult + from ._models import Resource + from ._models import ResourceGroup + from ._models import ResourceGroupExportResult + from ._models import ResourceGroupFilter + from ._models import ResourceGroupPatchable + from ._models import ResourceGroupProperties + from ._models import ResourceProviderOperationDisplayProperties + from ._models import ResourceReference + from ._models import ResourcesMoveInfo + from ._models import ScopedDeployment + from ._models import ScopedDeploymentWhatIf + from ._models import Sku + from ._models import StatusMessage + from ._models import SubResource + from ._models import TagCount + from ._models import TagDetails + from ._models import Tags + from ._models import TagsPatchResource + from ._models import TagsResource + from ._models import TagValue + from ._models import TargetResource + from ._models import TemplateHashResult + from ._models import TemplateLink + from ._models import WhatIfChange + from ._models import WhatIfOperationResult + from ._models import WhatIfPropertyChange +from ._paged_models import DeploymentExtendedPaged +from ._paged_models import DeploymentOperationPaged +from ._paged_models import GenericResourceExpandedPaged +from ._paged_models import OperationPaged +from ._paged_models import ProviderPaged +from ._paged_models import ResourceGroupPaged +from ._paged_models import TagDetailsPaged +from ._resource_management_client_enums import ( + DeploymentMode, + OnErrorDeploymentType, + ExpressionEvaluationOptionsScopeType, + WhatIfResultFormat, + AliasPathTokenType, + AliasPathAttributes, + AliasPatternType, + AliasType, + ProvisioningState, + ResourceIdentityType, + ExtendedLocationType, + ProvisioningOperation, + PropertyChangeType, + ChangeType, + TagsPatchOperation, +) + +__all__ = [ + 'Alias', + 'AliasPath', + 'AliasPathMetadata', + 'AliasPattern', + 'ApiProfile', + 'BasicDependency', + 'DebugSetting', + 'Dependency', + 'Deployment', + 'DeploymentExportResult', + 'DeploymentExtended', + 'DeploymentExtendedFilter', + 'DeploymentOperation', + 'DeploymentOperationProperties', + 'DeploymentProperties', + 'DeploymentPropertiesExtended', + 'DeploymentValidateResult', + 'DeploymentWhatIf', + 'DeploymentWhatIfProperties', + 'DeploymentWhatIfSettings', + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'ExportTemplateRequest', + 'ExpressionEvaluationOptions', + 'ExtendedLocation', + 'GenericResource', + 'GenericResourceExpanded', + 'GenericResourceFilter', + 'HttpMessage', + 'Identity', + 'IdentityUserAssignedIdentitiesValue', + 'OnErrorDeployment', + 'OnErrorDeploymentExtended', + 'Operation', + 'OperationDisplay', + 'ParametersLink', + 'Plan', + 'Provider', + 'ProviderExtendedLocation', + 'ProviderResourceType', + 'ProviderResourceTypeListResult', + 'Resource', + 'ResourceGroup', + 'ResourceGroupExportResult', + 'ResourceGroupFilter', + 'ResourceGroupPatchable', + 'ResourceGroupProperties', + 'ResourceProviderOperationDisplayProperties', + 'ResourceReference', + 'ResourcesMoveInfo', + 'ScopedDeployment', + 'ScopedDeploymentWhatIf', + 'Sku', + 'StatusMessage', + 'SubResource', + 'TagCount', + 'TagDetails', + 'Tags', + 'TagsPatchResource', + 'TagsResource', + 'TagValue', + 'TargetResource', + 'TemplateHashResult', + 'TemplateLink', + 'WhatIfChange', + 'WhatIfOperationResult', + 'WhatIfPropertyChange', + 'OperationPaged', + 'DeploymentExtendedPaged', + 'ProviderPaged', + 'GenericResourceExpandedPaged', + 'ResourceGroupPaged', + 'TagDetailsPaged', + 'DeploymentOperationPaged', + 'DeploymentMode', + 'OnErrorDeploymentType', + 'ExpressionEvaluationOptionsScopeType', + 'WhatIfResultFormat', + 'AliasPathTokenType', + 'AliasPathAttributes', + 'AliasPatternType', + 'AliasType', + 'ProvisioningState', + 'ResourceIdentityType', + 'ExtendedLocationType', + 'ProvisioningOperation', + 'PropertyChangeType', + 'ChangeType', + 'TagsPatchOperation', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models.py new file mode 100644 index 000000000000..87c945e3a58e --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models.py @@ -0,0 +1,2352 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Alias(Model): + """The alias type. . + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2021_01_01.models.AliasPath] + :param type: The type of the alias. Possible values include: + 'NotSpecified', 'PlainText', 'Mask' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasType + :param default_path: The default path for an alias. + :type default_path: str + :param default_pattern: The default pattern for an alias. + :type default_pattern: + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPattern + :ivar default_metadata: The default alias path metadata. Applies to the + default path and to any alias path that doesn't have metadata + :vartype default_metadata: + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPathMetadata + """ + + _validation = { + 'default_metadata': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPath]'}, + 'type': {'key': 'type', 'type': 'AliasType'}, + 'default_path': {'key': 'defaultPath', 'type': 'str'}, + 'default_pattern': {'key': 'defaultPattern', 'type': 'AliasPattern'}, + 'default_metadata': {'key': 'defaultMetadata', 'type': 'AliasPathMetadata'}, + } + + def __init__(self, **kwargs): + super(Alias, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.paths = kwargs.get('paths', None) + self.type = kwargs.get('type', None) + self.default_path = kwargs.get('default_path', None) + self.default_pattern = kwargs.get('default_pattern', None) + self.default_metadata = None + + +class AliasPath(Model): + """The type of the paths for alias. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param path: The path of an alias. + :type path: str + :param api_versions: The API versions. + :type api_versions: list[str] + :param pattern: The pattern for an alias path. + :type pattern: + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPattern + :ivar metadata: The metadata of the alias path. If missing, fall back to + the default metadata of the alias. + :vartype metadata: + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPathMetadata + """ + + _validation = { + 'metadata': {'readonly': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'pattern': {'key': 'pattern', 'type': 'AliasPattern'}, + 'metadata': {'key': 'metadata', 'type': 'AliasPathMetadata'}, + } + + def __init__(self, **kwargs): + super(AliasPath, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.api_versions = kwargs.get('api_versions', None) + self.pattern = kwargs.get('pattern', None) + self.metadata = None + + +class AliasPathMetadata(Model): + """AliasPathMetadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the token that the alias path is referring to. + Possible values include: 'NotSpecified', 'Any', 'String', 'Object', + 'Array', 'Integer', 'Number', 'Boolean' + :vartype type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPathTokenType + :ivar attributes: The attributes of the token that the alias path is + referring to. Possible values include: 'None', 'Modifiable' + :vartype attributes: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPathAttributes + """ + + _validation = { + 'type': {'readonly': True}, + 'attributes': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AliasPathMetadata, self).__init__(**kwargs) + self.type = None + self.attributes = None + + +class AliasPattern(Model): + """The type of the pattern for an alias path. + + :param phrase: The alias pattern phrase. + :type phrase: str + :param variable: The alias pattern variable. + :type variable: str + :param type: The type of alias pattern. Possible values include: + 'NotSpecified', 'Extract' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPatternType + """ + + _attribute_map = { + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'variable': {'key': 'variable', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'AliasPatternType'}, + } + + def __init__(self, **kwargs): + super(AliasPattern, self).__init__(**kwargs) + self.phrase = kwargs.get('phrase', None) + self.variable = kwargs.get('variable', None) + self.type = kwargs.get('type', None) + + +class ApiProfile(Model): + """ApiProfile. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar profile_version: The profile version. + :vartype profile_version: str + :ivar api_version: The API version. + :vartype api_version: str + """ + + _validation = { + 'profile_version': {'readonly': True}, + 'api_version': {'readonly': True}, + } + + _attribute_map = { + 'profile_version': {'key': 'profileVersion', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiProfile, self).__init__(**kwargs) + self.profile_version = None + self.api_version = None + + +class BasicDependency(Model): + """Deployment dependency information. + + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BasicDependency, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) + + +class CloudError(Model): + """An error response for a resource management request. + + :param error: + :type error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + 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 DebugSetting(Model): + """The debug setting. + + :param detail_level: Specifies the type of information to log for + debugging. The permitted values are none, requestContent, responseContent, + or both requestContent and responseContent separated by a comma. The + default is none. When setting this value, carefully consider the type of + information you are passing in during deployment. By logging information + about the request or response, you could potentially expose sensitive data + that is retrieved through the deployment operations. + :type detail_level: str + """ + + _attribute_map = { + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = kwargs.get('detail_level', None) + + +class Dependency(Model): + """Deployment dependency information. + + :param depends_on: The list of dependencies. + :type depends_on: + list[~azure.mgmt.resource.resources.v2021_01_01.models.BasicDependency] + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dependency, self).__init__(**kwargs) + self.depends_on = kwargs.get('depends_on', None) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) + + +class Deployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Deployment, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + + +class DeploymentExportResult(Model): + """The deployment export result. . + + :param template: The template content. + :type template: object + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + + +class DeploymentExtended(Model): + """Deployment information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the deployment. + :vartype id: str + :ivar name: The name of the deployment. + :vartype name: str + :ivar type: The type of the deployment. + :vartype type: str + :param location: the location of the deployment. + :type location: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentPropertiesExtended + :param tags: Deployment tags + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + + +class DeploymentExtendedFilter(Model): + """Deployment filter. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class DeploymentOperation(Model): + """Deployment operation information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full deployment operation ID. + :vartype id: str + :ivar operation_id: Deployment operation ID. + :vartype operation_id: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, + } + + def __init__(self, **kwargs): + super(DeploymentOperation, self).__init__(**kwargs) + self.id = None + self.operation_id = None + self.properties = kwargs.get('properties', None) + + +class DeploymentOperationProperties(Model): + """Deployment operation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_operation: The name of the current provisioning + operation. Possible values include: 'NotSpecified', 'Create', 'Delete', + 'Waiting', 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', + 'Read', 'EvaluateDeploymentOutput', 'DeploymentCleanup' + :vartype provisioning_operation: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ProvisioningOperation + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar timestamp: The date and time of the operation. + :vartype timestamp: datetime + :ivar duration: The duration of the operation. + :vartype duration: str + :ivar service_request_id: Deployment operation service request id. + :vartype service_request_id: str + :ivar status_code: Operation status code from the resource provider. This + property may not be set if a response has not yet been received. + :vartype status_code: str + :ivar status_message: Operation status message from the resource provider. + This property is optional. It will only be provided if an error was + received from the resource provider. + :vartype status_message: + ~azure.mgmt.resource.resources.v2021_01_01.models.StatusMessage + :ivar target_resource: The target resource. + :vartype target_resource: + ~azure.mgmt.resource.resources.v2021_01_01.models.TargetResource + :ivar request: The HTTP request message. + :vartype request: + ~azure.mgmt.resource.resources.v2021_01_01.models.HttpMessage + :ivar response: The HTTP response message. + :vartype response: + ~azure.mgmt.resource.resources.v2021_01_01.models.HttpMessage + """ + + _validation = { + 'provisioning_operation': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'duration': {'readonly': True}, + 'service_request_id': {'readonly': True}, + 'status_code': {'readonly': True}, + 'status_message': {'readonly': True}, + 'target_resource': {'readonly': True}, + 'request': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_operation': {'key': 'provisioningOperation', 'type': 'ProvisioningOperation'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'StatusMessage'}, + 'target_resource': {'key': 'targetResource', 'type': 'TargetResource'}, + 'request': {'key': 'request', 'type': 'HttpMessage'}, + 'response': {'key': 'response', 'type': 'HttpMessage'}, + } + + def __init__(self, **kwargs): + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_operation = None + self.provisioning_state = None + self.timestamp = None + self.duration = None + self.service_request_id = None + self.status_code = None + self.status_message = None + self.target_resource = None + self.request = None + self.response = None + + +class DeploymentProperties(Model): + """Deployment properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2021_01_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeployment + :param expression_evaluation_options: Specifies whether template + expressions are evaluated within the scope of the parent template or + nested template. Only applicable to nested templates. If not specified, + default value is outer. + :type expression_evaluation_options: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExpressionEvaluationOptions + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + 'expression_evaluation_options': {'key': 'expressionEvaluationOptions', 'type': 'ExpressionEvaluationOptions'}, + } + + def __init__(self, **kwargs): + super(DeploymentProperties, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) + self.on_error_deployment = kwargs.get('on_error_deployment', None) + self.expression_evaluation_options = kwargs.get('expression_evaluation_options', None) + + +class DeploymentPropertiesExtended(Model): + """Deployment properties with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Denotes the state of provisioning. Possible + values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ProvisioningState + :ivar correlation_id: The correlation ID of the deployment. + :vartype correlation_id: str + :ivar timestamp: The timestamp of the template deployment. + :vartype timestamp: datetime + :ivar duration: The duration of the template deployment. + :vartype duration: str + :ivar outputs: Key/value pairs that represent deployment output. + :vartype outputs: object + :ivar providers: The list of resource providers needed for the deployment. + :vartype providers: + list[~azure.mgmt.resource.resources.v2021_01_01.models.Provider] + :ivar dependencies: The list of deployment dependencies. + :vartype dependencies: + list[~azure.mgmt.resource.resources.v2021_01_01.models.Dependency] + :ivar template_link: The URI referencing the template. + :vartype template_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.TemplateLink + :ivar parameters: Deployment parameters. + :vartype parameters: object + :ivar parameters_link: The URI referencing the parameters. + :vartype parameters_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.ParametersLink + :ivar mode: The deployment mode. Possible values are Incremental and + Complete. Possible values include: 'Incremental', 'Complete' + :vartype mode: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentMode + :ivar debug_setting: The debug setting of the deployment. + :vartype debug_setting: + ~azure.mgmt.resource.resources.v2021_01_01.models.DebugSetting + :ivar on_error_deployment: The deployment on error behavior. + :vartype on_error_deployment: + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeploymentExtended + :ivar template_hash: The hash produced for the template. + :vartype template_hash: str + :ivar output_resources: Array of provisioned resources. + :vartype output_resources: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ResourceReference] + :ivar validated_resources: Array of validated resources. + :vartype validated_resources: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ResourceReference] + :ivar error: The deployment error. + :vartype error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'duration': {'readonly': True}, + 'outputs': {'readonly': True}, + 'providers': {'readonly': True}, + 'dependencies': {'readonly': True}, + 'template_link': {'readonly': True}, + 'parameters': {'readonly': True}, + 'parameters_link': {'readonly': True}, + 'mode': {'readonly': True}, + 'debug_setting': {'readonly': True}, + 'on_error_deployment': {'readonly': True}, + 'template_hash': {'readonly': True}, + 'output_resources': {'readonly': True}, + 'validated_resources': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'providers': {'key': 'providers', 'type': '[Provider]'}, + 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeploymentExtended'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + 'output_resources': {'key': 'outputResources', 'type': '[ResourceReference]'}, + 'validated_resources': {'key': 'validatedResources', 'type': '[ResourceReference]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.correlation_id = None + self.timestamp = None + self.duration = None + self.outputs = None + self.providers = None + self.dependencies = None + self.template_link = None + self.parameters = None + self.parameters_link = None + self.mode = None + self.debug_setting = None + self.on_error_deployment = None + self.template_hash = None + self.output_resources = None + self.validated_resources = None + self.error = None + + +class DeploymentValidateResult(Model): + """Information from validate template deployment response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: The deployment validation error. + :vartype error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + :param properties: The template deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentPropertiesExtended + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, **kwargs): + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = None + self.properties = kwargs.get('properties', None) + + +class DeploymentWhatIf(Model): + """Deployment What-if operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfProperties + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'}, + } + + def __init__(self, **kwargs): + super(DeploymentWhatIf, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + + +class DeploymentWhatIfProperties(DeploymentProperties): + """Deployment What-if properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2021_01_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeployment + :param expression_evaluation_options: Specifies whether template + expressions are evaluated within the scope of the parent template or + nested template. Only applicable to nested templates. If not specified, + default value is outer. + :type expression_evaluation_options: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExpressionEvaluationOptions + :param what_if_settings: Optional What-If operation settings. + :type what_if_settings: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfSettings + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + 'expression_evaluation_options': {'key': 'expressionEvaluationOptions', 'type': 'ExpressionEvaluationOptions'}, + 'what_if_settings': {'key': 'whatIfSettings', 'type': 'DeploymentWhatIfSettings'}, + } + + def __init__(self, **kwargs): + super(DeploymentWhatIfProperties, self).__init__(**kwargs) + self.what_if_settings = kwargs.get('what_if_settings', None) + + +class DeploymentWhatIfSettings(Model): + """Deployment What-If operation settings. + + :param result_format: The format of the What-If results. Possible values + include: 'ResourceIdOnly', 'FullResourcePayloads' + :type result_format: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfResultFormat + """ + + _attribute_map = { + 'result_format': {'key': 'resultFormat', 'type': 'WhatIfResultFormat'}, + } + + def __init__(self, **kwargs): + super(DeploymentWhatIfSettings, self).__init__(**kwargs) + self.result_format = kwargs.get('result_format', None) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.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.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ExportTemplateRequest(Model): + """Export resource group template request parameters. + + :param resources: The IDs of the resources to filter the export by. To + export all resources, supply an array with single entry '*'. + :type resources: list[str] + :param options: The export template options. A CSV-formatted list + containing zero or more of the following: 'IncludeParameterDefaultValue', + 'IncludeComments', 'SkipResourceNameParameterization', + 'SkipAllParameterization' + :type options: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'options': {'key': 'options', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.options = kwargs.get('options', None) + + +class ExpressionEvaluationOptions(Model): + """Specifies whether template expressions are evaluated within the scope of + the parent template or nested template. + + :param scope: The scope to be used for evaluation of parameters, variables + and functions in a nested template. Possible values include: + 'NotSpecified', 'Outer', 'Inner' + :type scope: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ExpressionEvaluationOptionsScopeType + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressionEvaluationOptions, self).__init__(**kwargs) + self.scope = kwargs.get('scope', None) + + +class ExtendedLocation(Model): + """Resource extended location. + + :param type: The extended location type. Possible values include: + 'EdgeZone' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ExtendedLocationType + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class Resource(Model): + """Specified resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.extended_location = kwargs.get('extended_location', None) + self.tags = kwargs.get('tags', None) + + +class GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2021_01_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2021_01_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2021_01_01.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, **kwargs): + super(GenericResource, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.properties = kwargs.get('properties', None) + self.kind = kwargs.get('kind', None) + self.managed_by = kwargs.get('managed_by', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) + + +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2021_01_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2021_01_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2021_01_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + +class GenericResourceFilter(Model): + """Resource filter. + + :param resource_type: The resource type. + :type resource_type: str + :param tagname: The tag name. + :type tagname: str + :param tagvalue: The tag value. + :type tagvalue: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'tagname': {'key': 'tagname', 'type': 'str'}, + 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.tagname = kwargs.get('tagname', None) + self.tagvalue = kwargs.get('tagvalue', None) + + +class HttpMessage(Model): + """HTTP message. + + :param content: HTTP message content. + :type content: object + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(HttpMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the resource. The user identity dictionary key references will be ARM + resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.resource.resources.v2021_01_01.models.IdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'}, + } + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class IdentityUserAssignedIdentitiesValue(Model): + """IdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class OnErrorDeployment(Model): + """Deployment on error behavior. + + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OnErrorDeployment, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.deployment_name = kwargs.get('deployment_name', None) + + +class OnErrorDeploymentExtended(Model): + """Deployment on error behavior with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning for the on error + deployment. + :vartype provisioning_state: str + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OnErrorDeploymentExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.type = kwargs.get('type', None) + self.deployment_name = kwargs.get('deployment_name', None) + + +class Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.resources.v2021_01_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ParametersLink(Model): + """Entity representing the reference to the deployment parameters. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ParametersLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) + + +class Plan(Model): + """Plan for the resource. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The offer ID. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: The plan's version. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.version = kwargs.get('version', None) + + +class Provider(Model): + """Resource provider information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The provider ID. + :vartype id: str + :param namespace: The namespace of the resource provider. + :type namespace: str + :ivar registration_state: The registration state of the resource provider. + :vartype registration_state: str + :ivar registration_policy: The registration policy of the resource + provider. + :vartype registration_policy: str + :ivar resource_types: The collection of provider resource types. + :vartype resource_types: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ProviderResourceType] + """ + + _validation = { + 'id': {'readonly': True}, + 'registration_state': {'readonly': True}, + 'registration_policy': {'readonly': True}, + 'resource_types': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'registration_state': {'key': 'registrationState', 'type': 'str'}, + 'registration_policy': {'key': 'registrationPolicy', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, + } + + def __init__(self, **kwargs): + super(Provider, self).__init__(**kwargs) + self.id = None + self.namespace = kwargs.get('namespace', None) + self.registration_state = None + self.registration_policy = None + self.resource_types = None + + +class ProviderExtendedLocation(Model): + """The provider extended location. . + + :param location: The azure location. + :type location: str + :param type: The extended location type. + :type type: str + :param extended_locations: The extended locations for the azure location. + :type extended_locations: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ProviderExtendedLocation, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.type = kwargs.get('type', None) + self.extended_locations = kwargs.get('extended_locations', None) + + +class ProviderResourceType(Model): + """Resource type managed by the resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param resource_type: The resource type. + :type resource_type: str + :param locations: The collection of locations where this resource type can + be created. + :type locations: list[str] + :param location_mappings: The location mappings that are supported by this + resource type. + :type location_mappings: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ProviderExtendedLocation] + :param aliases: The aliases that are supported by this resource type. + :type aliases: + list[~azure.mgmt.resource.resources.v2021_01_01.models.Alias] + :param api_versions: The API version. + :type api_versions: list[str] + :ivar default_api_version: The default API version. + :vartype default_api_version: str + :ivar api_profiles: The API profiles for the resource provider. + :vartype api_profiles: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ApiProfile] + :param capabilities: The additional capabilities offered by this resource + type. + :type capabilities: str + :param properties: The properties. + :type properties: dict[str, str] + """ + + _validation = { + 'default_api_version': {'readonly': True}, + 'api_profiles': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_mappings': {'key': 'locationMappings', 'type': '[ProviderExtendedLocation]'}, + 'aliases': {'key': 'aliases', 'type': '[Alias]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'api_profiles': {'key': 'apiProfiles', 'type': '[ApiProfile]'}, + 'capabilities': {'key': 'capabilities', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.locations = kwargs.get('locations', None) + self.location_mappings = kwargs.get('location_mappings', None) + self.aliases = kwargs.get('aliases', None) + self.api_versions = kwargs.get('api_versions', None) + self.default_api_version = None + self.api_profiles = None + self.capabilities = kwargs.get('capabilities', None) + self.properties = kwargs.get('properties', None) + + +class ProviderResourceTypeListResult(Model): + """List of resource types of a resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: An array of resource types. + :type value: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ProviderResourceType] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProviderResourceType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProviderResourceTypeListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ResourceGroup(Model): + """Resource group information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the resource group. + :vartype id: str + :ivar name: The name of the resource group. + :vartype name: str + :ivar type: The type of the resource group. + :vartype type: str + :param properties: The resource group properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroupProperties + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It must be one of + the supported Azure locations. + :type location: str + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceGroup, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) + self.location = kwargs.get('location', None) + self.managed_by = kwargs.get('managed_by', None) + self.tags = kwargs.get('tags', None) + + +class ResourceGroupExportResult(Model): + """Resource group export result. + + :param template: The template content. + :type template: object + :param error: The template export error. + :type error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.error = kwargs.get('error', None) + + +class ResourceGroupFilter(Model): + """Resource group filter. + + :param tag_name: The tag name. + :type tag_name: str + :param tag_value: The tag value. + :type tag_value: str + """ + + _attribute_map = { + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = kwargs.get('tag_name', None) + self.tag_value = kwargs.get('tag_value', None) + + +class ResourceGroupPatchable(Model): + """Resource group information. + + :param name: The name of the resource group. + :type name: str + :param properties: The resource group properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroupProperties + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupPatchable, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.managed_by = kwargs.get('managed_by', None) + self.tags = kwargs.get('tags', None) + + +class ResourceGroupProperties(Model): + """The resource group properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupProperties, self).__init__(**kwargs) + self.provisioning_state = None + + +class ResourceProviderOperationDisplayProperties(Model): + """Resource provider operation's display properties. + + :param publisher: Operation description. + :type publisher: str + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Resource provider operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceReference(Model): + """The resource Id model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified resource Id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceReference, self).__init__(**kwargs) + self.id = None + + +class ResourcesMoveInfo(Model): + """Parameters of move resources. + + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.target_resource_group = kwargs.get('target_resource_group', None) + + +class ScopedDeployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ScopedDeployment, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + + +class ScopedDeploymentWhatIf(Model): + """Deployment What-if operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfProperties + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'}, + } + + def __init__(self, **kwargs): + super(ScopedDeploymentWhatIf, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + + +class Sku(Model): + """SKU for the resource. + + :param name: The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + :param size: The SKU size. + :type size: str + :param family: The SKU family. + :type family: str + :param model: The SKU model. + :type model: str + :param capacity: The SKU capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.model = kwargs.get('model', None) + self.capacity = kwargs.get('capacity', None) + + +class StatusMessage(Model): + """Operation status message object. + + :param status: Status of the deployment operation. + :type status: str + :param error: The error reported by the operation. + :type error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(StatusMessage, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + +class SubResource(Model): + """Sub-resource. + + :param id: Resource ID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class TagCount(Model): + """Tag count. + + :param type: Type of count. + :type type: str + :param value: Value of count. + :type value: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(TagCount, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) + + +class TagDetails(Model): + """Tag details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag name ID. + :vartype id: str + :param tag_name: The tag name. + :type tag_name: str + :param count: The total number of resources that use the resource tag. + When a tag is initially created and has no associated resources, the value + is 0. + :type count: ~azure.mgmt.resource.resources.v2021_01_01.models.TagCount + :param values: The list of tag values. + :type values: + list[~azure.mgmt.resource.resources.v2021_01_01.models.TagValue] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + 'values': {'key': 'values', 'type': '[TagValue]'}, + } + + def __init__(self, **kwargs): + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = kwargs.get('tag_name', None) + self.count = kwargs.get('count', None) + self.values = kwargs.get('values', None) + + +class Tags(Model): + """A dictionary of name and value pairs. + + :param tags: + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Tags, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class TagsPatchResource(Model): + """Wrapper resource for tags patch API request only. + + :param operation: The operation type for the patch API. Possible values + include: 'Replace', 'Merge', 'Delete' + :type operation: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.TagsPatchOperation + :param properties: The set of tags. + :type properties: ~azure.mgmt.resource.resources.v2021_01_01.models.Tags + """ + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Tags'}, + } + + def __init__(self, **kwargs): + super(TagsPatchResource, self).__init__(**kwargs) + self.operation = kwargs.get('operation', None) + self.properties = kwargs.get('properties', None) + + +class TagsResource(Model): + """Wrapper resource for tags API requests and responses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the tags wrapper resource. + :vartype id: str + :ivar name: The name of the tags wrapper resource. + :vartype name: str + :ivar type: The type of the tags wrapper resource. + :vartype type: str + :param properties: Required. The set of tags. + :type properties: ~azure.mgmt.resource.resources.v2021_01_01.models.Tags + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Tags'}, + } + + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) + + +class TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag value ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2021_01_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, **kwargs): + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = kwargs.get('tag_value', None) + self.count = kwargs.get('count', None) + + +class TargetResource(Model): + """Target resource. + + :param id: The ID of the resource. + :type id: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_type: The type of the resource. + :type resource_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TargetResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_type = kwargs.get('resource_type', None) + + +class TemplateHashResult(Model): + """Result of the request to calculate template hash. It contains a string of + minified template and its hash. + + :param minified_template: The minified template string. + :type minified_template: str + :param template_hash: The template hash. + :type template_hash: str + """ + + _attribute_map = { + 'minified_template': {'key': 'minifiedTemplate', 'type': 'str'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TemplateHashResult, self).__init__(**kwargs) + self.minified_template = kwargs.get('minified_template', None) + self.template_hash = kwargs.get('template_hash', None) + + +class TemplateLink(Model): + """Entity representing the reference to the template. + + :param uri: The URI of the template to deploy. Use either the uri or id + property, but not both. + :type uri: str + :param id: The resource id of a Template Spec. Use either the id or uri + property, but not both. + :type id: str + :param relative_path: The relativePath property can be used to deploy a + linked template at a location relative to the parent. If the parent + template was linked with a TemplateSpec, this will reference an artifact + in the TemplateSpec. If the parent was linked with a URI, the child + deployment will be a combination of the parent and relativePath URIs + :type relative_path: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + :param query_string: The query string (for example, a SAS token) to be + used with the templateLink URI. + :type query_string: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TemplateLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.id = kwargs.get('id', None) + self.relative_path = kwargs.get('relative_path', None) + self.content_version = kwargs.get('content_version', None) + self.query_string = kwargs.get('query_string', None) + + +class WhatIfChange(Model): + """Information about a single resource change predicted by What-If operation. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. Resource ID + :type resource_id: str + :param change_type: Required. Type of change that will be made to the + resource when the deployment is executed. Possible values include: + 'Create', 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify', + 'Unsupported' + :type change_type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ChangeType + :param unsupported_reason: The explanation about why the resource is + unsupported by What-If. + :type unsupported_reason: str + :param before: The snapshot of the resource before the deployment is + executed. + :type before: object + :param after: The predicted snapshot of the resource after the deployment + is executed. + :type after: object + :param delta: The predicted changes to resource properties. + :type delta: + list[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfPropertyChange] + """ + + _validation = { + 'resource_id': {'required': True}, + 'change_type': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'change_type': {'key': 'changeType', 'type': 'ChangeType'}, + 'unsupported_reason': {'key': 'unsupportedReason', 'type': 'str'}, + 'before': {'key': 'before', 'type': 'object'}, + 'after': {'key': 'after', 'type': 'object'}, + 'delta': {'key': 'delta', 'type': '[WhatIfPropertyChange]'}, + } + + def __init__(self, **kwargs): + super(WhatIfChange, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.change_type = kwargs.get('change_type', None) + self.unsupported_reason = kwargs.get('unsupported_reason', None) + self.before = kwargs.get('before', None) + self.after = kwargs.get('after', None) + self.delta = kwargs.get('delta', None) + + +class WhatIfOperationResult(Model): + """Result of the What-If operation. Contains a list of predicted changes and a + URL link to get to the next set of results. + + :param status: Status of the What-If operation. + :type status: str + :param changes: List of resource changes predicted by What-If operation. + :type changes: + list[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfChange] + :param error: Error when What-If operation fails. + :type error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'changes': {'key': 'properties.changes', 'type': '[WhatIfChange]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(WhatIfOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.changes = kwargs.get('changes', None) + self.error = kwargs.get('error', None) + + +class WhatIfPropertyChange(Model): + """The predicted change to the resource property. + + All required parameters must be populated in order to send to Azure. + + :param path: Required. The path of the property. + :type path: str + :param property_change_type: Required. The type of property change. + Possible values include: 'Create', 'Delete', 'Modify', 'Array', 'NoEffect' + :type property_change_type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.PropertyChangeType + :param before: The value of the property before the deployment is + executed. + :type before: object + :param after: The value of the property after the deployment is executed. + :type after: object + :param children: Nested property changes. + :type children: + list[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfPropertyChange] + """ + + _validation = { + 'path': {'required': True}, + 'property_change_type': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'property_change_type': {'key': 'propertyChangeType', 'type': 'PropertyChangeType'}, + 'before': {'key': 'before', 'type': 'object'}, + 'after': {'key': 'after', 'type': 'object'}, + 'children': {'key': 'children', 'type': '[WhatIfPropertyChange]'}, + } + + def __init__(self, **kwargs): + super(WhatIfPropertyChange, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.property_change_type = kwargs.get('property_change_type', None) + self.before = kwargs.get('before', None) + self.after = kwargs.get('after', None) + self.children = kwargs.get('children', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models_py3.py new file mode 100644 index 000000000000..0cea4895ab0d --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models_py3.py @@ -0,0 +1,2352 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Alias(Model): + """The alias type. . + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2021_01_01.models.AliasPath] + :param type: The type of the alias. Possible values include: + 'NotSpecified', 'PlainText', 'Mask' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasType + :param default_path: The default path for an alias. + :type default_path: str + :param default_pattern: The default pattern for an alias. + :type default_pattern: + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPattern + :ivar default_metadata: The default alias path metadata. Applies to the + default path and to any alias path that doesn't have metadata + :vartype default_metadata: + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPathMetadata + """ + + _validation = { + 'default_metadata': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPath]'}, + 'type': {'key': 'type', 'type': 'AliasType'}, + 'default_path': {'key': 'defaultPath', 'type': 'str'}, + 'default_pattern': {'key': 'defaultPattern', 'type': 'AliasPattern'}, + 'default_metadata': {'key': 'defaultMetadata', 'type': 'AliasPathMetadata'}, + } + + def __init__(self, *, name: str=None, paths=None, type=None, default_path: str=None, default_pattern=None, **kwargs) -> None: + super(Alias, self).__init__(**kwargs) + self.name = name + self.paths = paths + self.type = type + self.default_path = default_path + self.default_pattern = default_pattern + self.default_metadata = None + + +class AliasPath(Model): + """The type of the paths for alias. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param path: The path of an alias. + :type path: str + :param api_versions: The API versions. + :type api_versions: list[str] + :param pattern: The pattern for an alias path. + :type pattern: + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPattern + :ivar metadata: The metadata of the alias path. If missing, fall back to + the default metadata of the alias. + :vartype metadata: + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPathMetadata + """ + + _validation = { + 'metadata': {'readonly': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'pattern': {'key': 'pattern', 'type': 'AliasPattern'}, + 'metadata': {'key': 'metadata', 'type': 'AliasPathMetadata'}, + } + + def __init__(self, *, path: str=None, api_versions=None, pattern=None, **kwargs) -> None: + super(AliasPath, self).__init__(**kwargs) + self.path = path + self.api_versions = api_versions + self.pattern = pattern + self.metadata = None + + +class AliasPathMetadata(Model): + """AliasPathMetadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the token that the alias path is referring to. + Possible values include: 'NotSpecified', 'Any', 'String', 'Object', + 'Array', 'Integer', 'Number', 'Boolean' + :vartype type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPathTokenType + :ivar attributes: The attributes of the token that the alias path is + referring to. Possible values include: 'None', 'Modifiable' + :vartype attributes: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPathAttributes + """ + + _validation = { + 'type': {'readonly': True}, + 'attributes': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AliasPathMetadata, self).__init__(**kwargs) + self.type = None + self.attributes = None + + +class AliasPattern(Model): + """The type of the pattern for an alias path. + + :param phrase: The alias pattern phrase. + :type phrase: str + :param variable: The alias pattern variable. + :type variable: str + :param type: The type of alias pattern. Possible values include: + 'NotSpecified', 'Extract' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.AliasPatternType + """ + + _attribute_map = { + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'variable': {'key': 'variable', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'AliasPatternType'}, + } + + def __init__(self, *, phrase: str=None, variable: str=None, type=None, **kwargs) -> None: + super(AliasPattern, self).__init__(**kwargs) + self.phrase = phrase + self.variable = variable + self.type = type + + +class ApiProfile(Model): + """ApiProfile. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar profile_version: The profile version. + :vartype profile_version: str + :ivar api_version: The API version. + :vartype api_version: str + """ + + _validation = { + 'profile_version': {'readonly': True}, + 'api_version': {'readonly': True}, + } + + _attribute_map = { + 'profile_version': {'key': 'profileVersion', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApiProfile, self).__init__(**kwargs) + self.profile_version = None + self.api_version = None + + +class BasicDependency(Model): + """Deployment dependency information. + + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(BasicDependency, self).__init__(**kwargs) + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name + + +class CloudError(Model): + """An error response for a resource management request. + + :param error: + :type error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + 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 DebugSetting(Model): + """The debug setting. + + :param detail_level: Specifies the type of information to log for + debugging. The permitted values are none, requestContent, responseContent, + or both requestContent and responseContent separated by a comma. The + default is none. When setting this value, carefully consider the type of + information you are passing in during deployment. By logging information + about the request or response, you could potentially expose sensitive data + that is retrieved through the deployment operations. + :type detail_level: str + """ + + _attribute_map = { + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + } + + def __init__(self, *, detail_level: str=None, **kwargs) -> None: + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = detail_level + + +class Dependency(Model): + """Deployment dependency information. + + :param depends_on: The list of dependencies. + :type depends_on: + list[~azure.mgmt.resource.resources.v2021_01_01.models.BasicDependency] + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, depends_on=None, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(Dependency, self).__init__(**kwargs) + self.depends_on = depends_on + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name + + +class Deployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, properties, location: str=None, tags=None, **kwargs) -> None: + super(Deployment, self).__init__(**kwargs) + self.location = location + self.properties = properties + self.tags = tags + + +class DeploymentExportResult(Model): + """The deployment export result. . + + :param template: The template content. + :type template: object + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, *, template=None, **kwargs) -> None: + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = template + + +class DeploymentExtended(Model): + """Deployment information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the deployment. + :vartype id: str + :ivar name: The name of the deployment. + :vartype name: str + :ivar type: The type of the deployment. + :vartype type: str + :param location: the location of the deployment. + :type location: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentPropertiesExtended + :param tags: Deployment tags + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, properties=None, tags=None, **kwargs) -> None: + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.properties = properties + self.tags = tags + + +class DeploymentExtendedFilter(Model): + """Deployment filter. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state: str=None, **kwargs) -> None: + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + + +class DeploymentOperation(Model): + """Deployment operation information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full deployment operation ID. + :vartype id: str + :ivar operation_id: Deployment operation ID. + :vartype operation_id: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeploymentOperation, self).__init__(**kwargs) + self.id = None + self.operation_id = None + self.properties = properties + + +class DeploymentOperationProperties(Model): + """Deployment operation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_operation: The name of the current provisioning + operation. Possible values include: 'NotSpecified', 'Create', 'Delete', + 'Waiting', 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', + 'Read', 'EvaluateDeploymentOutput', 'DeploymentCleanup' + :vartype provisioning_operation: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ProvisioningOperation + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar timestamp: The date and time of the operation. + :vartype timestamp: datetime + :ivar duration: The duration of the operation. + :vartype duration: str + :ivar service_request_id: Deployment operation service request id. + :vartype service_request_id: str + :ivar status_code: Operation status code from the resource provider. This + property may not be set if a response has not yet been received. + :vartype status_code: str + :ivar status_message: Operation status message from the resource provider. + This property is optional. It will only be provided if an error was + received from the resource provider. + :vartype status_message: + ~azure.mgmt.resource.resources.v2021_01_01.models.StatusMessage + :ivar target_resource: The target resource. + :vartype target_resource: + ~azure.mgmt.resource.resources.v2021_01_01.models.TargetResource + :ivar request: The HTTP request message. + :vartype request: + ~azure.mgmt.resource.resources.v2021_01_01.models.HttpMessage + :ivar response: The HTTP response message. + :vartype response: + ~azure.mgmt.resource.resources.v2021_01_01.models.HttpMessage + """ + + _validation = { + 'provisioning_operation': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'duration': {'readonly': True}, + 'service_request_id': {'readonly': True}, + 'status_code': {'readonly': True}, + 'status_message': {'readonly': True}, + 'target_resource': {'readonly': True}, + 'request': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_operation': {'key': 'provisioningOperation', 'type': 'ProvisioningOperation'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'StatusMessage'}, + 'target_resource': {'key': 'targetResource', 'type': 'TargetResource'}, + 'request': {'key': 'request', 'type': 'HttpMessage'}, + 'response': {'key': 'response', 'type': 'HttpMessage'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_operation = None + self.provisioning_state = None + self.timestamp = None + self.duration = None + self.service_request_id = None + self.status_code = None + self.status_message = None + self.target_resource = None + self.request = None + self.response = None + + +class DeploymentProperties(Model): + """Deployment properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2021_01_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeployment + :param expression_evaluation_options: Specifies whether template + expressions are evaluated within the scope of the parent template or + nested template. Only applicable to nested templates. If not specified, + default value is outer. + :type expression_evaluation_options: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExpressionEvaluationOptions + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + 'expression_evaluation_options': {'key': 'expressionEvaluationOptions', 'type': 'ExpressionEvaluationOptions'}, + } + + def __init__(self, *, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None, on_error_deployment=None, expression_evaluation_options=None, **kwargs) -> None: + super(DeploymentProperties, self).__init__(**kwargs) + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting + self.on_error_deployment = on_error_deployment + self.expression_evaluation_options = expression_evaluation_options + + +class DeploymentPropertiesExtended(Model): + """Deployment properties with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Denotes the state of provisioning. Possible + values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ProvisioningState + :ivar correlation_id: The correlation ID of the deployment. + :vartype correlation_id: str + :ivar timestamp: The timestamp of the template deployment. + :vartype timestamp: datetime + :ivar duration: The duration of the template deployment. + :vartype duration: str + :ivar outputs: Key/value pairs that represent deployment output. + :vartype outputs: object + :ivar providers: The list of resource providers needed for the deployment. + :vartype providers: + list[~azure.mgmt.resource.resources.v2021_01_01.models.Provider] + :ivar dependencies: The list of deployment dependencies. + :vartype dependencies: + list[~azure.mgmt.resource.resources.v2021_01_01.models.Dependency] + :ivar template_link: The URI referencing the template. + :vartype template_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.TemplateLink + :ivar parameters: Deployment parameters. + :vartype parameters: object + :ivar parameters_link: The URI referencing the parameters. + :vartype parameters_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.ParametersLink + :ivar mode: The deployment mode. Possible values are Incremental and + Complete. Possible values include: 'Incremental', 'Complete' + :vartype mode: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentMode + :ivar debug_setting: The debug setting of the deployment. + :vartype debug_setting: + ~azure.mgmt.resource.resources.v2021_01_01.models.DebugSetting + :ivar on_error_deployment: The deployment on error behavior. + :vartype on_error_deployment: + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeploymentExtended + :ivar template_hash: The hash produced for the template. + :vartype template_hash: str + :ivar output_resources: Array of provisioned resources. + :vartype output_resources: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ResourceReference] + :ivar validated_resources: Array of validated resources. + :vartype validated_resources: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ResourceReference] + :ivar error: The deployment error. + :vartype error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'duration': {'readonly': True}, + 'outputs': {'readonly': True}, + 'providers': {'readonly': True}, + 'dependencies': {'readonly': True}, + 'template_link': {'readonly': True}, + 'parameters': {'readonly': True}, + 'parameters_link': {'readonly': True}, + 'mode': {'readonly': True}, + 'debug_setting': {'readonly': True}, + 'on_error_deployment': {'readonly': True}, + 'template_hash': {'readonly': True}, + 'output_resources': {'readonly': True}, + 'validated_resources': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'providers': {'key': 'providers', 'type': '[Provider]'}, + 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeploymentExtended'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + 'output_resources': {'key': 'outputResources', 'type': '[ResourceReference]'}, + 'validated_resources': {'key': 'validatedResources', 'type': '[ResourceReference]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.correlation_id = None + self.timestamp = None + self.duration = None + self.outputs = None + self.providers = None + self.dependencies = None + self.template_link = None + self.parameters = None + self.parameters_link = None + self.mode = None + self.debug_setting = None + self.on_error_deployment = None + self.template_hash = None + self.output_resources = None + self.validated_resources = None + self.error = None + + +class DeploymentValidateResult(Model): + """Information from validate template deployment response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: The deployment validation error. + :vartype error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + :param properties: The template deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentPropertiesExtended + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = None + self.properties = properties + + +class DeploymentWhatIf(Model): + """Deployment What-if operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfProperties + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'}, + } + + def __init__(self, *, properties, location: str=None, **kwargs) -> None: + super(DeploymentWhatIf, self).__init__(**kwargs) + self.location = location + self.properties = properties + + +class DeploymentWhatIfProperties(DeploymentProperties): + """Deployment What-if properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2021_01_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2021_01_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeployment + :param expression_evaluation_options: Specifies whether template + expressions are evaluated within the scope of the parent template or + nested template. Only applicable to nested templates. If not specified, + default value is outer. + :type expression_evaluation_options: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExpressionEvaluationOptions + :param what_if_settings: Optional What-If operation settings. + :type what_if_settings: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfSettings + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + 'expression_evaluation_options': {'key': 'expressionEvaluationOptions', 'type': 'ExpressionEvaluationOptions'}, + 'what_if_settings': {'key': 'whatIfSettings', 'type': 'DeploymentWhatIfSettings'}, + } + + def __init__(self, *, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None, on_error_deployment=None, expression_evaluation_options=None, what_if_settings=None, **kwargs) -> None: + super(DeploymentWhatIfProperties, self).__init__(template=template, template_link=template_link, parameters=parameters, parameters_link=parameters_link, mode=mode, debug_setting=debug_setting, on_error_deployment=on_error_deployment, expression_evaluation_options=expression_evaluation_options, **kwargs) + self.what_if_settings = what_if_settings + + +class DeploymentWhatIfSettings(Model): + """Deployment What-If operation settings. + + :param result_format: The format of the What-If results. Possible values + include: 'ResourceIdOnly', 'FullResourcePayloads' + :type result_format: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfResultFormat + """ + + _attribute_map = { + 'result_format': {'key': 'resultFormat', 'type': 'WhatIfResultFormat'}, + } + + def __init__(self, *, result_format=None, **kwargs) -> None: + super(DeploymentWhatIfSettings, self).__init__(**kwargs) + self.result_format = result_format + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.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.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ExportTemplateRequest(Model): + """Export resource group template request parameters. + + :param resources: The IDs of the resources to filter the export by. To + export all resources, supply an array with single entry '*'. + :type resources: list[str] + :param options: The export template options. A CSV-formatted list + containing zero or more of the following: 'IncludeParameterDefaultValue', + 'IncludeComments', 'SkipResourceNameParameterization', + 'SkipAllParameterization' + :type options: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'options': {'key': 'options', 'type': 'str'}, + } + + def __init__(self, *, resources=None, options: str=None, **kwargs) -> None: + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = resources + self.options = options + + +class ExpressionEvaluationOptions(Model): + """Specifies whether template expressions are evaluated within the scope of + the parent template or nested template. + + :param scope: The scope to be used for evaluation of parameters, variables + and functions in a nested template. Possible values include: + 'NotSpecified', 'Outer', 'Inner' + :type scope: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ExpressionEvaluationOptionsScopeType + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'str'}, + } + + def __init__(self, *, scope=None, **kwargs) -> None: + super(ExpressionEvaluationOptions, self).__init__(**kwargs) + self.scope = scope + + +class ExtendedLocation(Model): + """Resource extended location. + + :param type: The extended location type. Possible values include: + 'EdgeZone' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ExtendedLocationType + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type=None, name: str=None, **kwargs) -> None: + super(ExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name + + +class Resource(Model): + """Specified resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, extended_location=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.extended_location = extended_location + self.tags = tags + + +class GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2021_01_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2021_01_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2021_01_01.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, *, location: str=None, extended_location=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResource, self).__init__(location=location, extended_location=extended_location, tags=tags, **kwargs) + self.plan = plan + self.properties = properties + self.kind = kind + self.managed_by = managed_by + self.sku = sku + self.identity = identity + + +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_01_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2021_01_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2021_01_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2021_01_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, extended_location=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, extended_location=extended_location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + +class GenericResourceFilter(Model): + """Resource filter. + + :param resource_type: The resource type. + :type resource_type: str + :param tagname: The tag name. + :type tagname: str + :param tagvalue: The tag value. + :type tagvalue: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'tagname': {'key': 'tagname', 'type': 'str'}, + 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, + } + + def __init__(self, *, resource_type: str=None, tagname: str=None, tagvalue: str=None, **kwargs) -> None: + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = resource_type + self.tagname = tagname + self.tagvalue = tagvalue + + +class HttpMessage(Model): + """HTTP message. + + :param content: HTTP message content. + :type content: object + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'object'}, + } + + def __init__(self, *, content=None, **kwargs) -> None: + super(HttpMessage, self).__init__(**kwargs) + self.content = content + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the resource. The user identity dictionary key references will be ARM + resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.resource.resources.v2021_01_01.models.IdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'}, + } + + def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class IdentityUserAssignedIdentitiesValue(Model): + """IdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class OnErrorDeployment(Model): + """Deployment on error behavior. + + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, *, type=None, deployment_name: str=None, **kwargs) -> None: + super(OnErrorDeployment, self).__init__(**kwargs) + self.type = type + self.deployment_name = deployment_name + + +class OnErrorDeploymentExtended(Model): + """Deployment on error behavior with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning for the on error + deployment. + :vartype provisioning_state: str + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, *, type=None, deployment_name: str=None, **kwargs) -> None: + super(OnErrorDeploymentExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.type = type + self.deployment_name = deployment_name + + +class Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.resources.v2021_01_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ParametersLink(Model): + """Entity representing the reference to the deployment parameters. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(ParametersLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version + + +class Plan(Model): + """Plan for the resource. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The offer ID. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: The plan's version. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, version: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version + + +class Provider(Model): + """Resource provider information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The provider ID. + :vartype id: str + :param namespace: The namespace of the resource provider. + :type namespace: str + :ivar registration_state: The registration state of the resource provider. + :vartype registration_state: str + :ivar registration_policy: The registration policy of the resource + provider. + :vartype registration_policy: str + :ivar resource_types: The collection of provider resource types. + :vartype resource_types: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ProviderResourceType] + """ + + _validation = { + 'id': {'readonly': True}, + 'registration_state': {'readonly': True}, + 'registration_policy': {'readonly': True}, + 'resource_types': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'registration_state': {'key': 'registrationState', 'type': 'str'}, + 'registration_policy': {'key': 'registrationPolicy', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, + } + + def __init__(self, *, namespace: str=None, **kwargs) -> None: + super(Provider, self).__init__(**kwargs) + self.id = None + self.namespace = namespace + self.registration_state = None + self.registration_policy = None + self.resource_types = None + + +class ProviderExtendedLocation(Model): + """The provider extended location. . + + :param location: The azure location. + :type location: str + :param type: The extended location type. + :type type: str + :param extended_locations: The extended locations for the azure location. + :type extended_locations: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, type: str=None, extended_locations=None, **kwargs) -> None: + super(ProviderExtendedLocation, self).__init__(**kwargs) + self.location = location + self.type = type + self.extended_locations = extended_locations + + +class ProviderResourceType(Model): + """Resource type managed by the resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param resource_type: The resource type. + :type resource_type: str + :param locations: The collection of locations where this resource type can + be created. + :type locations: list[str] + :param location_mappings: The location mappings that are supported by this + resource type. + :type location_mappings: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ProviderExtendedLocation] + :param aliases: The aliases that are supported by this resource type. + :type aliases: + list[~azure.mgmt.resource.resources.v2021_01_01.models.Alias] + :param api_versions: The API version. + :type api_versions: list[str] + :ivar default_api_version: The default API version. + :vartype default_api_version: str + :ivar api_profiles: The API profiles for the resource provider. + :vartype api_profiles: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ApiProfile] + :param capabilities: The additional capabilities offered by this resource + type. + :type capabilities: str + :param properties: The properties. + :type properties: dict[str, str] + """ + + _validation = { + 'default_api_version': {'readonly': True}, + 'api_profiles': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_mappings': {'key': 'locationMappings', 'type': '[ProviderExtendedLocation]'}, + 'aliases': {'key': 'aliases', 'type': '[Alias]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'api_profiles': {'key': 'apiProfiles', 'type': '[ApiProfile]'}, + 'capabilities': {'key': 'capabilities', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, resource_type: str=None, locations=None, location_mappings=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = resource_type + self.locations = locations + self.location_mappings = location_mappings + self.aliases = aliases + self.api_versions = api_versions + self.default_api_version = None + self.api_profiles = None + self.capabilities = capabilities + self.properties = properties + + +class ProviderResourceTypeListResult(Model): + """List of resource types of a resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: An array of resource types. + :type value: + list[~azure.mgmt.resource.resources.v2021_01_01.models.ProviderResourceType] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProviderResourceType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ProviderResourceTypeListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceGroup(Model): + """Resource group information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the resource group. + :vartype id: str + :ivar name: The name of the resource group. + :vartype name: str + :ivar type: The type of the resource group. + :vartype type: str + :param properties: The resource group properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroupProperties + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It must be one of + the supported Azure locations. + :type location: str + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + super(ResourceGroup, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + self.location = location + self.managed_by = managed_by + self.tags = tags + + +class ResourceGroupExportResult(Model): + """Resource group export result. + + :param template: The template content. + :type template: object + :param error: The template export error. + :type error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, template=None, error=None, **kwargs) -> None: + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = template + self.error = error + + +class ResourceGroupFilter(Model): + """Resource group filter. + + :param tag_name: The tag name. + :type tag_name: str + :param tag_value: The tag value. + :type tag_value: str + """ + + _attribute_map = { + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + } + + def __init__(self, *, tag_name: str=None, tag_value: str=None, **kwargs) -> None: + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = tag_name + self.tag_value = tag_value + + +class ResourceGroupPatchable(Model): + """Resource group information. + + :param name: The name of the resource group. + :type name: str + :param properties: The resource group properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroupProperties + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str=None, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + super(ResourceGroupPatchable, self).__init__(**kwargs) + self.name = name + self.properties = properties + self.managed_by = managed_by + self.tags = tags + + +class ResourceGroupProperties(Model): + """The resource group properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceGroupProperties, self).__init__(**kwargs) + self.provisioning_state = None + + +class ResourceProviderOperationDisplayProperties(Model): + """Resource provider operation's display properties. + + :param publisher: Operation description. + :type publisher: str + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Resource provider operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, publisher: str=None, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = publisher + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ResourceReference(Model): + """The resource Id model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified resource Id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceReference, self).__init__(**kwargs) + self.id = None + + +class ResourcesMoveInfo(Model): + """Parameters of move resources. + + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + } + + def __init__(self, *, resources=None, target_resource_group: str=None, **kwargs) -> None: + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = resources + self.target_resource_group = target_resource_group + + +class ScopedDeployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: + super(ScopedDeployment, self).__init__(**kwargs) + self.location = location + self.properties = properties + self.tags = tags + + +class ScopedDeploymentWhatIf(Model): + """Deployment What-if operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfProperties + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'}, + } + + def __init__(self, *, location: str, properties, **kwargs) -> None: + super(ScopedDeploymentWhatIf, self).__init__(**kwargs) + self.location = location + self.properties = properties + + +class Sku(Model): + """SKU for the resource. + + :param name: The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + :param size: The SKU size. + :type size: str + :param family: The SKU family. + :type family: str + :param model: The SKU model. + :type model: str + :param capacity: The SKU capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, tier: str=None, size: str=None, family: str=None, model: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.model = model + self.capacity = capacity + + +class StatusMessage(Model): + """Operation status message object. + + :param status: Status of the deployment operation. + :type status: str + :param error: The error reported by the operation. + :type error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, status: str=None, error=None, **kwargs) -> None: + super(StatusMessage, self).__init__(**kwargs) + self.status = status + self.error = error + + +class SubResource(Model): + """Sub-resource. + + :param id: Resource ID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id + + +class TagCount(Model): + """Tag count. + + :param type: Type of count. + :type type: str + :param value: Value of count. + :type value: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + } + + def __init__(self, *, type: str=None, value: int=None, **kwargs) -> None: + super(TagCount, self).__init__(**kwargs) + self.type = type + self.value = value + + +class TagDetails(Model): + """Tag details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag name ID. + :vartype id: str + :param tag_name: The tag name. + :type tag_name: str + :param count: The total number of resources that use the resource tag. + When a tag is initially created and has no associated resources, the value + is 0. + :type count: ~azure.mgmt.resource.resources.v2021_01_01.models.TagCount + :param values: The list of tag values. + :type values: + list[~azure.mgmt.resource.resources.v2021_01_01.models.TagValue] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + 'values': {'key': 'values', 'type': '[TagValue]'}, + } + + def __init__(self, *, tag_name: str=None, count=None, values=None, **kwargs) -> None: + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = tag_name + self.count = count + self.values = values + + +class Tags(Model): + """A dictionary of name and value pairs. + + :param tags: + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(Tags, self).__init__(**kwargs) + self.tags = tags + + +class TagsPatchResource(Model): + """Wrapper resource for tags patch API request only. + + :param operation: The operation type for the patch API. Possible values + include: 'Replace', 'Merge', 'Delete' + :type operation: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.TagsPatchOperation + :param properties: The set of tags. + :type properties: ~azure.mgmt.resource.resources.v2021_01_01.models.Tags + """ + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Tags'}, + } + + def __init__(self, *, operation=None, properties=None, **kwargs) -> None: + super(TagsPatchResource, self).__init__(**kwargs) + self.operation = operation + self.properties = properties + + +class TagsResource(Model): + """Wrapper resource for tags API requests and responses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the tags wrapper resource. + :vartype id: str + :ivar name: The name of the tags wrapper resource. + :vartype name: str + :ivar type: The type of the tags wrapper resource. + :vartype type: str + :param properties: Required. The set of tags. + :type properties: ~azure.mgmt.resource.resources.v2021_01_01.models.Tags + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Tags'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag value ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2021_01_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, *, tag_value: str=None, count=None, **kwargs) -> None: + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = tag_value + self.count = count + + +class TargetResource(Model): + """Target resource. + + :param id: The ID of the resource. + :type id: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_type: The type of the resource. + :type resource_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_name: str=None, resource_type: str=None, **kwargs) -> None: + super(TargetResource, self).__init__(**kwargs) + self.id = id + self.resource_name = resource_name + self.resource_type = resource_type + + +class TemplateHashResult(Model): + """Result of the request to calculate template hash. It contains a string of + minified template and its hash. + + :param minified_template: The minified template string. + :type minified_template: str + :param template_hash: The template hash. + :type template_hash: str + """ + + _attribute_map = { + 'minified_template': {'key': 'minifiedTemplate', 'type': 'str'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + } + + def __init__(self, *, minified_template: str=None, template_hash: str=None, **kwargs) -> None: + super(TemplateHashResult, self).__init__(**kwargs) + self.minified_template = minified_template + self.template_hash = template_hash + + +class TemplateLink(Model): + """Entity representing the reference to the template. + + :param uri: The URI of the template to deploy. Use either the uri or id + property, but not both. + :type uri: str + :param id: The resource id of a Template Spec. Use either the id or uri + property, but not both. + :type id: str + :param relative_path: The relativePath property can be used to deploy a + linked template at a location relative to the parent. If the parent + template was linked with a TemplateSpec, this will reference an artifact + in the TemplateSpec. If the parent was linked with a URI, the child + deployment will be a combination of the parent and relativePath URIs + :type relative_path: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + :param query_string: The query string (for example, a SAS token) to be + used with the templateLink URI. + :type query_string: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, id: str=None, relative_path: str=None, content_version: str=None, query_string: str=None, **kwargs) -> None: + super(TemplateLink, self).__init__(**kwargs) + self.uri = uri + self.id = id + self.relative_path = relative_path + self.content_version = content_version + self.query_string = query_string + + +class WhatIfChange(Model): + """Information about a single resource change predicted by What-If operation. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. Resource ID + :type resource_id: str + :param change_type: Required. Type of change that will be made to the + resource when the deployment is executed. Possible values include: + 'Create', 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify', + 'Unsupported' + :type change_type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.ChangeType + :param unsupported_reason: The explanation about why the resource is + unsupported by What-If. + :type unsupported_reason: str + :param before: The snapshot of the resource before the deployment is + executed. + :type before: object + :param after: The predicted snapshot of the resource after the deployment + is executed. + :type after: object + :param delta: The predicted changes to resource properties. + :type delta: + list[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfPropertyChange] + """ + + _validation = { + 'resource_id': {'required': True}, + 'change_type': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'change_type': {'key': 'changeType', 'type': 'ChangeType'}, + 'unsupported_reason': {'key': 'unsupportedReason', 'type': 'str'}, + 'before': {'key': 'before', 'type': 'object'}, + 'after': {'key': 'after', 'type': 'object'}, + 'delta': {'key': 'delta', 'type': '[WhatIfPropertyChange]'}, + } + + def __init__(self, *, resource_id: str, change_type, unsupported_reason: str=None, before=None, after=None, delta=None, **kwargs) -> None: + super(WhatIfChange, self).__init__(**kwargs) + self.resource_id = resource_id + self.change_type = change_type + self.unsupported_reason = unsupported_reason + self.before = before + self.after = after + self.delta = delta + + +class WhatIfOperationResult(Model): + """Result of the What-If operation. Contains a list of predicted changes and a + URL link to get to the next set of results. + + :param status: Status of the What-If operation. + :type status: str + :param changes: List of resource changes predicted by What-If operation. + :type changes: + list[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfChange] + :param error: Error when What-If operation fails. + :type error: + ~azure.mgmt.resource.resources.v2021_01_01.models.ErrorResponse + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'changes': {'key': 'properties.changes', 'type': '[WhatIfChange]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, status: str=None, changes=None, error=None, **kwargs) -> None: + super(WhatIfOperationResult, self).__init__(**kwargs) + self.status = status + self.changes = changes + self.error = error + + +class WhatIfPropertyChange(Model): + """The predicted change to the resource property. + + All required parameters must be populated in order to send to Azure. + + :param path: Required. The path of the property. + :type path: str + :param property_change_type: Required. The type of property change. + Possible values include: 'Create', 'Delete', 'Modify', 'Array', 'NoEffect' + :type property_change_type: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.PropertyChangeType + :param before: The value of the property before the deployment is + executed. + :type before: object + :param after: The value of the property after the deployment is executed. + :type after: object + :param children: Nested property changes. + :type children: + list[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfPropertyChange] + """ + + _validation = { + 'path': {'required': True}, + 'property_change_type': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'property_change_type': {'key': 'propertyChangeType', 'type': 'PropertyChangeType'}, + 'before': {'key': 'before', 'type': 'object'}, + 'after': {'key': 'after', 'type': 'object'}, + 'children': {'key': 'children', 'type': '[WhatIfPropertyChange]'}, + } + + def __init__(self, *, path: str, property_change_type, before=None, after=None, children=None, **kwargs) -> None: + super(WhatIfPropertyChange, self).__init__(**kwargs) + self.path = path + self.property_change_type = property_change_type + self.before = before + self.after = after + self.children = children diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_paged_models.py new file mode 100644 index 000000000000..568e0d03a350 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_paged_models.py @@ -0,0 +1,105 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class DeploymentExtendedPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeploymentExtended ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeploymentExtended]'} + } + + def __init__(self, *args, **kwargs): + + super(DeploymentExtendedPaged, self).__init__(*args, **kwargs) +class ProviderPaged(Paged): + """ + A paging container for iterating over a list of :class:`Provider ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Provider]'} + } + + def __init__(self, *args, **kwargs): + + super(ProviderPaged, self).__init__(*args, **kwargs) +class GenericResourceExpandedPaged(Paged): + """ + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} + } + + def __init__(self, *args, **kwargs): + + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) +class ResourceGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceGroupPaged, self).__init__(*args, **kwargs) +class TagDetailsPaged(Paged): + """ + A paging container for iterating over a list of :class:`TagDetails ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TagDetails]'} + } + + def __init__(self, *args, **kwargs): + + super(TagDetailsPaged, self).__init__(*args, **kwargs) +class DeploymentOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeploymentOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeploymentOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(DeploymentOperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_resource_management_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_resource_management_client_enums.py new file mode 100644 index 000000000000..cc964c54eb19 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_resource_management_client_enums.py @@ -0,0 +1,138 @@ +# 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 enum import Enum + + +class DeploymentMode(str, Enum): + + incremental = "Incremental" + complete = "Complete" + + +class OnErrorDeploymentType(str, Enum): + + last_successful = "LastSuccessful" + specific_deployment = "SpecificDeployment" + + +class ExpressionEvaluationOptionsScopeType(str, Enum): + + not_specified = "NotSpecified" + outer = "Outer" + inner = "Inner" + + +class WhatIfResultFormat(str, Enum): + + resource_id_only = "ResourceIdOnly" + full_resource_payloads = "FullResourcePayloads" + + +class AliasPathTokenType(str, Enum): + + not_specified = "NotSpecified" #: The token type is not specified. + any = "Any" #: The token type can be anything. + string = "String" #: The token type is string. + object_enum = "Object" #: The token type is object. + array = "Array" #: The token type is array. + integer = "Integer" #: The token type is integer. + number = "Number" #: The token type is number. + boolean = "Boolean" #: The token type is boolean. + + +class AliasPathAttributes(str, Enum): + + none = "None" #: The token that the alias path is referring to has no attributes. + modifiable = "Modifiable" #: The token that the alias path is referring to is modifiable by policies with 'modify' effect. + + +class AliasPatternType(str, Enum): + + not_specified = "NotSpecified" #: NotSpecified is not allowed. + extract = "Extract" #: Extract is the only allowed value. + + +class AliasType(str, Enum): + + not_specified = "NotSpecified" #: Alias type is unknown (same as not providing alias type). + plain_text = "PlainText" #: Alias value is not secret. + mask = "Mask" #: Alias value is secret. + + +class ProvisioningState(str, Enum): + + not_specified = "NotSpecified" + accepted = "Accepted" + running = "Running" + ready = "Ready" + creating = "Creating" + created = "Created" + deleting = "Deleting" + deleted = "Deleted" + canceled = "Canceled" + failed = "Failed" + succeeded = "Succeeded" + updating = "Updating" + + +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned, UserAssigned" + none = "None" + + +class ExtendedLocationType(str, Enum): + + edge_zone = "EdgeZone" + + +class ProvisioningOperation(str, Enum): + + not_specified = "NotSpecified" #: The provisioning operation is not specified. + create = "Create" #: The provisioning operation is create. + delete = "Delete" #: The provisioning operation is delete. + waiting = "Waiting" #: The provisioning operation is waiting. + azure_async_operation_waiting = "AzureAsyncOperationWaiting" #: The provisioning operation is waiting Azure async operation. + resource_cache_waiting = "ResourceCacheWaiting" #: The provisioning operation is waiting for resource cache. + action = "Action" #: The provisioning operation is action. + read = "Read" #: The provisioning operation is read. + evaluate_deployment_output = "EvaluateDeploymentOutput" #: The provisioning operation is evaluate output. + deployment_cleanup = "DeploymentCleanup" #: The provisioning operation is cleanup. This operation is part of the 'complete' mode deployment. + + +class PropertyChangeType(str, Enum): + + create = "Create" #: The property does not exist in the current state but is present in the desired state. The property will be created when the deployment is executed. + delete = "Delete" #: The property exists in the current state and is missing from the desired state. It will be deleted when the deployment is executed. + modify = "Modify" #: The property exists in both current and desired state and is different. The value of the property will change when the deployment is executed. + array = "Array" #: The property is an array and contains nested changes. + no_effect = "NoEffect" #: The property will not be set or updated. + + +class ChangeType(str, Enum): + + create = "Create" #: The resource does not exist in the current state but is present in the desired state. The resource will be created when the deployment is executed. + delete = "Delete" #: The resource exists in the current state and is missing from the desired state. The resource will be deleted when the deployment is executed. + ignore = "Ignore" #: The resource exists in the current state and is missing from the desired state. The resource will not be deployed or modified when the deployment is executed. + deploy = "Deploy" #: The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource may or may not change. + no_change = "NoChange" #: The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource will not change. + modify = "Modify" #: The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource will change. + unsupported = "Unsupported" #: The resource is not supported by What-If. + + +class TagsPatchOperation(str, Enum): + + replace = "Replace" #: The 'replace' option replaces the entire set of existing tags with a new set. + merge = "Merge" #: The 'merge' option allows adding tags with new names and updating the values of tags with existing names. + delete = "Delete" #: The 'delete' option allows selectively deleting tags based on given names or name/value pairs. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/__init__.py new file mode 100644 index 000000000000..3fceb9fb37b4 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/__init__.py @@ -0,0 +1,30 @@ +# 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 ._operations import Operations +from ._deployments_operations import DeploymentsOperations +from ._providers_operations import ProvidersOperations +from ._provider_resource_types_operations import ProviderResourceTypesOperations +from ._resources_operations import ResourcesOperations +from ._resource_groups_operations import ResourceGroupsOperations +from ._tags_operations import TagsOperations +from ._deployment_operations import DeploymentOperations + +__all__ = [ + 'Operations', + 'DeploymentsOperations', + 'ProvidersOperations', + 'ProviderResourceTypesOperations', + 'ResourcesOperations', + 'ResourceGroupsOperations', + 'TagsOperations', + 'DeploymentOperations', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_deployment_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_deployment_operations.py new file mode 100644 index 000000000000..101c94340505 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_deployment_operations.py @@ -0,0 +1,729 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DeploymentOperations(object): + """DeploymentOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def get_at_scope( + self, scope, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}'} + + def list_at_scope( + self, scope, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations'} + + def get_at_tenant_scope( + self, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}'} + + def list_at_tenant_scope( + self, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/operations'} + + def get_at_management_group_scope( + self, group_id, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}'} + + def list_at_management_group_scope( + self, group_id, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations'} + + def get_at_subscription_scope( + self, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}'} + + def list_at_subscription_scope( + self, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations'} + + def get( + self, resource_group_name, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}'} + + def list( + self, resource_group_name, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_deployments_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_deployments_operations.py new file mode 100644 index 000000000000..6dabee3492da --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_deployments_operations.py @@ -0,0 +1,3582 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DeploymentsOperations(object): + """DeploymentsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + + def _delete_at_scope_initial( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. This is an asynchronous operation that returns a status of + 202 until the template deployment is successfully deleted. The Location + response header contains the URI that is used to obtain the status of + the process. While the process is running, a call to the URI in the + Location header returns a status of 202. When the process finishes, the + URI in the Location header returns a status of 204 on success. If the + asynchronous request failed, the URI in the Location header returns an + error-level status code. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_at_scope_initial( + scope=scope, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_at_scope_initial( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_at_scope( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources at a given scope. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_at_scope_initial( + scope=scope, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resources partially + deployed. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_at_scope_initial( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate_at_scope( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_scope_initial( + scope=scope, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + def export_template_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_at_scope( + self, scope, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments at the given scope. + + :param scope: The resource scope. + :type scope: str + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/'} + + + def _delete_at_tenant_scope_initial( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. This is an asynchronous operation that returns a status of + 202 until the template deployment is successfully deleted. The Location + response header contains the URI that is used to obtain the status of + the process. While the process is running, a call to the URI in the + Location header returns a status of 202. When the process finishes, the + URI in the Location header returns a status of 204 on success. If the + asynchronous request failed, the URI in the Location header returns an + error-level status code. + + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_at_tenant_scope_initial( + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_at_tenant_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_at_tenant_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources at tenant scope. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.ScopedDeployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_at_tenant_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resources partially + deployed. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_at_tenant_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate_at_tenant_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.ScopedDeployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_tenant_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + + def _what_if_at_tenant_scope_initial( + self, deployment_name, location, properties, custom_headers=None, raw=False, **operation_config): + parameters = models.ScopedDeploymentWhatIf(location=location, properties=properties) + + # Construct URL + url = self.what_if_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeploymentWhatIf') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('WhatIfOperationResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def what_if_at_tenant_scope( + self, deployment_name, location, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Returns changes that will be made by the deployment if executed at the + scope of the tenant group. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param location: The location to store the deployment data. + :type location: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfProperties + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WhatIfOperationResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._what_if_at_tenant_scope_initial( + deployment_name=deployment_name, + location=location, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('WhatIfOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + what_if_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'} + + def export_template_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_at_tenant_scope( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments at the tenant scope. + + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_tenant_scope.metadata['url'] + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/'} + + + def _delete_at_management_group_scope_initial( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. This is an asynchronous operation that returns a status of + 202 until the template deployment is successfully deleted. The Location + response header contains the URI that is used to obtain the status of + the process. While the process is running, a call to the URI in the + Location header returns a status of 202. When the process finishes, the + URI in the Location header returns a status of 204 on success. If the + asynchronous request failed, the URI in the Location header returns an + error-level status code. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_at_management_group_scope_initial( + group_id=group_id, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_at_management_group_scope_initial( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_at_management_group_scope( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources at management group scope. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.ScopedDeployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_at_management_group_scope_initial( + group_id=group_id, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resources partially + deployed. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_at_management_group_scope_initial( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate_at_management_group_scope( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.ScopedDeployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_management_group_scope_initial( + group_id=group_id, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + + def _what_if_at_management_group_scope_initial( + self, group_id, deployment_name, location, properties, custom_headers=None, raw=False, **operation_config): + parameters = models.ScopedDeploymentWhatIf(location=location, properties=properties) + + # Construct URL + url = self.what_if_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeploymentWhatIf') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('WhatIfOperationResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def what_if_at_management_group_scope( + self, group_id, deployment_name, location, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Returns changes that will be made by the deployment if executed at the + scope of the management group. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param location: The location to store the deployment data. + :type location: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfProperties + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WhatIfOperationResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._what_if_at_management_group_scope_initial( + group_id=group_id, + deployment_name=deployment_name, + location=location, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('WhatIfOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + what_if_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'} + + def export_template_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_at_management_group_scope( + self, group_id, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments for a management group. + + :param group_id: The management group ID. + :type group_id: str + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/'} + + + def _delete_at_subscription_scope_initial( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. This is an asynchronous operation that returns a status of + 202 until the template deployment is successfully deleted. The Location + response header contains the URI that is used to obtain the status of + the process. While the process is running, a call to the URI in the + Location header returns a status of 202. When the process finishes, the + URI in the Location header returns a status of 204 on success. If the + asynchronous request failed, the URI in the Location header returns an + error-level status code. + + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_at_subscription_scope_initial( + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_at_subscription_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_at_subscription_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources at subscription scope. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_at_subscription_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resources partially + deployed. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_at_subscription_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate_at_subscription_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_subscription_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + + def _what_if_at_subscription_scope_initial( + self, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): + parameters = models.DeploymentWhatIf(location=location, properties=properties) + + # Construct URL + url = self.what_if_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'DeploymentWhatIf') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('WhatIfOperationResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def what_if_at_subscription_scope( + self, deployment_name, properties, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Returns changes that will be made by the deployment if executed at the + scope of the subscription. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfProperties + :param location: The location to store the deployment data. + :type location: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WhatIfOperationResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._what_if_at_subscription_scope_initial( + deployment_name=deployment_name, + properties=properties, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('WhatIfOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + what_if_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'} + + def export_template_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_at_subscription_scope( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments for a subscription. + + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/'} + + + def _delete_initial( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. Deleting a template deployment does not affect the state of + the resource group. This is an asynchronous operation that returns a + status of 202 until the template deployment is successfully deleted. + The Location response header contains the URI that is used to obtain + the status of the process. While the process is running, a call to the + URI in the Location header returns a status of 202. When the process + finishes, the URI in the Location header returns a status of 204 on + success. If the asynchronous request failed, the URI in the Location + header returns an error-level status code. + + :param resource_group_name: The name of the resource group with the + deployment to delete. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param resource_group_name: The name of the resource group with the + deployment to check. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_initial( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources to a resource group. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param resource_group_name: The name of the resource group to deploy + the resources to. The name is case insensitive. The resource group + must already exist. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resource group partially + deployed. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_initial( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param resource_group_name: The name of the resource group the + template will be deployed to. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + + def _what_if_initial( + self, resource_group_name, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): + parameters = models.DeploymentWhatIf(location=location, properties=properties) + + # Construct URL + url = self.what_if.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'DeploymentWhatIf') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('WhatIfOperationResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def what_if( + self, resource_group_name, deployment_name, properties, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Returns changes that will be made by the deployment if executed at the + scope of the resource group. + + :param resource_group_name: The name of the resource group the + template will be deployed to. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentWhatIfProperties + :param location: The location to store the deployment data. + :type location: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WhatIfOperationResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.WhatIfOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._what_if_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + properties=properties, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('WhatIfOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + what_if.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'} + + def export_template( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_by_resource_group( + self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments for a resource group. + + :param resource_group_name: The name of the resource group with the + deployments to get. The name is case insensitive. + :type resource_group_name: str + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'} + + def calculate_template_hash( + self, template, custom_headers=None, raw=False, **operation_config): + """Calculate the hash of the given template. + + :param template: The template provided to calculate hash. + :type template: object + :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: TemplateHashResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.TemplateHashResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.calculate_template_hash.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(template, 'object') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateHashResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + calculate_template_hash.metadata = {'url': '/providers/Microsoft.Resources/calculateTemplateHash'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py new file mode 100644 index 000000000000..fc72bf2dd05b --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Resources REST API operations. + + :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: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.OperationPaged[~azure.mgmt.resource.resources.v2021_01_01.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Resources/operations'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_provider_resource_types_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_provider_resource_types_operations.py new file mode 100644 index 000000000000..5383c89c119e --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_provider_resource_types_operations.py @@ -0,0 +1,106 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ProviderResourceTypesOperations(object): + """ProviderResourceTypesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def list( + self, resource_provider_namespace, expand=None, custom_headers=None, raw=False, **operation_config): + """List the resource types for a specified resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param expand: The $expand query parameter. For example, to include + property aliases in response, use $expand=resourceTypes/aliases. + :type expand: 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: ProviderResourceTypeListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.ProviderResourceTypeListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderResourceTypeListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/resourceTypes'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_providers_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_providers_operations.py new file mode 100644 index 000000000000..8ae375214163 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_providers_operations.py @@ -0,0 +1,490 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ProvidersOperations(object): + """ProvidersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def unregister( + self, resource_provider_namespace, custom_headers=None, raw=False, **operation_config): + """Unregisters a subscription from a resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider to unregister. + :type resource_provider_namespace: 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: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.unregister.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + unregister.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister'} + + def register_at_management_group_scope( + self, resource_provider_namespace, group_id, custom_headers=None, raw=False, **operation_config): + """Registers a management group with a resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider to register. + :type resource_provider_namespace: str + :param group_id: The management group ID. + :type group_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.register_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1) + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + register_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register'} + + def register( + self, resource_provider_namespace, custom_headers=None, raw=False, **operation_config): + """Registers a subscription with a resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider to register. + :type resource_provider_namespace: 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: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.register.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + register.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register'} + + def list( + self, top=None, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets all resource providers for a subscription. + + :param top: The number of results to return. If null is passed returns + all deployments. + :type top: int + :param expand: The properties to include in the results. For example, + use &$expand=metadata in the query string to retrieve resource + provider metadata. To include property aliases in response, use + $expand=resourceTypes/aliases. + :type expand: 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: An iterator like instance of Provider + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.ProviderPaged[~azure.mgmt.resource.resources.v2021_01_01.models.Provider] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProviderPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers'} + + def list_at_tenant_scope( + self, top=None, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets all resource providers for the tenant. + + :param top: The number of results to return. If null is passed returns + all providers. + :type top: int + :param expand: The properties to include in the results. For example, + use &$expand=metadata in the query string to retrieve resource + provider metadata. To include property aliases in response, use + $expand=resourceTypes/aliases. + :type expand: 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: An iterator like instance of Provider + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.ProviderPaged[~azure.mgmt.resource.resources.v2021_01_01.models.Provider] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_tenant_scope.metadata['url'] + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProviderPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_tenant_scope.metadata = {'url': '/providers'} + + def get( + self, resource_provider_namespace, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param expand: The $expand query parameter. For example, to include + property aliases in response, use $expand=resourceTypes/aliases. + :type expand: 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: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}'} + + def get_at_tenant_scope( + self, resource_provider_namespace, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified resource provider at the tenant level. + + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param expand: The $expand query parameter. For example, to include + property aliases in response, use $expand=resourceTypes/aliases. + :type expand: 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: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_tenant_scope.metadata = {'url': '/providers/{resourceProviderNamespace}'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_resource_groups_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_resource_groups_operations.py new file mode 100644 index 000000000000..e441183d54a7 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_resource_groups_operations.py @@ -0,0 +1,570 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ResourceGroupsOperations(object): + """ResourceGroupsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def check_existence( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Checks whether a resource group exists. + + :param resource_group_name: The name of the resource group to check. + 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def create_or_update( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a resource group. + + :param resource_group_name: The name of the resource group to create + or update. Can include alphanumeric, underscore, parentheses, hyphen, + period (except at end), and Unicode characters that match the allowed + characters. + :type resource_group_name: str + :param parameters: Parameters supplied to the create or update a + resource group. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup + :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: ResourceGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ResourceGroup') + + # Construct and send request + 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 [200, 201]: + 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('ResourceGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('ResourceGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + + def _delete_initial( + self, resource_group_name, force_deletion_types=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if force_deletion_types is not None: + query_parameters['forceDeletionTypes'] = self._serialize.query("force_deletion_types", force_deletion_types, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, force_deletion_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 + deleted. Deleting a resource group deletes all of its template + deployments and currently stored operations. + + :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_types: The resource types you want to force + delete. Currently, only the following is supported: + forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets + :type force_deletion_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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + force_deletion_types=force_deletion_types, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def get( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a resource group. + + :param resource_group_name: The name of the resource group to get. 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ResourceGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def update( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates a resource group. + + Resource groups can be updated through a simple PATCH operation to a + group address. The format of the request is the same as that for + creating a resource group. If a field is unspecified, the current value + is retained. + + :param resource_group_name: The name of the resource group to update. + The name is case insensitive. + :type resource_group_name: str + :param parameters: Parameters supplied to update a resource group. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroupPatchable + :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: ResourceGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ResourceGroupPatchable') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ResourceGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + + def _export_template_initial( + self, resource_group_name, resources=None, options=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ExportTemplateRequest(resources=resources, options=options) + + # Construct URL + url = self.export_template.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1) + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ExportTemplateRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('ResourceGroupExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def export_template( + self, resource_group_name, resources=None, options=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Captures the specified resource group as a template. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resources: The IDs of the resources to filter the export by. To + export all resources, supply an array with single entry '*'. + :type resources: list[str] + :param options: The export template options. A CSV-formatted list + containing zero or more of the following: + 'IncludeParameterDefaultValue', 'IncludeComments', + 'SkipResourceNameParameterization', 'SkipAllParameterization' + :type options: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ResourceGroupExportResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroupExportResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroupExportResult]] + :raises: :class:`CloudError` + """ + raw_result = self._export_template_initial( + resource_group_name=resource_group_name, + resources=resources, + options=options, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ResourceGroupExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + export_template.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate'} + + def list( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all the resource groups for a subscription. + + :param filter: The filter to apply on the operation.

You can + filter by tag names and values. For example, to filter for a tag name + and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1' + :type filter: str + :param top: The number of results to return. If null is passed, + returns all resource groups. + :type top: int + :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: An iterator like instance of ResourceGroup + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroupPaged[~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ResourceGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_resources_operations.py new file mode 100644 index 000000000000..4da30c057598 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_resources_operations.py @@ -0,0 +1,1315 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ResourcesOperations(object): + """ResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def list_by_resource_group( + self, resource_group_name, filter=None, expand=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the resources for a resource group. + + :param resource_group_name: The resource group with the resources to + get. + :type resource_group_name: str + :param filter: The filter to apply on the operation.

The + properties you can use for eq (equals) or ne (not equals) are: + location, resourceType, name, resourceGroup, identity, + identity/principalId, plan, plan/publisher, plan/product, plan/name, + plan/version, and plan/promotionCode.

For example, to filter by + a resource type, use: $filter=resourceType eq + 'Microsoft.Network/virtualNetworks'

You can use + substringof(value, property) in the filter. The properties you can use + for substring are: name and resourceGroup.

For example, to get + all resources with 'demo' anywhere in the name, use: + $filter=substringof('demo', name)

You can link more than one + substringof together by adding and/or operators.

You can filter + by tag names and values. For example, to filter for a tag name and + value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When + you filter by a tag name and value, the tags for each resource are not + returned in the results.

You can use some properties together + when filtering. The combinations you can use are: substringof and/or + resourceType, plan and plan/publisher and plan/name, identity and + identity/principalId. + :type filter: str + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. + :type expand: str + :param top: The number of results to return. If null is passed, + returns all resources. + :type top: int + :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: An iterator like instance of GenericResourceExpanded + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResourceExpanded] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} + + + def _move_resources_initial( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ResourcesMoveInfo(resources=resources, target_resource_group=target_resource_group) + + # Construct URL + url = self.move_resources.metadata['url'] + path_format_arguments = { + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 body + body_content = self._serialize.body(parameters, 'ResourcesMoveInfo') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def move_resources( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Moves resources from one resource group to another resource group. + + The resources to move must be in the same source resource group. The + target resource group may be in a different subscription. When moving + resources, both the source group and the target group are locked for + the duration of the operation. Write and delete operations are blocked + on the groups until the move completes. . + + :param source_resource_group_name: The name of the resource group + containing the resources to move. + :type source_resource_group_name: str + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._move_resources_initial( + source_resource_group_name=source_resource_group_name, + resources=resources, + target_resource_group=target_resource_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources'} + + + def _validate_move_resources_initial( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ResourcesMoveInfo(resources=resources, target_resource_group=target_resource_group) + + # Construct URL + url = self.validate_move_resources.metadata['url'] + path_format_arguments = { + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 body + body_content = self._serialize.body(parameters, 'ResourcesMoveInfo') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def validate_move_resources( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether resources can be moved from one resource group to + another resource group. + + This operation checks whether the specified resources can be moved to + the target. The resources to move must be in the same source resource + group. The target resource group may be in a different subscription. If + validation succeeds, it returns HTTP response code 204 (no content). If + validation fails, it returns HTTP response code 409 (Conflict) with an + error message. Retrieve the URL in the Location header value to check + the result of the long-running operation. + + :param source_resource_group_name: The name of the resource group + containing the resources to validate for move. + :type source_resource_group_name: str + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_move_resources_initial( + source_resource_group_name=source_resource_group_name, + resources=resources, + target_resource_group=target_resource_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources'} + + def list( + self, filter=None, expand=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the resources in a subscription. + + :param filter: The filter to apply on the operation.

The + properties you can use for eq (equals) or ne (not equals) are: + location, resourceType, name, resourceGroup, identity, + identity/principalId, plan, plan/publisher, plan/product, plan/name, + plan/version, and plan/promotionCode.

For example, to filter by + a resource type, use: $filter=resourceType eq + 'Microsoft.Network/virtualNetworks'

You can use + substringof(value, property) in the filter. The properties you can use + for substring are: name and resourceGroup.

For example, to get + all resources with 'demo' anywhere in the name, use: + $filter=substringof('demo', name)

You can link more than one + substringof together by adding and/or operators.

You can filter + by tag names and values. For example, to filter for a tag name and + value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When + you filter by a tag name and value, the tags for each resource are not + returned in the results.

You can use some properties together + when filtering. The combinations you can use are: substringof and/or + resourceType, plan and plan/publisher and plan/name, identity and + identity/principalId. + :type filter: str + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. + :type expand: str + :param top: The number of results to return. If null is passed, + returns all resource groups. + :type top: int + :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: An iterator like instance of GenericResourceExpanded + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResourceExpanded] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} + + def check_existence( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + """Checks whether a resource exists. + + :param resource_group_name: The name of the resource group containing + the resource to check. The name is case insensitive. + :type resource_group_name: str + :param resource_provider_namespace: The resource provider of the + resource to check. + :type resource_provider_namespace: str + :param parent_resource_path: The parent resource identity. + :type parent_resource_path: str + :param resource_type: The resource type. + :type resource_type: str + :param resource_name: The name of the resource to check whether it + exists. + :type resource_name: str + :param api_version: The API version to use for the 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a resource. + + :param resource_group_name: The name of the resource group that + contains the resource to delete. 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. + :type resource_type: str + :param resource_name: The name of the resource to delete. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_provider_namespace=resource_provider_namespace, + parent_resource_path=parent_resource_path, + resource_type=resource_type, + resource_name=resource_name, + api_version=api_version, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + 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 [200, 201, 202]: + 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('GenericResource', response) + if response.status_code == 201: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a resource. + + :param resource_group_name: The name of the resource group for 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 to create. + :type resource_type: str + :param resource_name: The name of the resource to create. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Parameters for creating or updating the resource. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_provider_namespace=resource_provider_namespace, + parent_resource_path=parent_resource_path, + resource_type=resource_type, + resource_name=resource_name, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a resource. + + :param resource_group_name: The name of the resource group for 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 to update. + :type resource_type: str + :param resource_name: The name of the resource to update. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Parameters for updating the resource. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_provider_namespace=resource_provider_namespace, + parent_resource_path=parent_resource_path, + resource_type=resource_type, + resource_name=resource_name, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + def get( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + """Gets a resource. + + :param resource_group_name: The name of the resource group containing + the resource to get. 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. + :type resource_type: str + :param resource_name: The name of the resource to get. + :type resource_name: str + :param api_version: The API version to use for the 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GenericResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + def check_existence_by_id( + self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + """Checks by ID whether a resource exists. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_by_id.metadata = {'url': '/{resourceId}'} + + + def _delete_by_id_initial( + self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_by_id( + self, resource_id, api_version, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_by_id_initial( + resource_id=resource_id, + api_version=api_version, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_by_id.metadata = {'url': '/{resourceId}'} + + + def _create_or_update_by_id_initial( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + 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 [200, 201, 202]: + 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('GenericResource', response) + if response.status_code == 201: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_by_id( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Create or update resource parameters. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_by_id_initial( + resource_id=resource_id, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_by_id.metadata = {'url': '/{resourceId}'} + + + def _update_by_id_initial( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_by_id( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Update resource parameters. + :type parameters: + ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_by_id_initial( + resource_id=resource_id, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_by_id.metadata = {'url': '/{resourceId}'} + + def get_by_id( + self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + """Gets a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GenericResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/{resourceId}'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_tags_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_tags_operations.py new file mode 100644 index 000000000000..62305760647d --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_tags_operations.py @@ -0,0 +1,613 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TagsOperations(object): + """TagsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def delete_value( + self, tag_name, tag_value, custom_headers=None, raw=False, **operation_config): + """Deletes a predefined tag value for a predefined tag name. + + This operation allows deleting a value from the list of predefined + values for an existing predefined tag name. The value being deleted + must not be in use as a tag value for the given tag name for any + resource. + + :param tag_name: The name of the tag. + :type tag_name: str + :param tag_value: The value of the tag to delete. + :type tag_value: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_value.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'tagValue': self._serialize.url("tag_value", tag_value, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_value.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}'} + + def create_or_update_value( + self, tag_name, tag_value, custom_headers=None, raw=False, **operation_config): + """Creates a predefined value for a predefined tag name. + + This operation allows adding a value to the list of predefined values + for an existing predefined tag name. A tag value can have a maximum of + 256 characters. + + :param tag_name: The name of the tag. + :type tag_name: str + :param tag_value: The value of the tag to create. + :type tag_value: 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: TagValue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagValue or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update_value.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'tagValue': self._serialize.url("tag_value", tag_value, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.put(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagValue', response) + if response.status_code == 201: + deserialized = self._deserialize('TagValue', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_value.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}'} + + def create_or_update( + self, tag_name, custom_headers=None, raw=False, **operation_config): + """Creates a predefined tag name. + + This operation allows adding a name to the list of predefined tag names + for the given subscription. A tag name can have a maximum of 512 + characters and is case-insensitive. Tag names cannot have the following + prefixes which are reserved for Azure use: 'microsoft', 'azure', + 'windows'. + + :param tag_name: The name of the tag to create. + :type tag_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagDetails + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.put(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagDetails', response) + if response.status_code == 201: + deserialized = self._deserialize('TagDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}'} + + def delete( + self, tag_name, custom_headers=None, raw=False, **operation_config): + """Deletes a predefined tag name. + + This operation allows deleting a name from the list of predefined tag + names for the given subscription. The name being deleted must not be in + use as a tag name for any resource. All predefined values for the given + name must have already been deleted. + + :param tag_name: The name of the tag. + :type tag_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a summary of tag usage under the subscription. + + This operation performs a union of predefined tags, resource tags, + resource group tags and subscription tags, and returns a summary of + usage for each tag name and value under the given subscription. In case + of a large number of tags, this operation may return a previously + cached result. + + :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: An iterator like instance of TagDetails + :rtype: + ~azure.mgmt.resource.resources.v2021_01_01.models.TagDetailsPaged[~azure.mgmt.resource.resources.v2021_01_01.models.TagDetails] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TagDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames'} + + def create_or_update_at_scope( + self, scope, properties, custom_headers=None, raw=False, **operation_config): + """Creates or updates the entire set of tags on a resource or + subscription. + + This operation allows adding or replacing the entire set of tags on the + specified resource or subscription. The specified entity can have a + maximum of 50 tags. + + :param scope: The resource scope. + :type scope: str + :param properties: The set of tags. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.Tags + :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: TagsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagsResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.TagsResource(properties=properties) + + # Construct URL + url = self.create_or_update_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, '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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'TagsResource') + + # Construct and send request + 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 [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('TagsResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + + def update_at_scope( + self, scope, operation=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Selectively updates the set of tags on a resource or subscription. + + This operation allows replacing, merging or selectively deleting tags + on the specified resource or subscription. The specified entity can + have a maximum of 50 tags at the end of the operation. The 'replace' + option replaces the entire set of existing tags with a new set. The + 'merge' option allows adding tags with new names and updating the + values of tags with existing names. The 'delete' option allows + selectively deleting tags based on given names or name/value pairs. + + :param scope: The resource scope. + :type scope: str + :param operation: The operation type for the patch API. Possible + values include: 'Replace', 'Merge', 'Delete' + :type operation: str or + ~azure.mgmt.resource.resources.v2021_01_01.models.TagsPatchOperation + :param properties: The set of tags. + :type properties: + ~azure.mgmt.resource.resources.v2021_01_01.models.Tags + :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: TagsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagsResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.TagsPatchResource(operation=operation, properties=properties) + + # Construct URL + url = self.update_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, '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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'TagsPatchResource') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagsResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + + def get_at_scope( + self, scope, custom_headers=None, raw=False, **operation_config): + """Gets the entire set of tags on a resource or subscription. + + :param scope: The resource scope. + :type scope: 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: TagsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagsResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, '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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagsResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + + def delete_at_scope( + self, scope, custom_headers=None, raw=False, **operation_config): + """Deletes the entire set of tags on a resource or subscription. + + :param scope: The resource scope. + :type scope: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, '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 = {} + 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.delete(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/version.py new file mode 100644 index 000000000000..affaef0c987e --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/__init__.py new file mode 100644 index 000000000000..68bc897193ac --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import ResourceManagementClientConfiguration +from ._resource_management_client import ResourceManagementClient +__all__ = ['ResourceManagementClient', 'ResourceManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_configuration.py new file mode 100644 index 000000000000..660b6bb0e871 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_configuration.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class ResourceManagementClientConfiguration(AzureConfiguration): + """Configuration for ResourceManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Microsoft Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ResourceManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py new file mode 100644 index 000000000000..fed148b6ac21 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py @@ -0,0 +1,84 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import ResourceManagementClientConfiguration +from .operations import Operations +from .operations import DeploymentsOperations +from .operations import ProvidersOperations +from .operations import ProviderResourceTypesOperations +from .operations import ResourcesOperations +from .operations import ResourceGroupsOperations +from .operations import TagsOperations +from .operations import DeploymentOperations +from . import models + + +class ResourceManagementClient(SDKClient): + """Provides operations for working with resources and resource groups. + + :ivar config: Configuration for client. + :vartype config: ResourceManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.resource.resources.v2021_04_01.operations.Operations + :ivar deployments: Deployments operations + :vartype deployments: azure.mgmt.resource.resources.v2021_04_01.operations.DeploymentsOperations + :ivar providers: Providers operations + :vartype providers: azure.mgmt.resource.resources.v2021_04_01.operations.ProvidersOperations + :ivar provider_resource_types: ProviderResourceTypes operations + :vartype provider_resource_types: azure.mgmt.resource.resources.v2021_04_01.operations.ProviderResourceTypesOperations + :ivar resources: Resources operations + :vartype resources: azure.mgmt.resource.resources.v2021_04_01.operations.ResourcesOperations + :ivar resource_groups: ResourceGroups operations + :vartype resource_groups: azure.mgmt.resource.resources.v2021_04_01.operations.ResourceGroupsOperations + :ivar tags: Tags operations + :vartype tags: azure.mgmt.resource.resources.v2021_04_01.operations.TagsOperations + :ivar deployment_operations: DeploymentOperations operations + :vartype deployment_operations: azure.mgmt.resource.resources.v2021_04_01.operations.DeploymentOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Microsoft Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ResourceManagementClientConfiguration(credentials, subscription_id, base_url) + super(ResourceManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-04-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.providers = ProvidersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.provider_resource_types = ProviderResourceTypesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.resources = ResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.resource_groups = ResourceGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tags = TagsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.deployment_operations = DeploymentOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/__init__.py new file mode 100644 index 000000000000..a49f5badb289 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/__init__.py @@ -0,0 +1,283 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Alias + from ._models_py3 import AliasPath + from ._models_py3 import AliasPathMetadata + from ._models_py3 import AliasPattern + from ._models_py3 import ApiProfile + from ._models_py3 import BasicDependency + from ._models_py3 import DebugSetting + from ._models_py3 import Dependency + from ._models_py3 import Deployment + from ._models_py3 import DeploymentExportResult + from ._models_py3 import DeploymentExtended + from ._models_py3 import DeploymentExtendedFilter + from ._models_py3 import DeploymentOperation + from ._models_py3 import DeploymentOperationProperties + from ._models_py3 import DeploymentProperties + from ._models_py3 import DeploymentPropertiesExtended + from ._models_py3 import DeploymentValidateResult + from ._models_py3 import DeploymentWhatIf + from ._models_py3 import DeploymentWhatIfProperties + from ._models_py3 import DeploymentWhatIfSettings + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse + from ._models_py3 import ExportTemplateRequest + from ._models_py3 import ExpressionEvaluationOptions + from ._models_py3 import ExtendedLocation + from ._models_py3 import GenericResource + from ._models_py3 import GenericResourceExpanded + from ._models_py3 import GenericResourceFilter + from ._models_py3 import HttpMessage + from ._models_py3 import Identity + from ._models_py3 import IdentityUserAssignedIdentitiesValue + from ._models_py3 import OnErrorDeployment + from ._models_py3 import OnErrorDeploymentExtended + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ParametersLink + from ._models_py3 import Permission + from ._models_py3 import Plan + from ._models_py3 import Provider + from ._models_py3 import ProviderConsentDefinition + from ._models_py3 import ProviderExtendedLocation + from ._models_py3 import ProviderPermission + from ._models_py3 import ProviderPermissionListResult + from ._models_py3 import ProviderRegistrationRequest + from ._models_py3 import ProviderResourceType + from ._models_py3 import ProviderResourceTypeListResult + from ._models_py3 import Resource + from ._models_py3 import ResourceGroup + from ._models_py3 import ResourceGroupExportResult + from ._models_py3 import ResourceGroupFilter + from ._models_py3 import ResourceGroupPatchable + from ._models_py3 import ResourceGroupProperties + from ._models_py3 import ResourceProviderOperationDisplayProperties + from ._models_py3 import ResourceReference + from ._models_py3 import ResourcesMoveInfo + from ._models_py3 import RoleDefinition + from ._models_py3 import ScopedDeployment + from ._models_py3 import ScopedDeploymentWhatIf + from ._models_py3 import Sku + from ._models_py3 import StatusMessage + from ._models_py3 import SubResource + from ._models_py3 import TagCount + from ._models_py3 import TagDetails + from ._models_py3 import Tags + from ._models_py3 import TagsPatchResource + from ._models_py3 import TagsResource + from ._models_py3 import TagValue + from ._models_py3 import TargetResource + from ._models_py3 import TemplateHashResult + from ._models_py3 import TemplateLink + from ._models_py3 import WhatIfChange + from ._models_py3 import WhatIfOperationResult + from ._models_py3 import WhatIfPropertyChange +except (SyntaxError, ImportError): + from ._models import Alias + from ._models import AliasPath + from ._models import AliasPathMetadata + from ._models import AliasPattern + from ._models import ApiProfile + from ._models import BasicDependency + from ._models import DebugSetting + from ._models import Dependency + from ._models import Deployment + from ._models import DeploymentExportResult + from ._models import DeploymentExtended + from ._models import DeploymentExtendedFilter + from ._models import DeploymentOperation + from ._models import DeploymentOperationProperties + from ._models import DeploymentProperties + from ._models import DeploymentPropertiesExtended + from ._models import DeploymentValidateResult + from ._models import DeploymentWhatIf + from ._models import DeploymentWhatIfProperties + from ._models import DeploymentWhatIfSettings + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse + from ._models import ExportTemplateRequest + from ._models import ExpressionEvaluationOptions + from ._models import ExtendedLocation + from ._models import GenericResource + from ._models import GenericResourceExpanded + from ._models import GenericResourceFilter + from ._models import HttpMessage + from ._models import Identity + from ._models import IdentityUserAssignedIdentitiesValue + from ._models import OnErrorDeployment + from ._models import OnErrorDeploymentExtended + from ._models import Operation + from ._models import OperationDisplay + from ._models import ParametersLink + from ._models import Permission + from ._models import Plan + from ._models import Provider + from ._models import ProviderConsentDefinition + from ._models import ProviderExtendedLocation + from ._models import ProviderPermission + from ._models import ProviderPermissionListResult + from ._models import ProviderRegistrationRequest + from ._models import ProviderResourceType + from ._models import ProviderResourceTypeListResult + from ._models import Resource + from ._models import ResourceGroup + from ._models import ResourceGroupExportResult + from ._models import ResourceGroupFilter + from ._models import ResourceGroupPatchable + from ._models import ResourceGroupProperties + from ._models import ResourceProviderOperationDisplayProperties + from ._models import ResourceReference + from ._models import ResourcesMoveInfo + from ._models import RoleDefinition + from ._models import ScopedDeployment + from ._models import ScopedDeploymentWhatIf + from ._models import Sku + from ._models import StatusMessage + from ._models import SubResource + from ._models import TagCount + from ._models import TagDetails + from ._models import Tags + from ._models import TagsPatchResource + from ._models import TagsResource + from ._models import TagValue + from ._models import TargetResource + from ._models import TemplateHashResult + from ._models import TemplateLink + from ._models import WhatIfChange + from ._models import WhatIfOperationResult + from ._models import WhatIfPropertyChange +from ._paged_models import DeploymentExtendedPaged +from ._paged_models import DeploymentOperationPaged +from ._paged_models import GenericResourceExpandedPaged +from ._paged_models import OperationPaged +from ._paged_models import ProviderPaged +from ._paged_models import ResourceGroupPaged +from ._paged_models import TagDetailsPaged +from ._resource_management_client_enums import ( + DeploymentMode, + OnErrorDeploymentType, + ExpressionEvaluationOptionsScopeType, + WhatIfResultFormat, + AliasPathTokenType, + AliasPathAttributes, + AliasPatternType, + AliasType, + ProviderAuthorizationConsentState, + ProvisioningState, + ResourceIdentityType, + ExtendedLocationType, + ProvisioningOperation, + PropertyChangeType, + ChangeType, + TagsPatchOperation, +) + +__all__ = [ + 'Alias', + 'AliasPath', + 'AliasPathMetadata', + 'AliasPattern', + 'ApiProfile', + 'BasicDependency', + 'DebugSetting', + 'Dependency', + 'Deployment', + 'DeploymentExportResult', + 'DeploymentExtended', + 'DeploymentExtendedFilter', + 'DeploymentOperation', + 'DeploymentOperationProperties', + 'DeploymentProperties', + 'DeploymentPropertiesExtended', + 'DeploymentValidateResult', + 'DeploymentWhatIf', + 'DeploymentWhatIfProperties', + 'DeploymentWhatIfSettings', + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'ExportTemplateRequest', + 'ExpressionEvaluationOptions', + 'ExtendedLocation', + 'GenericResource', + 'GenericResourceExpanded', + 'GenericResourceFilter', + 'HttpMessage', + 'Identity', + 'IdentityUserAssignedIdentitiesValue', + 'OnErrorDeployment', + 'OnErrorDeploymentExtended', + 'Operation', + 'OperationDisplay', + 'ParametersLink', + 'Permission', + 'Plan', + 'Provider', + 'ProviderConsentDefinition', + 'ProviderExtendedLocation', + 'ProviderPermission', + 'ProviderPermissionListResult', + 'ProviderRegistrationRequest', + 'ProviderResourceType', + 'ProviderResourceTypeListResult', + 'Resource', + 'ResourceGroup', + 'ResourceGroupExportResult', + 'ResourceGroupFilter', + 'ResourceGroupPatchable', + 'ResourceGroupProperties', + 'ResourceProviderOperationDisplayProperties', + 'ResourceReference', + 'ResourcesMoveInfo', + 'RoleDefinition', + 'ScopedDeployment', + 'ScopedDeploymentWhatIf', + 'Sku', + 'StatusMessage', + 'SubResource', + 'TagCount', + 'TagDetails', + 'Tags', + 'TagsPatchResource', + 'TagsResource', + 'TagValue', + 'TargetResource', + 'TemplateHashResult', + 'TemplateLink', + 'WhatIfChange', + 'WhatIfOperationResult', + 'WhatIfPropertyChange', + 'OperationPaged', + 'DeploymentExtendedPaged', + 'ProviderPaged', + 'GenericResourceExpandedPaged', + 'ResourceGroupPaged', + 'TagDetailsPaged', + 'DeploymentOperationPaged', + 'DeploymentMode', + 'OnErrorDeploymentType', + 'ExpressionEvaluationOptionsScopeType', + 'WhatIfResultFormat', + 'AliasPathTokenType', + 'AliasPathAttributes', + 'AliasPatternType', + 'AliasType', + 'ProviderAuthorizationConsentState', + 'ProvisioningState', + 'ResourceIdentityType', + 'ExtendedLocationType', + 'ProvisioningOperation', + 'PropertyChangeType', + 'ChangeType', + 'TagsPatchOperation', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models.py new file mode 100644 index 000000000000..ef5589a8a517 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models.py @@ -0,0 +1,2515 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Alias(Model): + """The alias type. . + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2021_04_01.models.AliasPath] + :param type: The type of the alias. Possible values include: + 'NotSpecified', 'PlainText', 'Mask' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasType + :param default_path: The default path for an alias. + :type default_path: str + :param default_pattern: The default pattern for an alias. + :type default_pattern: + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPattern + :ivar default_metadata: The default alias path metadata. Applies to the + default path and to any alias path that doesn't have metadata + :vartype default_metadata: + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPathMetadata + """ + + _validation = { + 'default_metadata': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPath]'}, + 'type': {'key': 'type', 'type': 'AliasType'}, + 'default_path': {'key': 'defaultPath', 'type': 'str'}, + 'default_pattern': {'key': 'defaultPattern', 'type': 'AliasPattern'}, + 'default_metadata': {'key': 'defaultMetadata', 'type': 'AliasPathMetadata'}, + } + + def __init__(self, **kwargs): + super(Alias, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.paths = kwargs.get('paths', None) + self.type = kwargs.get('type', None) + self.default_path = kwargs.get('default_path', None) + self.default_pattern = kwargs.get('default_pattern', None) + self.default_metadata = None + + +class AliasPath(Model): + """The type of the paths for alias. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param path: The path of an alias. + :type path: str + :param api_versions: The API versions. + :type api_versions: list[str] + :param pattern: The pattern for an alias path. + :type pattern: + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPattern + :ivar metadata: The metadata of the alias path. If missing, fall back to + the default metadata of the alias. + :vartype metadata: + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPathMetadata + """ + + _validation = { + 'metadata': {'readonly': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'pattern': {'key': 'pattern', 'type': 'AliasPattern'}, + 'metadata': {'key': 'metadata', 'type': 'AliasPathMetadata'}, + } + + def __init__(self, **kwargs): + super(AliasPath, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.api_versions = kwargs.get('api_versions', None) + self.pattern = kwargs.get('pattern', None) + self.metadata = None + + +class AliasPathMetadata(Model): + """AliasPathMetadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the token that the alias path is referring to. + Possible values include: 'NotSpecified', 'Any', 'String', 'Object', + 'Array', 'Integer', 'Number', 'Boolean' + :vartype type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPathTokenType + :ivar attributes: The attributes of the token that the alias path is + referring to. Possible values include: 'None', 'Modifiable' + :vartype attributes: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPathAttributes + """ + + _validation = { + 'type': {'readonly': True}, + 'attributes': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AliasPathMetadata, self).__init__(**kwargs) + self.type = None + self.attributes = None + + +class AliasPattern(Model): + """The type of the pattern for an alias path. + + :param phrase: The alias pattern phrase. + :type phrase: str + :param variable: The alias pattern variable. + :type variable: str + :param type: The type of alias pattern. Possible values include: + 'NotSpecified', 'Extract' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPatternType + """ + + _attribute_map = { + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'variable': {'key': 'variable', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'AliasPatternType'}, + } + + def __init__(self, **kwargs): + super(AliasPattern, self).__init__(**kwargs) + self.phrase = kwargs.get('phrase', None) + self.variable = kwargs.get('variable', None) + self.type = kwargs.get('type', None) + + +class ApiProfile(Model): + """ApiProfile. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar profile_version: The profile version. + :vartype profile_version: str + :ivar api_version: The API version. + :vartype api_version: str + """ + + _validation = { + 'profile_version': {'readonly': True}, + 'api_version': {'readonly': True}, + } + + _attribute_map = { + 'profile_version': {'key': 'profileVersion', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiProfile, self).__init__(**kwargs) + self.profile_version = None + self.api_version = None + + +class BasicDependency(Model): + """Deployment dependency information. + + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BasicDependency, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) + + +class CloudError(Model): + """An error response for a resource management request. + + :param error: + :type error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + 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 DebugSetting(Model): + """The debug setting. + + :param detail_level: Specifies the type of information to log for + debugging. The permitted values are none, requestContent, responseContent, + or both requestContent and responseContent separated by a comma. The + default is none. When setting this value, carefully consider the type of + information you are passing in during deployment. By logging information + about the request or response, you could potentially expose sensitive data + that is retrieved through the deployment operations. + :type detail_level: str + """ + + _attribute_map = { + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = kwargs.get('detail_level', None) + + +class Dependency(Model): + """Deployment dependency information. + + :param depends_on: The list of dependencies. + :type depends_on: + list[~azure.mgmt.resource.resources.v2021_04_01.models.BasicDependency] + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dependency, self).__init__(**kwargs) + self.depends_on = kwargs.get('depends_on', None) + self.id = kwargs.get('id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_name = kwargs.get('resource_name', None) + + +class Deployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Deployment, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + + +class DeploymentExportResult(Model): + """The deployment export result. . + + :param template: The template content. + :type template: object + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + + +class DeploymentExtended(Model): + """Deployment information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the deployment. + :vartype id: str + :ivar name: The name of the deployment. + :vartype name: str + :ivar type: The type of the deployment. + :vartype type: str + :param location: the location of the deployment. + :type location: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentPropertiesExtended + :param tags: Deployment tags + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + + +class DeploymentExtendedFilter(Model): + """Deployment filter. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class DeploymentOperation(Model): + """Deployment operation information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full deployment operation ID. + :vartype id: str + :ivar operation_id: Deployment operation ID. + :vartype operation_id: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, + } + + def __init__(self, **kwargs): + super(DeploymentOperation, self).__init__(**kwargs) + self.id = None + self.operation_id = None + self.properties = kwargs.get('properties', None) + + +class DeploymentOperationProperties(Model): + """Deployment operation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_operation: The name of the current provisioning + operation. Possible values include: 'NotSpecified', 'Create', 'Delete', + 'Waiting', 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', + 'Read', 'EvaluateDeploymentOutput', 'DeploymentCleanup' + :vartype provisioning_operation: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ProvisioningOperation + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar timestamp: The date and time of the operation. + :vartype timestamp: datetime + :ivar duration: The duration of the operation. + :vartype duration: str + :ivar service_request_id: Deployment operation service request id. + :vartype service_request_id: str + :ivar status_code: Operation status code from the resource provider. This + property may not be set if a response has not yet been received. + :vartype status_code: str + :ivar status_message: Operation status message from the resource provider. + This property is optional. It will only be provided if an error was + received from the resource provider. + :vartype status_message: + ~azure.mgmt.resource.resources.v2021_04_01.models.StatusMessage + :ivar target_resource: The target resource. + :vartype target_resource: + ~azure.mgmt.resource.resources.v2021_04_01.models.TargetResource + :ivar request: The HTTP request message. + :vartype request: + ~azure.mgmt.resource.resources.v2021_04_01.models.HttpMessage + :ivar response: The HTTP response message. + :vartype response: + ~azure.mgmt.resource.resources.v2021_04_01.models.HttpMessage + """ + + _validation = { + 'provisioning_operation': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'duration': {'readonly': True}, + 'service_request_id': {'readonly': True}, + 'status_code': {'readonly': True}, + 'status_message': {'readonly': True}, + 'target_resource': {'readonly': True}, + 'request': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_operation': {'key': 'provisioningOperation', 'type': 'ProvisioningOperation'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'StatusMessage'}, + 'target_resource': {'key': 'targetResource', 'type': 'TargetResource'}, + 'request': {'key': 'request', 'type': 'HttpMessage'}, + 'response': {'key': 'response', 'type': 'HttpMessage'}, + } + + def __init__(self, **kwargs): + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_operation = None + self.provisioning_state = None + self.timestamp = None + self.duration = None + self.service_request_id = None + self.status_code = None + self.status_message = None + self.target_resource = None + self.request = None + self.response = None + + +class DeploymentProperties(Model): + """Deployment properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2021_04_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeployment + :param expression_evaluation_options: Specifies whether template + expressions are evaluated within the scope of the parent template or + nested template. Only applicable to nested templates. If not specified, + default value is outer. + :type expression_evaluation_options: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExpressionEvaluationOptions + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + 'expression_evaluation_options': {'key': 'expressionEvaluationOptions', 'type': 'ExpressionEvaluationOptions'}, + } + + def __init__(self, **kwargs): + super(DeploymentProperties, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.template_link = kwargs.get('template_link', None) + self.parameters = kwargs.get('parameters', None) + self.parameters_link = kwargs.get('parameters_link', None) + self.mode = kwargs.get('mode', None) + self.debug_setting = kwargs.get('debug_setting', None) + self.on_error_deployment = kwargs.get('on_error_deployment', None) + self.expression_evaluation_options = kwargs.get('expression_evaluation_options', None) + + +class DeploymentPropertiesExtended(Model): + """Deployment properties with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Denotes the state of provisioning. Possible + values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ProvisioningState + :ivar correlation_id: The correlation ID of the deployment. + :vartype correlation_id: str + :ivar timestamp: The timestamp of the template deployment. + :vartype timestamp: datetime + :ivar duration: The duration of the template deployment. + :vartype duration: str + :ivar outputs: Key/value pairs that represent deployment output. + :vartype outputs: object + :ivar providers: The list of resource providers needed for the deployment. + :vartype providers: + list[~azure.mgmt.resource.resources.v2021_04_01.models.Provider] + :ivar dependencies: The list of deployment dependencies. + :vartype dependencies: + list[~azure.mgmt.resource.resources.v2021_04_01.models.Dependency] + :ivar template_link: The URI referencing the template. + :vartype template_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.TemplateLink + :ivar parameters: Deployment parameters. + :vartype parameters: object + :ivar parameters_link: The URI referencing the parameters. + :vartype parameters_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.ParametersLink + :ivar mode: The deployment mode. Possible values are Incremental and + Complete. Possible values include: 'Incremental', 'Complete' + :vartype mode: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentMode + :ivar debug_setting: The debug setting of the deployment. + :vartype debug_setting: + ~azure.mgmt.resource.resources.v2021_04_01.models.DebugSetting + :ivar on_error_deployment: The deployment on error behavior. + :vartype on_error_deployment: + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeploymentExtended + :ivar template_hash: The hash produced for the template. + :vartype template_hash: str + :ivar output_resources: Array of provisioned resources. + :vartype output_resources: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ResourceReference] + :ivar validated_resources: Array of validated resources. + :vartype validated_resources: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ResourceReference] + :ivar error: The deployment error. + :vartype error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'duration': {'readonly': True}, + 'outputs': {'readonly': True}, + 'providers': {'readonly': True}, + 'dependencies': {'readonly': True}, + 'template_link': {'readonly': True}, + 'parameters': {'readonly': True}, + 'parameters_link': {'readonly': True}, + 'mode': {'readonly': True}, + 'debug_setting': {'readonly': True}, + 'on_error_deployment': {'readonly': True}, + 'template_hash': {'readonly': True}, + 'output_resources': {'readonly': True}, + 'validated_resources': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'providers': {'key': 'providers', 'type': '[Provider]'}, + 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeploymentExtended'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + 'output_resources': {'key': 'outputResources', 'type': '[ResourceReference]'}, + 'validated_resources': {'key': 'validatedResources', 'type': '[ResourceReference]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.correlation_id = None + self.timestamp = None + self.duration = None + self.outputs = None + self.providers = None + self.dependencies = None + self.template_link = None + self.parameters = None + self.parameters_link = None + self.mode = None + self.debug_setting = None + self.on_error_deployment = None + self.template_hash = None + self.output_resources = None + self.validated_resources = None + self.error = None + + +class DeploymentValidateResult(Model): + """Information from validate template deployment response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: The deployment validation error. + :vartype error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + :param properties: The template deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentPropertiesExtended + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, **kwargs): + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = None + self.properties = kwargs.get('properties', None) + + +class DeploymentWhatIf(Model): + """Deployment What-if operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfProperties + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'}, + } + + def __init__(self, **kwargs): + super(DeploymentWhatIf, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + + +class DeploymentWhatIfProperties(DeploymentProperties): + """Deployment What-if properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2021_04_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeployment + :param expression_evaluation_options: Specifies whether template + expressions are evaluated within the scope of the parent template or + nested template. Only applicable to nested templates. If not specified, + default value is outer. + :type expression_evaluation_options: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExpressionEvaluationOptions + :param what_if_settings: Optional What-If operation settings. + :type what_if_settings: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfSettings + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + 'expression_evaluation_options': {'key': 'expressionEvaluationOptions', 'type': 'ExpressionEvaluationOptions'}, + 'what_if_settings': {'key': 'whatIfSettings', 'type': 'DeploymentWhatIfSettings'}, + } + + def __init__(self, **kwargs): + super(DeploymentWhatIfProperties, self).__init__(**kwargs) + self.what_if_settings = kwargs.get('what_if_settings', None) + + +class DeploymentWhatIfSettings(Model): + """Deployment What-If operation settings. + + :param result_format: The format of the What-If results. Possible values + include: 'ResourceIdOnly', 'FullResourcePayloads' + :type result_format: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfResultFormat + """ + + _attribute_map = { + 'result_format': {'key': 'resultFormat', 'type': 'WhatIfResultFormat'}, + } + + def __init__(self, **kwargs): + super(DeploymentWhatIfSettings, self).__init__(**kwargs) + self.result_format = kwargs.get('result_format', None) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.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.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ExportTemplateRequest(Model): + """Export resource group template request parameters. + + :param resources: The IDs of the resources to filter the export by. To + export all resources, supply an array with single entry '*'. + :type resources: list[str] + :param options: The export template options. A CSV-formatted list + containing zero or more of the following: 'IncludeParameterDefaultValue', + 'IncludeComments', 'SkipResourceNameParameterization', + 'SkipAllParameterization' + :type options: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'options': {'key': 'options', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.options = kwargs.get('options', None) + + +class ExpressionEvaluationOptions(Model): + """Specifies whether template expressions are evaluated within the scope of + the parent template or nested template. + + :param scope: The scope to be used for evaluation of parameters, variables + and functions in a nested template. Possible values include: + 'NotSpecified', 'Outer', 'Inner' + :type scope: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ExpressionEvaluationOptionsScopeType + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressionEvaluationOptions, self).__init__(**kwargs) + self.scope = kwargs.get('scope', None) + + +class ExtendedLocation(Model): + """Resource extended location. + + :param type: The extended location type. Possible values include: + 'EdgeZone' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ExtendedLocationType + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class Resource(Model): + """Specified resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.extended_location = kwargs.get('extended_location', None) + self.tags = kwargs.get('tags', None) + + +class GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2021_04_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2021_04_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2021_04_01.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, **kwargs): + super(GenericResource, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.properties = kwargs.get('properties', None) + self.kind = kwargs.get('kind', None) + self.managed_by = kwargs.get('managed_by', None) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) + + +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2021_04_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2021_04_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2021_04_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceExpanded, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + +class GenericResourceFilter(Model): + """Resource filter. + + :param resource_type: The resource type. + :type resource_type: str + :param tagname: The tag name. + :type tagname: str + :param tagvalue: The tag value. + :type tagvalue: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'tagname': {'key': 'tagname', 'type': 'str'}, + 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.tagname = kwargs.get('tagname', None) + self.tagvalue = kwargs.get('tagvalue', None) + + +class HttpMessage(Model): + """HTTP message. + + :param content: HTTP message content. + :type content: object + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(HttpMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the resource. The user identity dictionary key references will be ARM + resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.resource.resources.v2021_04_01.models.IdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'}, + } + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class IdentityUserAssignedIdentitiesValue(Model): + """IdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class OnErrorDeployment(Model): + """Deployment on error behavior. + + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OnErrorDeployment, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.deployment_name = kwargs.get('deployment_name', None) + + +class OnErrorDeploymentExtended(Model): + """Deployment on error behavior with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning for the on error + deployment. + :vartype provisioning_state: str + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OnErrorDeploymentExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.type = kwargs.get('type', None) + self.deployment_name = kwargs.get('deployment_name', None) + + +class Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.resources.v2021_04_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ParametersLink(Model): + """Entity representing the reference to the deployment parameters. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ParametersLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) + + +class Permission(Model): + """Role definition permissions. + + :param actions: Allowed actions. + :type actions: list[str] + :param not_actions: Denied actions. + :type not_actions: list[str] + :param data_actions: Allowed Data actions. + :type data_actions: list[str] + :param not_data_actions: Denied Data actions. + :type not_data_actions: list[str] + """ + + _attribute_map = { + 'actions': {'key': 'actions', 'type': '[str]'}, + 'not_actions': {'key': 'notActions', 'type': '[str]'}, + 'data_actions': {'key': 'dataActions', 'type': '[str]'}, + 'not_data_actions': {'key': 'notDataActions', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(Permission, self).__init__(**kwargs) + self.actions = kwargs.get('actions', None) + self.not_actions = kwargs.get('not_actions', None) + self.data_actions = kwargs.get('data_actions', None) + self.not_data_actions = kwargs.get('not_data_actions', None) + + +class Plan(Model): + """Plan for the resource. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The offer ID. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: The plan's version. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.version = kwargs.get('version', None) + + +class Provider(Model): + """Resource provider information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The provider ID. + :vartype id: str + :param namespace: The namespace of the resource provider. + :type namespace: str + :ivar registration_state: The registration state of the resource provider. + :vartype registration_state: str + :ivar registration_policy: The registration policy of the resource + provider. + :vartype registration_policy: str + :ivar resource_types: The collection of provider resource types. + :vartype resource_types: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ProviderResourceType] + :param provider_authorization_consent_state: The provider authorization + consent state. Possible values include: 'NotSpecified', 'Required', + 'NotRequired', 'Consented' + :type provider_authorization_consent_state: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderAuthorizationConsentState + """ + + _validation = { + 'id': {'readonly': True}, + 'registration_state': {'readonly': True}, + 'registration_policy': {'readonly': True}, + 'resource_types': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'registration_state': {'key': 'registrationState', 'type': 'str'}, + 'registration_policy': {'key': 'registrationPolicy', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, + 'provider_authorization_consent_state': {'key': 'providerAuthorizationConsentState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Provider, self).__init__(**kwargs) + self.id = None + self.namespace = kwargs.get('namespace', None) + self.registration_state = None + self.registration_policy = None + self.resource_types = None + self.provider_authorization_consent_state = kwargs.get('provider_authorization_consent_state', None) + + +class ProviderConsentDefinition(Model): + """The provider consent. + + :param consent_to_authorization: A value indicating whether authorization + is consented or not. + :type consent_to_authorization: bool + """ + + _attribute_map = { + 'consent_to_authorization': {'key': 'consentToAuthorization', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ProviderConsentDefinition, self).__init__(**kwargs) + self.consent_to_authorization = kwargs.get('consent_to_authorization', None) + + +class ProviderExtendedLocation(Model): + """The provider extended location. . + + :param location: The azure location. + :type location: str + :param type: The extended location type. + :type type: str + :param extended_locations: The extended locations for the azure location. + :type extended_locations: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ProviderExtendedLocation, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.type = kwargs.get('type', None) + self.extended_locations = kwargs.get('extended_locations', None) + + +class ProviderPermission(Model): + """The provider permission. + + :param application_id: The application id. + :type application_id: str + :param role_definition: Role definition properties. + :type role_definition: + ~azure.mgmt.resource.resources.v2021_04_01.models.RoleDefinition + :param managed_by_role_definition: Role definition properties. + :type managed_by_role_definition: + ~azure.mgmt.resource.resources.v2021_04_01.models.RoleDefinition + :param provider_authorization_consent_state: The provider authorization + consent state. Possible values include: 'NotSpecified', 'Required', + 'NotRequired', 'Consented' + :type provider_authorization_consent_state: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderAuthorizationConsentState + """ + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'role_definition': {'key': 'roleDefinition', 'type': 'RoleDefinition'}, + 'managed_by_role_definition': {'key': 'managedByRoleDefinition', 'type': 'RoleDefinition'}, + 'provider_authorization_consent_state': {'key': 'providerAuthorizationConsentState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProviderPermission, self).__init__(**kwargs) + self.application_id = kwargs.get('application_id', None) + self.role_definition = kwargs.get('role_definition', None) + self.managed_by_role_definition = kwargs.get('managed_by_role_definition', None) + self.provider_authorization_consent_state = kwargs.get('provider_authorization_consent_state', None) + + +class ProviderPermissionListResult(Model): + """List of provider permissions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: An array of provider permissions. + :type value: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ProviderPermission] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProviderPermission]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProviderPermissionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ProviderRegistrationRequest(Model): + """The provider registration definition. + + :param third_party_provider_consent: The provider consent. + :type third_party_provider_consent: + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderConsentDefinition + """ + + _attribute_map = { + 'third_party_provider_consent': {'key': 'thirdPartyProviderConsent', 'type': 'ProviderConsentDefinition'}, + } + + def __init__(self, **kwargs): + super(ProviderRegistrationRequest, self).__init__(**kwargs) + self.third_party_provider_consent = kwargs.get('third_party_provider_consent', None) + + +class ProviderResourceType(Model): + """Resource type managed by the resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param resource_type: The resource type. + :type resource_type: str + :param locations: The collection of locations where this resource type can + be created. + :type locations: list[str] + :param location_mappings: The location mappings that are supported by this + resource type. + :type location_mappings: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ProviderExtendedLocation] + :param aliases: The aliases that are supported by this resource type. + :type aliases: + list[~azure.mgmt.resource.resources.v2021_04_01.models.Alias] + :param api_versions: The API version. + :type api_versions: list[str] + :ivar default_api_version: The default API version. + :vartype default_api_version: str + :ivar api_profiles: The API profiles for the resource provider. + :vartype api_profiles: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ApiProfile] + :param capabilities: The additional capabilities offered by this resource + type. + :type capabilities: str + :param properties: The properties. + :type properties: dict[str, str] + """ + + _validation = { + 'default_api_version': {'readonly': True}, + 'api_profiles': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_mappings': {'key': 'locationMappings', 'type': '[ProviderExtendedLocation]'}, + 'aliases': {'key': 'aliases', 'type': '[Alias]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'api_profiles': {'key': 'apiProfiles', 'type': '[ApiProfile]'}, + 'capabilities': {'key': 'capabilities', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.locations = kwargs.get('locations', None) + self.location_mappings = kwargs.get('location_mappings', None) + self.aliases = kwargs.get('aliases', None) + self.api_versions = kwargs.get('api_versions', None) + self.default_api_version = None + self.api_profiles = None + self.capabilities = kwargs.get('capabilities', None) + self.properties = kwargs.get('properties', None) + + +class ProviderResourceTypeListResult(Model): + """List of resource types of a resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: An array of resource types. + :type value: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ProviderResourceType] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProviderResourceType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProviderResourceTypeListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ResourceGroup(Model): + """Resource group information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the resource group. + :vartype id: str + :ivar name: The name of the resource group. + :vartype name: str + :ivar type: The type of the resource group. + :vartype type: str + :param properties: The resource group properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroupProperties + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It must be one of + the supported Azure locations. + :type location: str + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceGroup, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) + self.location = kwargs.get('location', None) + self.managed_by = kwargs.get('managed_by', None) + self.tags = kwargs.get('tags', None) + + +class ResourceGroupExportResult(Model): + """Resource group export result. + + :param template: The template content. + :type template: object + :param error: The template export error. + :type error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = kwargs.get('template', None) + self.error = kwargs.get('error', None) + + +class ResourceGroupFilter(Model): + """Resource group filter. + + :param tag_name: The tag name. + :type tag_name: str + :param tag_value: The tag value. + :type tag_value: str + """ + + _attribute_map = { + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = kwargs.get('tag_name', None) + self.tag_value = kwargs.get('tag_value', None) + + +class ResourceGroupPatchable(Model): + """Resource group information. + + :param name: The name of the resource group. + :type name: str + :param properties: The resource group properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroupProperties + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupPatchable, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.managed_by = kwargs.get('managed_by', None) + self.tags = kwargs.get('tags', None) + + +class ResourceGroupProperties(Model): + """The resource group properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupProperties, self).__init__(**kwargs) + self.provisioning_state = None + + +class ResourceProviderOperationDisplayProperties(Model): + """Resource provider operation's display properties. + + :param publisher: Operation description. + :type publisher: str + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Resource provider operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceReference(Model): + """The resource Id model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified resource Id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceReference, self).__init__(**kwargs) + self.id = None + + +class ResourcesMoveInfo(Model): + """Parameters of move resources. + + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = kwargs.get('resources', None) + self.target_resource_group = kwargs.get('target_resource_group', None) + + +class RoleDefinition(Model): + """Role definition properties. + + :param id: The role definition ID. + :type id: str + :param name: The role definition name. + :type name: str + :param is_service_role: If this is a service role. + :type is_service_role: bool + :param permissions: Role definition permissions. + :type permissions: + list[~azure.mgmt.resource.resources.v2021_04_01.models.Permission] + :param scopes: Role definition assignable scopes. + :type scopes: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_service_role': {'key': 'isServiceRole', 'type': 'bool'}, + 'permissions': {'key': 'permissions', 'type': '[Permission]'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(RoleDefinition, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.is_service_role = kwargs.get('is_service_role', None) + self.permissions = kwargs.get('permissions', None) + self.scopes = kwargs.get('scopes', None) + + +class ScopedDeployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ScopedDeployment, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + + +class ScopedDeploymentWhatIf(Model): + """Deployment What-if operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfProperties + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'}, + } + + def __init__(self, **kwargs): + super(ScopedDeploymentWhatIf, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + + +class Sku(Model): + """SKU for the resource. + + :param name: The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + :param size: The SKU size. + :type size: str + :param family: The SKU family. + :type family: str + :param model: The SKU model. + :type model: str + :param capacity: The SKU capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.model = kwargs.get('model', None) + self.capacity = kwargs.get('capacity', None) + + +class StatusMessage(Model): + """Operation status message object. + + :param status: Status of the deployment operation. + :type status: str + :param error: The error reported by the operation. + :type error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(StatusMessage, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + +class SubResource(Model): + """Sub-resource. + + :param id: Resource ID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class TagCount(Model): + """Tag count. + + :param type: Type of count. + :type type: str + :param value: Value of count. + :type value: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(TagCount, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) + + +class TagDetails(Model): + """Tag details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag name ID. + :vartype id: str + :param tag_name: The tag name. + :type tag_name: str + :param count: The total number of resources that use the resource tag. + When a tag is initially created and has no associated resources, the value + is 0. + :type count: ~azure.mgmt.resource.resources.v2021_04_01.models.TagCount + :param values: The list of tag values. + :type values: + list[~azure.mgmt.resource.resources.v2021_04_01.models.TagValue] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + 'values': {'key': 'values', 'type': '[TagValue]'}, + } + + def __init__(self, **kwargs): + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = kwargs.get('tag_name', None) + self.count = kwargs.get('count', None) + self.values = kwargs.get('values', None) + + +class Tags(Model): + """A dictionary of name and value pairs. + + :param tags: + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Tags, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class TagsPatchResource(Model): + """Wrapper resource for tags patch API request only. + + :param operation: The operation type for the patch API. Possible values + include: 'Replace', 'Merge', 'Delete' + :type operation: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.TagsPatchOperation + :param properties: The set of tags. + :type properties: ~azure.mgmt.resource.resources.v2021_04_01.models.Tags + """ + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Tags'}, + } + + def __init__(self, **kwargs): + super(TagsPatchResource, self).__init__(**kwargs) + self.operation = kwargs.get('operation', None) + self.properties = kwargs.get('properties', None) + + +class TagsResource(Model): + """Wrapper resource for tags API requests and responses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the tags wrapper resource. + :vartype id: str + :ivar name: The name of the tags wrapper resource. + :vartype name: str + :ivar type: The type of the tags wrapper resource. + :vartype type: str + :param properties: Required. The set of tags. + :type properties: ~azure.mgmt.resource.resources.v2021_04_01.models.Tags + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Tags'}, + } + + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) + + +class TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag value ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2021_04_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, **kwargs): + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = kwargs.get('tag_value', None) + self.count = kwargs.get('count', None) + + +class TargetResource(Model): + """Target resource. + + :param id: The ID of the resource. + :type id: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_type: The type of the resource. + :type resource_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TargetResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_type = kwargs.get('resource_type', None) + + +class TemplateHashResult(Model): + """Result of the request to calculate template hash. It contains a string of + minified template and its hash. + + :param minified_template: The minified template string. + :type minified_template: str + :param template_hash: The template hash. + :type template_hash: str + """ + + _attribute_map = { + 'minified_template': {'key': 'minifiedTemplate', 'type': 'str'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TemplateHashResult, self).__init__(**kwargs) + self.minified_template = kwargs.get('minified_template', None) + self.template_hash = kwargs.get('template_hash', None) + + +class TemplateLink(Model): + """Entity representing the reference to the template. + + :param uri: The URI of the template to deploy. Use either the uri or id + property, but not both. + :type uri: str + :param id: The resource id of a Template Spec. Use either the id or uri + property, but not both. + :type id: str + :param relative_path: The relativePath property can be used to deploy a + linked template at a location relative to the parent. If the parent + template was linked with a TemplateSpec, this will reference an artifact + in the TemplateSpec. If the parent was linked with a URI, the child + deployment will be a combination of the parent and relativePath URIs + :type relative_path: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + :param query_string: The query string (for example, a SAS token) to be + used with the templateLink URI. + :type query_string: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TemplateLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.id = kwargs.get('id', None) + self.relative_path = kwargs.get('relative_path', None) + self.content_version = kwargs.get('content_version', None) + self.query_string = kwargs.get('query_string', None) + + +class WhatIfChange(Model): + """Information about a single resource change predicted by What-If operation. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. Resource ID + :type resource_id: str + :param change_type: Required. Type of change that will be made to the + resource when the deployment is executed. Possible values include: + 'Create', 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify', + 'Unsupported' + :type change_type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ChangeType + :param unsupported_reason: The explanation about why the resource is + unsupported by What-If. + :type unsupported_reason: str + :param before: The snapshot of the resource before the deployment is + executed. + :type before: object + :param after: The predicted snapshot of the resource after the deployment + is executed. + :type after: object + :param delta: The predicted changes to resource properties. + :type delta: + list[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfPropertyChange] + """ + + _validation = { + 'resource_id': {'required': True}, + 'change_type': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'change_type': {'key': 'changeType', 'type': 'ChangeType'}, + 'unsupported_reason': {'key': 'unsupportedReason', 'type': 'str'}, + 'before': {'key': 'before', 'type': 'object'}, + 'after': {'key': 'after', 'type': 'object'}, + 'delta': {'key': 'delta', 'type': '[WhatIfPropertyChange]'}, + } + + def __init__(self, **kwargs): + super(WhatIfChange, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.change_type = kwargs.get('change_type', None) + self.unsupported_reason = kwargs.get('unsupported_reason', None) + self.before = kwargs.get('before', None) + self.after = kwargs.get('after', None) + self.delta = kwargs.get('delta', None) + + +class WhatIfOperationResult(Model): + """Result of the What-If operation. Contains a list of predicted changes and a + URL link to get to the next set of results. + + :param status: Status of the What-If operation. + :type status: str + :param changes: List of resource changes predicted by What-If operation. + :type changes: + list[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfChange] + :param error: Error when What-If operation fails. + :type error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'changes': {'key': 'properties.changes', 'type': '[WhatIfChange]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(WhatIfOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.changes = kwargs.get('changes', None) + self.error = kwargs.get('error', None) + + +class WhatIfPropertyChange(Model): + """The predicted change to the resource property. + + All required parameters must be populated in order to send to Azure. + + :param path: Required. The path of the property. + :type path: str + :param property_change_type: Required. The type of property change. + Possible values include: 'Create', 'Delete', 'Modify', 'Array', 'NoEffect' + :type property_change_type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.PropertyChangeType + :param before: The value of the property before the deployment is + executed. + :type before: object + :param after: The value of the property after the deployment is executed. + :type after: object + :param children: Nested property changes. + :type children: + list[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfPropertyChange] + """ + + _validation = { + 'path': {'required': True}, + 'property_change_type': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'property_change_type': {'key': 'propertyChangeType', 'type': 'PropertyChangeType'}, + 'before': {'key': 'before', 'type': 'object'}, + 'after': {'key': 'after', 'type': 'object'}, + 'children': {'key': 'children', 'type': '[WhatIfPropertyChange]'}, + } + + def __init__(self, **kwargs): + super(WhatIfPropertyChange, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.property_change_type = kwargs.get('property_change_type', None) + self.before = kwargs.get('before', None) + self.after = kwargs.get('after', None) + self.children = kwargs.get('children', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models_py3.py new file mode 100644 index 000000000000..d5a8481ff619 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models_py3.py @@ -0,0 +1,2515 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Alias(Model): + """The alias type. . + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The alias name. + :type name: str + :param paths: The paths for an alias. + :type paths: + list[~azure.mgmt.resource.resources.v2021_04_01.models.AliasPath] + :param type: The type of the alias. Possible values include: + 'NotSpecified', 'PlainText', 'Mask' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasType + :param default_path: The default path for an alias. + :type default_path: str + :param default_pattern: The default pattern for an alias. + :type default_pattern: + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPattern + :ivar default_metadata: The default alias path metadata. Applies to the + default path and to any alias path that doesn't have metadata + :vartype default_metadata: + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPathMetadata + """ + + _validation = { + 'default_metadata': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'paths': {'key': 'paths', 'type': '[AliasPath]'}, + 'type': {'key': 'type', 'type': 'AliasType'}, + 'default_path': {'key': 'defaultPath', 'type': 'str'}, + 'default_pattern': {'key': 'defaultPattern', 'type': 'AliasPattern'}, + 'default_metadata': {'key': 'defaultMetadata', 'type': 'AliasPathMetadata'}, + } + + def __init__(self, *, name: str=None, paths=None, type=None, default_path: str=None, default_pattern=None, **kwargs) -> None: + super(Alias, self).__init__(**kwargs) + self.name = name + self.paths = paths + self.type = type + self.default_path = default_path + self.default_pattern = default_pattern + self.default_metadata = None + + +class AliasPath(Model): + """The type of the paths for alias. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param path: The path of an alias. + :type path: str + :param api_versions: The API versions. + :type api_versions: list[str] + :param pattern: The pattern for an alias path. + :type pattern: + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPattern + :ivar metadata: The metadata of the alias path. If missing, fall back to + the default metadata of the alias. + :vartype metadata: + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPathMetadata + """ + + _validation = { + 'metadata': {'readonly': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'pattern': {'key': 'pattern', 'type': 'AliasPattern'}, + 'metadata': {'key': 'metadata', 'type': 'AliasPathMetadata'}, + } + + def __init__(self, *, path: str=None, api_versions=None, pattern=None, **kwargs) -> None: + super(AliasPath, self).__init__(**kwargs) + self.path = path + self.api_versions = api_versions + self.pattern = pattern + self.metadata = None + + +class AliasPathMetadata(Model): + """AliasPathMetadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the token that the alias path is referring to. + Possible values include: 'NotSpecified', 'Any', 'String', 'Object', + 'Array', 'Integer', 'Number', 'Boolean' + :vartype type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPathTokenType + :ivar attributes: The attributes of the token that the alias path is + referring to. Possible values include: 'None', 'Modifiable' + :vartype attributes: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPathAttributes + """ + + _validation = { + 'type': {'readonly': True}, + 'attributes': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AliasPathMetadata, self).__init__(**kwargs) + self.type = None + self.attributes = None + + +class AliasPattern(Model): + """The type of the pattern for an alias path. + + :param phrase: The alias pattern phrase. + :type phrase: str + :param variable: The alias pattern variable. + :type variable: str + :param type: The type of alias pattern. Possible values include: + 'NotSpecified', 'Extract' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.AliasPatternType + """ + + _attribute_map = { + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'variable': {'key': 'variable', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'AliasPatternType'}, + } + + def __init__(self, *, phrase: str=None, variable: str=None, type=None, **kwargs) -> None: + super(AliasPattern, self).__init__(**kwargs) + self.phrase = phrase + self.variable = variable + self.type = type + + +class ApiProfile(Model): + """ApiProfile. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar profile_version: The profile version. + :vartype profile_version: str + :ivar api_version: The API version. + :vartype api_version: str + """ + + _validation = { + 'profile_version': {'readonly': True}, + 'api_version': {'readonly': True}, + } + + _attribute_map = { + 'profile_version': {'key': 'profileVersion', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApiProfile, self).__init__(**kwargs) + self.profile_version = None + self.api_version = None + + +class BasicDependency(Model): + """Deployment dependency information. + + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(BasicDependency, self).__init__(**kwargs) + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name + + +class CloudError(Model): + """An error response for a resource management request. + + :param error: + :type error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + 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 DebugSetting(Model): + """The debug setting. + + :param detail_level: Specifies the type of information to log for + debugging. The permitted values are none, requestContent, responseContent, + or both requestContent and responseContent separated by a comma. The + default is none. When setting this value, carefully consider the type of + information you are passing in during deployment. By logging information + about the request or response, you could potentially expose sensitive data + that is retrieved through the deployment operations. + :type detail_level: str + """ + + _attribute_map = { + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + } + + def __init__(self, *, detail_level: str=None, **kwargs) -> None: + super(DebugSetting, self).__init__(**kwargs) + self.detail_level = detail_level + + +class Dependency(Model): + """Deployment dependency information. + + :param depends_on: The list of dependencies. + :type depends_on: + list[~azure.mgmt.resource.resources.v2021_04_01.models.BasicDependency] + :param id: The ID of the dependency. + :type id: str + :param resource_type: The dependency resource type. + :type resource_type: str + :param resource_name: The dependency resource name. + :type resource_name: str + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[BasicDependency]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + } + + def __init__(self, *, depends_on=None, id: str=None, resource_type: str=None, resource_name: str=None, **kwargs) -> None: + super(Dependency, self).__init__(**kwargs) + self.depends_on = depends_on + self.id = id + self.resource_type = resource_type + self.resource_name = resource_name + + +class Deployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, properties, location: str=None, tags=None, **kwargs) -> None: + super(Deployment, self).__init__(**kwargs) + self.location = location + self.properties = properties + self.tags = tags + + +class DeploymentExportResult(Model): + """The deployment export result. . + + :param template: The template content. + :type template: object + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, *, template=None, **kwargs) -> None: + super(DeploymentExportResult, self).__init__(**kwargs) + self.template = template + + +class DeploymentExtended(Model): + """Deployment information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the deployment. + :vartype id: str + :ivar name: The name of the deployment. + :vartype name: str + :ivar type: The type of the deployment. + :vartype type: str + :param location: the location of the deployment. + :type location: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentPropertiesExtended + :param tags: Deployment tags + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, properties=None, tags=None, **kwargs) -> None: + super(DeploymentExtended, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.properties = properties + self.tags = tags + + +class DeploymentExtendedFilter(Model): + """Deployment filter. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state: str=None, **kwargs) -> None: + super(DeploymentExtendedFilter, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + + +class DeploymentOperation(Model): + """Deployment operation information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Full deployment operation ID. + :vartype id: str + :ivar operation_id: Deployment operation ID. + :vartype operation_id: str + :param properties: Deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentOperationProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeploymentOperation, self).__init__(**kwargs) + self.id = None + self.operation_id = None + self.properties = properties + + +class DeploymentOperationProperties(Model): + """Deployment operation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_operation: The name of the current provisioning + operation. Possible values include: 'NotSpecified', 'Create', 'Delete', + 'Waiting', 'AzureAsyncOperationWaiting', 'ResourceCacheWaiting', 'Action', + 'Read', 'EvaluateDeploymentOutput', 'DeploymentCleanup' + :vartype provisioning_operation: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ProvisioningOperation + :ivar provisioning_state: The state of the provisioning. + :vartype provisioning_state: str + :ivar timestamp: The date and time of the operation. + :vartype timestamp: datetime + :ivar duration: The duration of the operation. + :vartype duration: str + :ivar service_request_id: Deployment operation service request id. + :vartype service_request_id: str + :ivar status_code: Operation status code from the resource provider. This + property may not be set if a response has not yet been received. + :vartype status_code: str + :ivar status_message: Operation status message from the resource provider. + This property is optional. It will only be provided if an error was + received from the resource provider. + :vartype status_message: + ~azure.mgmt.resource.resources.v2021_04_01.models.StatusMessage + :ivar target_resource: The target resource. + :vartype target_resource: + ~azure.mgmt.resource.resources.v2021_04_01.models.TargetResource + :ivar request: The HTTP request message. + :vartype request: + ~azure.mgmt.resource.resources.v2021_04_01.models.HttpMessage + :ivar response: The HTTP response message. + :vartype response: + ~azure.mgmt.resource.resources.v2021_04_01.models.HttpMessage + """ + + _validation = { + 'provisioning_operation': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'duration': {'readonly': True}, + 'service_request_id': {'readonly': True}, + 'status_code': {'readonly': True}, + 'status_message': {'readonly': True}, + 'target_resource': {'readonly': True}, + 'request': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_operation': {'key': 'provisioningOperation', 'type': 'ProvisioningOperation'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'status_message': {'key': 'statusMessage', 'type': 'StatusMessage'}, + 'target_resource': {'key': 'targetResource', 'type': 'TargetResource'}, + 'request': {'key': 'request', 'type': 'HttpMessage'}, + 'response': {'key': 'response', 'type': 'HttpMessage'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentOperationProperties, self).__init__(**kwargs) + self.provisioning_operation = None + self.provisioning_state = None + self.timestamp = None + self.duration = None + self.service_request_id = None + self.status_code = None + self.status_message = None + self.target_resource = None + self.request = None + self.response = None + + +class DeploymentProperties(Model): + """Deployment properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2021_04_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeployment + :param expression_evaluation_options: Specifies whether template + expressions are evaluated within the scope of the parent template or + nested template. Only applicable to nested templates. If not specified, + default value is outer. + :type expression_evaluation_options: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExpressionEvaluationOptions + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + 'expression_evaluation_options': {'key': 'expressionEvaluationOptions', 'type': 'ExpressionEvaluationOptions'}, + } + + def __init__(self, *, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None, on_error_deployment=None, expression_evaluation_options=None, **kwargs) -> None: + super(DeploymentProperties, self).__init__(**kwargs) + self.template = template + self.template_link = template_link + self.parameters = parameters + self.parameters_link = parameters_link + self.mode = mode + self.debug_setting = debug_setting + self.on_error_deployment = on_error_deployment + self.expression_evaluation_options = expression_evaluation_options + + +class DeploymentPropertiesExtended(Model): + """Deployment properties with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Denotes the state of provisioning. Possible + values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ProvisioningState + :ivar correlation_id: The correlation ID of the deployment. + :vartype correlation_id: str + :ivar timestamp: The timestamp of the template deployment. + :vartype timestamp: datetime + :ivar duration: The duration of the template deployment. + :vartype duration: str + :ivar outputs: Key/value pairs that represent deployment output. + :vartype outputs: object + :ivar providers: The list of resource providers needed for the deployment. + :vartype providers: + list[~azure.mgmt.resource.resources.v2021_04_01.models.Provider] + :ivar dependencies: The list of deployment dependencies. + :vartype dependencies: + list[~azure.mgmt.resource.resources.v2021_04_01.models.Dependency] + :ivar template_link: The URI referencing the template. + :vartype template_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.TemplateLink + :ivar parameters: Deployment parameters. + :vartype parameters: object + :ivar parameters_link: The URI referencing the parameters. + :vartype parameters_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.ParametersLink + :ivar mode: The deployment mode. Possible values are Incremental and + Complete. Possible values include: 'Incremental', 'Complete' + :vartype mode: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentMode + :ivar debug_setting: The debug setting of the deployment. + :vartype debug_setting: + ~azure.mgmt.resource.resources.v2021_04_01.models.DebugSetting + :ivar on_error_deployment: The deployment on error behavior. + :vartype on_error_deployment: + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeploymentExtended + :ivar template_hash: The hash produced for the template. + :vartype template_hash: str + :ivar output_resources: Array of provisioned resources. + :vartype output_resources: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ResourceReference] + :ivar validated_resources: Array of validated resources. + :vartype validated_resources: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ResourceReference] + :ivar error: The deployment error. + :vartype error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'duration': {'readonly': True}, + 'outputs': {'readonly': True}, + 'providers': {'readonly': True}, + 'dependencies': {'readonly': True}, + 'template_link': {'readonly': True}, + 'parameters': {'readonly': True}, + 'parameters_link': {'readonly': True}, + 'mode': {'readonly': True}, + 'debug_setting': {'readonly': True}, + 'on_error_deployment': {'readonly': True}, + 'template_hash': {'readonly': True}, + 'output_resources': {'readonly': True}, + 'validated_resources': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'providers': {'key': 'providers', 'type': '[Provider]'}, + 'dependencies': {'key': 'dependencies', 'type': '[Dependency]'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeploymentExtended'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + 'output_resources': {'key': 'outputResources', 'type': '[ResourceReference]'}, + 'validated_resources': {'key': 'validatedResources', 'type': '[ResourceReference]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentPropertiesExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.correlation_id = None + self.timestamp = None + self.duration = None + self.outputs = None + self.providers = None + self.dependencies = None + self.template_link = None + self.parameters = None + self.parameters_link = None + self.mode = None + self.debug_setting = None + self.on_error_deployment = None + self.template_hash = None + self.output_resources = None + self.validated_resources = None + self.error = None + + +class DeploymentValidateResult(Model): + """Information from validate template deployment response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: The deployment validation error. + :vartype error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + :param properties: The template deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentPropertiesExtended + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + 'properties': {'key': 'properties', 'type': 'DeploymentPropertiesExtended'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeploymentValidateResult, self).__init__(**kwargs) + self.error = None + self.properties = properties + + +class DeploymentWhatIf(Model): + """Deployment What-if operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfProperties + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'}, + } + + def __init__(self, *, properties, location: str=None, **kwargs) -> None: + super(DeploymentWhatIf, self).__init__(**kwargs) + self.location = location + self.properties = properties + + +class DeploymentWhatIfProperties(DeploymentProperties): + """Deployment What-if properties. + + All required parameters must be populated in order to send to Azure. + + :param template: The template content. You use this element when you want + to pass the template syntax directly in the request rather than link to an + existing template. It can be a JObject or well-formed JSON string. Use + either the templateLink property or the template property, but not both. + :type template: object + :param template_link: The URI of the template. Use either the templateLink + property or the template property, but not both. + :type template_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.TemplateLink + :param parameters: Name and value pairs that define the deployment + parameters for the template. You use this element when you want to provide + the parameter values directly in the request rather than link to an + existing parameter file. Use either the parametersLink property or the + parameters property, but not both. It can be a JObject or a well formed + JSON string. + :type parameters: object + :param parameters_link: The URI of parameters file. You use this element + to link to an existing parameters file. Use either the parametersLink + property or the parameters property, but not both. + :type parameters_link: + ~azure.mgmt.resource.resources.v2021_04_01.models.ParametersLink + :param mode: Required. The mode that is used to deploy resources. This + value can be either Incremental or Complete. In Incremental mode, + resources are deployed without deleting existing resources that are not + included in the template. In Complete mode, resources are deployed and + existing resources in the resource group that are not included in the + template are deleted. Be careful when using Complete mode as you may + unintentionally delete resources. Possible values include: 'Incremental', + 'Complete' + :type mode: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentMode + :param debug_setting: The debug setting of the deployment. + :type debug_setting: + ~azure.mgmt.resource.resources.v2021_04_01.models.DebugSetting + :param on_error_deployment: The deployment on error behavior. + :type on_error_deployment: + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeployment + :param expression_evaluation_options: Specifies whether template + expressions are evaluated within the scope of the parent template or + nested template. Only applicable to nested templates. If not specified, + default value is outer. + :type expression_evaluation_options: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExpressionEvaluationOptions + :param what_if_settings: Optional What-If operation settings. + :type what_if_settings: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfSettings + """ + + _validation = { + 'mode': {'required': True}, + } + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'template_link': {'key': 'templateLink', 'type': 'TemplateLink'}, + 'parameters': {'key': 'parameters', 'type': 'object'}, + 'parameters_link': {'key': 'parametersLink', 'type': 'ParametersLink'}, + 'mode': {'key': 'mode', 'type': 'DeploymentMode'}, + 'debug_setting': {'key': 'debugSetting', 'type': 'DebugSetting'}, + 'on_error_deployment': {'key': 'onErrorDeployment', 'type': 'OnErrorDeployment'}, + 'expression_evaluation_options': {'key': 'expressionEvaluationOptions', 'type': 'ExpressionEvaluationOptions'}, + 'what_if_settings': {'key': 'whatIfSettings', 'type': 'DeploymentWhatIfSettings'}, + } + + def __init__(self, *, mode, template=None, template_link=None, parameters=None, parameters_link=None, debug_setting=None, on_error_deployment=None, expression_evaluation_options=None, what_if_settings=None, **kwargs) -> None: + super(DeploymentWhatIfProperties, self).__init__(template=template, template_link=template_link, parameters=parameters, parameters_link=parameters_link, mode=mode, debug_setting=debug_setting, on_error_deployment=on_error_deployment, expression_evaluation_options=expression_evaluation_options, **kwargs) + self.what_if_settings = what_if_settings + + +class DeploymentWhatIfSettings(Model): + """Deployment What-If operation settings. + + :param result_format: The format of the What-If results. Possible values + include: 'ResourceIdOnly', 'FullResourcePayloads' + :type result_format: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfResultFormat + """ + + _attribute_map = { + 'result_format': {'key': 'resultFormat', 'type': 'WhatIfResultFormat'}, + } + + def __init__(self, *, result_format=None, **kwargs) -> None: + super(DeploymentWhatIfSettings, self).__init__(**kwargs) + self.result_format = result_format + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.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.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ExportTemplateRequest(Model): + """Export resource group template request parameters. + + :param resources: The IDs of the resources to filter the export by. To + export all resources, supply an array with single entry '*'. + :type resources: list[str] + :param options: The export template options. A CSV-formatted list + containing zero or more of the following: 'IncludeParameterDefaultValue', + 'IncludeComments', 'SkipResourceNameParameterization', + 'SkipAllParameterization' + :type options: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'options': {'key': 'options', 'type': 'str'}, + } + + def __init__(self, *, resources=None, options: str=None, **kwargs) -> None: + super(ExportTemplateRequest, self).__init__(**kwargs) + self.resources = resources + self.options = options + + +class ExpressionEvaluationOptions(Model): + """Specifies whether template expressions are evaluated within the scope of + the parent template or nested template. + + :param scope: The scope to be used for evaluation of parameters, variables + and functions in a nested template. Possible values include: + 'NotSpecified', 'Outer', 'Inner' + :type scope: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ExpressionEvaluationOptionsScopeType + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': 'str'}, + } + + def __init__(self, *, scope=None, **kwargs) -> None: + super(ExpressionEvaluationOptions, self).__init__(**kwargs) + self.scope = scope + + +class ExtendedLocation(Model): + """Resource extended location. + + :param type: The extended location type. Possible values include: + 'EdgeZone' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ExtendedLocationType + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type=None, name: str=None, **kwargs) -> None: + super(ExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name + + +class Resource(Model): + """Specified resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, extended_location=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.extended_location = extended_location + self.tags = tags + + +class GenericResource(Resource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2021_04_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2021_04_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2021_04_01.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, *, location: str=None, extended_location=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResource, self).__init__(location=location, extended_location=extended_location, tags=tags, **kwargs) + self.plan = plan + self.properties = properties + self.kind = kind + self.managed_by = managed_by + self.sku = sku + self.identity = identity + + +class GenericResourceExpanded(GenericResource): + """Resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param extended_location: Resource extended location. + :type extended_location: + ~azure.mgmt.resource.resources.v2021_04_01.models.ExtendedLocation + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: The plan of the resource. + :type plan: ~azure.mgmt.resource.resources.v2021_04_01.models.Plan + :param properties: The resource properties. + :type properties: object + :param kind: The kind of the resource. + :type kind: str + :param managed_by: ID of the resource that manages this resource. + :type managed_by: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.resource.resources.v2021_04_01.models.Sku + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.resource.resources.v2021_04_01.models.Identity + :ivar created_time: The created time of the resource. This is only present + if requested via the $expand query parameter. + :vartype created_time: datetime + :ivar changed_time: The changed time of the resource. This is only present + if requested via the $expand query parameter. + :vartype changed_time: datetime + :ivar provisioning_state: The provisioning state of the resource. This is + only present if requested via the $expand query parameter. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, extended_location=None, tags=None, plan=None, properties=None, kind: str=None, managed_by: str=None, sku=None, identity=None, **kwargs) -> None: + super(GenericResourceExpanded, self).__init__(location=location, extended_location=extended_location, tags=tags, plan=plan, properties=properties, kind=kind, managed_by=managed_by, sku=sku, identity=identity, **kwargs) + self.created_time = None + self.changed_time = None + self.provisioning_state = None + + +class GenericResourceFilter(Model): + """Resource filter. + + :param resource_type: The resource type. + :type resource_type: str + :param tagname: The tag name. + :type tagname: str + :param tagvalue: The tag value. + :type tagvalue: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'tagname': {'key': 'tagname', 'type': 'str'}, + 'tagvalue': {'key': 'tagvalue', 'type': 'str'}, + } + + def __init__(self, *, resource_type: str=None, tagname: str=None, tagvalue: str=None, **kwargs) -> None: + super(GenericResourceFilter, self).__init__(**kwargs) + self.resource_type = resource_type + self.tagname = tagname + self.tagvalue = tagvalue + + +class HttpMessage(Model): + """HTTP message. + + :param content: HTTP message content. + :type content: object + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'object'}, + } + + def __init__(self, *, content=None, **kwargs) -> None: + super(HttpMessage, self).__init__(**kwargs) + self.content = content + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the resource. The user identity dictionary key references will be ARM + resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.resource.resources.v2021_04_01.models.IdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{IdentityUserAssignedIdentitiesValue}'}, + } + + def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class IdentityUserAssignedIdentitiesValue(Model): + """IdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(IdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class OnErrorDeployment(Model): + """Deployment on error behavior. + + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, *, type=None, deployment_name: str=None, **kwargs) -> None: + super(OnErrorDeployment, self).__init__(**kwargs) + self.type = type + self.deployment_name = deployment_name + + +class OnErrorDeploymentExtended(Model): + """Deployment on error behavior with additional details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the provisioning for the on error + deployment. + :vartype provisioning_state: str + :param type: The deployment on error behavior type. Possible values are + LastSuccessful and SpecificDeployment. Possible values include: + 'LastSuccessful', 'SpecificDeployment' + :type type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.OnErrorDeploymentType + :param deployment_name: The deployment to be used on error case. + :type deployment_name: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'OnErrorDeploymentType'}, + 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + } + + def __init__(self, *, type=None, deployment_name: str=None, **kwargs) -> None: + super(OnErrorDeploymentExtended, self).__init__(**kwargs) + self.provisioning_state = None + self.type = type + self.deployment_name = deployment_name + + +class Operation(Model): + """Microsoft.Resources operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.resource.resources.v2021_04_01.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Resources + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ParametersLink(Model): + """Entity representing the reference to the deployment parameters. + + All required parameters must be populated in order to send to Azure. + + :param uri: Required. The URI of the parameters file. + :type uri: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + } + + def __init__(self, *, uri: str, content_version: str=None, **kwargs) -> None: + super(ParametersLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version + + +class Permission(Model): + """Role definition permissions. + + :param actions: Allowed actions. + :type actions: list[str] + :param not_actions: Denied actions. + :type not_actions: list[str] + :param data_actions: Allowed Data actions. + :type data_actions: list[str] + :param not_data_actions: Denied Data actions. + :type not_data_actions: list[str] + """ + + _attribute_map = { + 'actions': {'key': 'actions', 'type': '[str]'}, + 'not_actions': {'key': 'notActions', 'type': '[str]'}, + 'data_actions': {'key': 'dataActions', 'type': '[str]'}, + 'not_data_actions': {'key': 'notDataActions', 'type': '[str]'}, + } + + def __init__(self, *, actions=None, not_actions=None, data_actions=None, not_data_actions=None, **kwargs) -> None: + super(Permission, self).__init__(**kwargs) + self.actions = actions + self.not_actions = not_actions + self.data_actions = data_actions + self.not_data_actions = not_data_actions + + +class Plan(Model): + """Plan for the resource. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The offer ID. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: The plan's version. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, promotion_code: str=None, version: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version + + +class Provider(Model): + """Resource provider information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The provider ID. + :vartype id: str + :param namespace: The namespace of the resource provider. + :type namespace: str + :ivar registration_state: The registration state of the resource provider. + :vartype registration_state: str + :ivar registration_policy: The registration policy of the resource + provider. + :vartype registration_policy: str + :ivar resource_types: The collection of provider resource types. + :vartype resource_types: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ProviderResourceType] + :param provider_authorization_consent_state: The provider authorization + consent state. Possible values include: 'NotSpecified', 'Required', + 'NotRequired', 'Consented' + :type provider_authorization_consent_state: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderAuthorizationConsentState + """ + + _validation = { + 'id': {'readonly': True}, + 'registration_state': {'readonly': True}, + 'registration_policy': {'readonly': True}, + 'resource_types': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'registration_state': {'key': 'registrationState', 'type': 'str'}, + 'registration_policy': {'key': 'registrationPolicy', 'type': 'str'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ProviderResourceType]'}, + 'provider_authorization_consent_state': {'key': 'providerAuthorizationConsentState', 'type': 'str'}, + } + + def __init__(self, *, namespace: str=None, provider_authorization_consent_state=None, **kwargs) -> None: + super(Provider, self).__init__(**kwargs) + self.id = None + self.namespace = namespace + self.registration_state = None + self.registration_policy = None + self.resource_types = None + self.provider_authorization_consent_state = provider_authorization_consent_state + + +class ProviderConsentDefinition(Model): + """The provider consent. + + :param consent_to_authorization: A value indicating whether authorization + is consented or not. + :type consent_to_authorization: bool + """ + + _attribute_map = { + 'consent_to_authorization': {'key': 'consentToAuthorization', 'type': 'bool'}, + } + + def __init__(self, *, consent_to_authorization: bool=None, **kwargs) -> None: + super(ProviderConsentDefinition, self).__init__(**kwargs) + self.consent_to_authorization = consent_to_authorization + + +class ProviderExtendedLocation(Model): + """The provider extended location. . + + :param location: The azure location. + :type location: str + :param type: The extended location type. + :type type: str + :param extended_locations: The extended locations for the azure location. + :type extended_locations: list[str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[str]'}, + } + + def __init__(self, *, location: str=None, type: str=None, extended_locations=None, **kwargs) -> None: + super(ProviderExtendedLocation, self).__init__(**kwargs) + self.location = location + self.type = type + self.extended_locations = extended_locations + + +class ProviderPermission(Model): + """The provider permission. + + :param application_id: The application id. + :type application_id: str + :param role_definition: Role definition properties. + :type role_definition: + ~azure.mgmt.resource.resources.v2021_04_01.models.RoleDefinition + :param managed_by_role_definition: Role definition properties. + :type managed_by_role_definition: + ~azure.mgmt.resource.resources.v2021_04_01.models.RoleDefinition + :param provider_authorization_consent_state: The provider authorization + consent state. Possible values include: 'NotSpecified', 'Required', + 'NotRequired', 'Consented' + :type provider_authorization_consent_state: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderAuthorizationConsentState + """ + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'role_definition': {'key': 'roleDefinition', 'type': 'RoleDefinition'}, + 'managed_by_role_definition': {'key': 'managedByRoleDefinition', 'type': 'RoleDefinition'}, + 'provider_authorization_consent_state': {'key': 'providerAuthorizationConsentState', 'type': 'str'}, + } + + def __init__(self, *, application_id: str=None, role_definition=None, managed_by_role_definition=None, provider_authorization_consent_state=None, **kwargs) -> None: + super(ProviderPermission, self).__init__(**kwargs) + self.application_id = application_id + self.role_definition = role_definition + self.managed_by_role_definition = managed_by_role_definition + self.provider_authorization_consent_state = provider_authorization_consent_state + + +class ProviderPermissionListResult(Model): + """List of provider permissions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: An array of provider permissions. + :type value: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ProviderPermission] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProviderPermission]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ProviderPermissionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProviderRegistrationRequest(Model): + """The provider registration definition. + + :param third_party_provider_consent: The provider consent. + :type third_party_provider_consent: + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderConsentDefinition + """ + + _attribute_map = { + 'third_party_provider_consent': {'key': 'thirdPartyProviderConsent', 'type': 'ProviderConsentDefinition'}, + } + + def __init__(self, *, third_party_provider_consent=None, **kwargs) -> None: + super(ProviderRegistrationRequest, self).__init__(**kwargs) + self.third_party_provider_consent = third_party_provider_consent + + +class ProviderResourceType(Model): + """Resource type managed by the resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param resource_type: The resource type. + :type resource_type: str + :param locations: The collection of locations where this resource type can + be created. + :type locations: list[str] + :param location_mappings: The location mappings that are supported by this + resource type. + :type location_mappings: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ProviderExtendedLocation] + :param aliases: The aliases that are supported by this resource type. + :type aliases: + list[~azure.mgmt.resource.resources.v2021_04_01.models.Alias] + :param api_versions: The API version. + :type api_versions: list[str] + :ivar default_api_version: The default API version. + :vartype default_api_version: str + :ivar api_profiles: The API profiles for the resource provider. + :vartype api_profiles: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ApiProfile] + :param capabilities: The additional capabilities offered by this resource + type. + :type capabilities: str + :param properties: The properties. + :type properties: dict[str, str] + """ + + _validation = { + 'default_api_version': {'readonly': True}, + 'api_profiles': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_mappings': {'key': 'locationMappings', 'type': '[ProviderExtendedLocation]'}, + 'aliases': {'key': 'aliases', 'type': '[Alias]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'api_profiles': {'key': 'apiProfiles', 'type': '[ApiProfile]'}, + 'capabilities': {'key': 'capabilities', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, resource_type: str=None, locations=None, location_mappings=None, aliases=None, api_versions=None, capabilities: str=None, properties=None, **kwargs) -> None: + super(ProviderResourceType, self).__init__(**kwargs) + self.resource_type = resource_type + self.locations = locations + self.location_mappings = location_mappings + self.aliases = aliases + self.api_versions = api_versions + self.default_api_version = None + self.api_profiles = None + self.capabilities = capabilities + self.properties = properties + + +class ProviderResourceTypeListResult(Model): + """List of resource types of a resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: An array of resource types. + :type value: + list[~azure.mgmt.resource.resources.v2021_04_01.models.ProviderResourceType] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProviderResourceType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ProviderResourceTypeListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceGroup(Model): + """Resource group information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the resource group. + :vartype id: str + :ivar name: The name of the resource group. + :vartype name: str + :ivar type: The type of the resource group. + :vartype type: str + :param properties: The resource group properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroupProperties + :param location: Required. The location of the resource group. It cannot + be changed after the resource group has been created. It must be one of + the supported Azure locations. + :type location: str + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + super(ResourceGroup, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + self.location = location + self.managed_by = managed_by + self.tags = tags + + +class ResourceGroupExportResult(Model): + """Resource group export result. + + :param template: The template content. + :type template: object + :param error: The template export error. + :type error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _attribute_map = { + 'template': {'key': 'template', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, template=None, error=None, **kwargs) -> None: + super(ResourceGroupExportResult, self).__init__(**kwargs) + self.template = template + self.error = error + + +class ResourceGroupFilter(Model): + """Resource group filter. + + :param tag_name: The tag name. + :type tag_name: str + :param tag_value: The tag value. + :type tag_value: str + """ + + _attribute_map = { + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + } + + def __init__(self, *, tag_name: str=None, tag_value: str=None, **kwargs) -> None: + super(ResourceGroupFilter, self).__init__(**kwargs) + self.tag_name = tag_name + self.tag_value = tag_value + + +class ResourceGroupPatchable(Model): + """Resource group information. + + :param name: The name of the resource group. + :type name: str + :param properties: The resource group properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroupProperties + :param managed_by: The ID of the resource that manages this resource + group. + :type managed_by: str + :param tags: The tags attached to the resource group. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str=None, properties=None, managed_by: str=None, tags=None, **kwargs) -> None: + super(ResourceGroupPatchable, self).__init__(**kwargs) + self.name = name + self.properties = properties + self.managed_by = managed_by + self.tags = tags + + +class ResourceGroupProperties(Model): + """The resource group properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceGroupProperties, self).__init__(**kwargs) + self.provisioning_state = None + + +class ResourceProviderOperationDisplayProperties(Model): + """Resource provider operation's display properties. + + :param publisher: Operation description. + :type publisher: str + :param provider: Operation provider. + :type provider: str + :param resource: Operation resource. + :type resource: str + :param operation: Resource provider operation. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, publisher: str=None, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplayProperties, self).__init__(**kwargs) + self.publisher = publisher + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ResourceReference(Model): + """The resource Id model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified resource Id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceReference, self).__init__(**kwargs) + self.id = None + + +class ResourcesMoveInfo(Model): + """Parameters of move resources. + + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: str + """ + + _attribute_map = { + 'resources': {'key': 'resources', 'type': '[str]'}, + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + } + + def __init__(self, *, resources=None, target_resource_group: str=None, **kwargs) -> None: + super(ResourcesMoveInfo, self).__init__(**kwargs) + self.resources = resources + self.target_resource_group = target_resource_group + + +class RoleDefinition(Model): + """Role definition properties. + + :param id: The role definition ID. + :type id: str + :param name: The role definition name. + :type name: str + :param is_service_role: If this is a service role. + :type is_service_role: bool + :param permissions: Role definition permissions. + :type permissions: + list[~azure.mgmt.resource.resources.v2021_04_01.models.Permission] + :param scopes: Role definition assignable scopes. + :type scopes: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_service_role': {'key': 'isServiceRole', 'type': 'bool'}, + 'permissions': {'key': 'permissions', 'type': '[Permission]'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, name: str=None, is_service_role: bool=None, permissions=None, scopes=None, **kwargs) -> None: + super(RoleDefinition, self).__init__(**kwargs) + self.id = id + self.name = name + self.is_service_role = is_service_role + self.permissions = permissions + self.scopes = scopes + + +class ScopedDeployment(Model): + """Deployment operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentProperties + :param tags: Deployment tags + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: + super(ScopedDeployment, self).__init__(**kwargs) + self.location = location + self.properties = properties + self.tags = tags + + +class ScopedDeploymentWhatIf(Model): + """Deployment What-if operation parameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location to store the deployment data. + :type location: str + :param properties: Required. The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfProperties + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeploymentWhatIfProperties'}, + } + + def __init__(self, *, location: str, properties, **kwargs) -> None: + super(ScopedDeploymentWhatIf, self).__init__(**kwargs) + self.location = location + self.properties = properties + + +class Sku(Model): + """SKU for the resource. + + :param name: The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + :param size: The SKU size. + :type size: str + :param family: The SKU family. + :type family: str + :param model: The SKU model. + :type model: str + :param capacity: The SKU capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'model': {'key': 'model', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, tier: str=None, size: str=None, family: str=None, model: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.model = model + self.capacity = capacity + + +class StatusMessage(Model): + """Operation status message object. + + :param status: Status of the deployment operation. + :type status: str + :param error: The error reported by the operation. + :type error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, status: str=None, error=None, **kwargs) -> None: + super(StatusMessage, self).__init__(**kwargs) + self.status = status + self.error = error + + +class SubResource(Model): + """Sub-resource. + + :param id: Resource ID + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id + + +class TagCount(Model): + """Tag count. + + :param type: Type of count. + :type type: str + :param value: Value of count. + :type value: int + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + } + + def __init__(self, *, type: str=None, value: int=None, **kwargs) -> None: + super(TagCount, self).__init__(**kwargs) + self.type = type + self.value = value + + +class TagDetails(Model): + """Tag details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag name ID. + :vartype id: str + :param tag_name: The tag name. + :type tag_name: str + :param count: The total number of resources that use the resource tag. + When a tag is initially created and has no associated resources, the value + is 0. + :type count: ~azure.mgmt.resource.resources.v2021_04_01.models.TagCount + :param values: The list of tag values. + :type values: + list[~azure.mgmt.resource.resources.v2021_04_01.models.TagValue] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + 'values': {'key': 'values', 'type': '[TagValue]'}, + } + + def __init__(self, *, tag_name: str=None, count=None, values=None, **kwargs) -> None: + super(TagDetails, self).__init__(**kwargs) + self.id = None + self.tag_name = tag_name + self.count = count + self.values = values + + +class Tags(Model): + """A dictionary of name and value pairs. + + :param tags: + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(Tags, self).__init__(**kwargs) + self.tags = tags + + +class TagsPatchResource(Model): + """Wrapper resource for tags patch API request only. + + :param operation: The operation type for the patch API. Possible values + include: 'Replace', 'Merge', 'Delete' + :type operation: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.TagsPatchOperation + :param properties: The set of tags. + :type properties: ~azure.mgmt.resource.resources.v2021_04_01.models.Tags + """ + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Tags'}, + } + + def __init__(self, *, operation=None, properties=None, **kwargs) -> None: + super(TagsPatchResource, self).__init__(**kwargs) + self.operation = operation + self.properties = properties + + +class TagsResource(Model): + """Wrapper resource for tags API requests and responses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the tags wrapper resource. + :vartype id: str + :ivar name: The name of the tags wrapper resource. + :vartype name: str + :ivar type: The type of the tags wrapper resource. + :vartype type: str + :param properties: Required. The set of tags. + :type properties: ~azure.mgmt.resource.resources.v2021_04_01.models.Tags + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Tags'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class TagValue(Model): + """Tag information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The tag value ID. + :vartype id: str + :param tag_value: The tag value. + :type tag_value: str + :param count: The tag value count. + :type count: ~azure.mgmt.resource.resources.v2021_04_01.models.TagCount + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_value': {'key': 'tagValue', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'TagCount'}, + } + + def __init__(self, *, tag_value: str=None, count=None, **kwargs) -> None: + super(TagValue, self).__init__(**kwargs) + self.id = None + self.tag_value = tag_value + self.count = count + + +class TargetResource(Model): + """Target resource. + + :param id: The ID of the resource. + :type id: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_type: The type of the resource. + :type resource_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resource_name: str=None, resource_type: str=None, **kwargs) -> None: + super(TargetResource, self).__init__(**kwargs) + self.id = id + self.resource_name = resource_name + self.resource_type = resource_type + + +class TemplateHashResult(Model): + """Result of the request to calculate template hash. It contains a string of + minified template and its hash. + + :param minified_template: The minified template string. + :type minified_template: str + :param template_hash: The template hash. + :type template_hash: str + """ + + _attribute_map = { + 'minified_template': {'key': 'minifiedTemplate', 'type': 'str'}, + 'template_hash': {'key': 'templateHash', 'type': 'str'}, + } + + def __init__(self, *, minified_template: str=None, template_hash: str=None, **kwargs) -> None: + super(TemplateHashResult, self).__init__(**kwargs) + self.minified_template = minified_template + self.template_hash = template_hash + + +class TemplateLink(Model): + """Entity representing the reference to the template. + + :param uri: The URI of the template to deploy. Use either the uri or id + property, but not both. + :type uri: str + :param id: The resource id of a Template Spec. Use either the id or uri + property, but not both. + :type id: str + :param relative_path: The relativePath property can be used to deploy a + linked template at a location relative to the parent. If the parent + template was linked with a TemplateSpec, this will reference an artifact + in the TemplateSpec. If the parent was linked with a URI, the child + deployment will be a combination of the parent and relativePath URIs + :type relative_path: str + :param content_version: If included, must match the ContentVersion in the + template. + :type content_version: str + :param query_string: The query string (for example, a SAS token) to be + used with the templateLink URI. + :type query_string: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + 'query_string': {'key': 'queryString', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, id: str=None, relative_path: str=None, content_version: str=None, query_string: str=None, **kwargs) -> None: + super(TemplateLink, self).__init__(**kwargs) + self.uri = uri + self.id = id + self.relative_path = relative_path + self.content_version = content_version + self.query_string = query_string + + +class WhatIfChange(Model): + """Information about a single resource change predicted by What-If operation. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. Resource ID + :type resource_id: str + :param change_type: Required. Type of change that will be made to the + resource when the deployment is executed. Possible values include: + 'Create', 'Delete', 'Ignore', 'Deploy', 'NoChange', 'Modify', + 'Unsupported' + :type change_type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.ChangeType + :param unsupported_reason: The explanation about why the resource is + unsupported by What-If. + :type unsupported_reason: str + :param before: The snapshot of the resource before the deployment is + executed. + :type before: object + :param after: The predicted snapshot of the resource after the deployment + is executed. + :type after: object + :param delta: The predicted changes to resource properties. + :type delta: + list[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfPropertyChange] + """ + + _validation = { + 'resource_id': {'required': True}, + 'change_type': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'change_type': {'key': 'changeType', 'type': 'ChangeType'}, + 'unsupported_reason': {'key': 'unsupportedReason', 'type': 'str'}, + 'before': {'key': 'before', 'type': 'object'}, + 'after': {'key': 'after', 'type': 'object'}, + 'delta': {'key': 'delta', 'type': '[WhatIfPropertyChange]'}, + } + + def __init__(self, *, resource_id: str, change_type, unsupported_reason: str=None, before=None, after=None, delta=None, **kwargs) -> None: + super(WhatIfChange, self).__init__(**kwargs) + self.resource_id = resource_id + self.change_type = change_type + self.unsupported_reason = unsupported_reason + self.before = before + self.after = after + self.delta = delta + + +class WhatIfOperationResult(Model): + """Result of the What-If operation. Contains a list of predicted changes and a + URL link to get to the next set of results. + + :param status: Status of the What-If operation. + :type status: str + :param changes: List of resource changes predicted by What-If operation. + :type changes: + list[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfChange] + :param error: Error when What-If operation fails. + :type error: + ~azure.mgmt.resource.resources.v2021_04_01.models.ErrorResponse + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'changes': {'key': 'properties.changes', 'type': '[WhatIfChange]'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, status: str=None, changes=None, error=None, **kwargs) -> None: + super(WhatIfOperationResult, self).__init__(**kwargs) + self.status = status + self.changes = changes + self.error = error + + +class WhatIfPropertyChange(Model): + """The predicted change to the resource property. + + All required parameters must be populated in order to send to Azure. + + :param path: Required. The path of the property. + :type path: str + :param property_change_type: Required. The type of property change. + Possible values include: 'Create', 'Delete', 'Modify', 'Array', 'NoEffect' + :type property_change_type: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.PropertyChangeType + :param before: The value of the property before the deployment is + executed. + :type before: object + :param after: The value of the property after the deployment is executed. + :type after: object + :param children: Nested property changes. + :type children: + list[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfPropertyChange] + """ + + _validation = { + 'path': {'required': True}, + 'property_change_type': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'property_change_type': {'key': 'propertyChangeType', 'type': 'PropertyChangeType'}, + 'before': {'key': 'before', 'type': 'object'}, + 'after': {'key': 'after', 'type': 'object'}, + 'children': {'key': 'children', 'type': '[WhatIfPropertyChange]'}, + } + + def __init__(self, *, path: str, property_change_type, before=None, after=None, children=None, **kwargs) -> None: + super(WhatIfPropertyChange, self).__init__(**kwargs) + self.path = path + self.property_change_type = property_change_type + self.before = before + self.after = after + self.children = children diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_paged_models.py new file mode 100644 index 000000000000..4c2c71e562c1 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_paged_models.py @@ -0,0 +1,105 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class DeploymentExtendedPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeploymentExtended ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeploymentExtended]'} + } + + def __init__(self, *args, **kwargs): + + super(DeploymentExtendedPaged, self).__init__(*args, **kwargs) +class ProviderPaged(Paged): + """ + A paging container for iterating over a list of :class:`Provider ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Provider]'} + } + + def __init__(self, *args, **kwargs): + + super(ProviderPaged, self).__init__(*args, **kwargs) +class GenericResourceExpandedPaged(Paged): + """ + A paging container for iterating over a list of :class:`GenericResourceExpanded ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GenericResourceExpanded]'} + } + + def __init__(self, *args, **kwargs): + + super(GenericResourceExpandedPaged, self).__init__(*args, **kwargs) +class ResourceGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceGroupPaged, self).__init__(*args, **kwargs) +class TagDetailsPaged(Paged): + """ + A paging container for iterating over a list of :class:`TagDetails ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TagDetails]'} + } + + def __init__(self, *args, **kwargs): + + super(TagDetailsPaged, self).__init__(*args, **kwargs) +class DeploymentOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeploymentOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeploymentOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(DeploymentOperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_resource_management_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_resource_management_client_enums.py new file mode 100644 index 000000000000..381ec0310fe1 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_resource_management_client_enums.py @@ -0,0 +1,146 @@ +# 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 enum import Enum + + +class DeploymentMode(str, Enum): + + incremental = "Incremental" + complete = "Complete" + + +class OnErrorDeploymentType(str, Enum): + + last_successful = "LastSuccessful" + specific_deployment = "SpecificDeployment" + + +class ExpressionEvaluationOptionsScopeType(str, Enum): + + not_specified = "NotSpecified" + outer = "Outer" + inner = "Inner" + + +class WhatIfResultFormat(str, Enum): + + resource_id_only = "ResourceIdOnly" + full_resource_payloads = "FullResourcePayloads" + + +class AliasPathTokenType(str, Enum): + + not_specified = "NotSpecified" #: The token type is not specified. + any = "Any" #: The token type can be anything. + string = "String" #: The token type is string. + object_enum = "Object" #: The token type is object. + array = "Array" #: The token type is array. + integer = "Integer" #: The token type is integer. + number = "Number" #: The token type is number. + boolean = "Boolean" #: The token type is boolean. + + +class AliasPathAttributes(str, Enum): + + none = "None" #: The token that the alias path is referring to has no attributes. + modifiable = "Modifiable" #: The token that the alias path is referring to is modifiable by policies with 'modify' effect. + + +class AliasPatternType(str, Enum): + + not_specified = "NotSpecified" #: NotSpecified is not allowed. + extract = "Extract" #: Extract is the only allowed value. + + +class AliasType(str, Enum): + + not_specified = "NotSpecified" #: Alias type is unknown (same as not providing alias type). + plain_text = "PlainText" #: Alias value is not secret. + mask = "Mask" #: Alias value is secret. + + +class ProviderAuthorizationConsentState(str, Enum): + + not_specified = "NotSpecified" + required = "Required" + not_required = "NotRequired" + consented = "Consented" + + +class ProvisioningState(str, Enum): + + not_specified = "NotSpecified" + accepted = "Accepted" + running = "Running" + ready = "Ready" + creating = "Creating" + created = "Created" + deleting = "Deleting" + deleted = "Deleted" + canceled = "Canceled" + failed = "Failed" + succeeded = "Succeeded" + updating = "Updating" + + +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned, UserAssigned" + none = "None" + + +class ExtendedLocationType(str, Enum): + + edge_zone = "EdgeZone" + + +class ProvisioningOperation(str, Enum): + + not_specified = "NotSpecified" #: The provisioning operation is not specified. + create = "Create" #: The provisioning operation is create. + delete = "Delete" #: The provisioning operation is delete. + waiting = "Waiting" #: The provisioning operation is waiting. + azure_async_operation_waiting = "AzureAsyncOperationWaiting" #: The provisioning operation is waiting Azure async operation. + resource_cache_waiting = "ResourceCacheWaiting" #: The provisioning operation is waiting for resource cache. + action = "Action" #: The provisioning operation is action. + read = "Read" #: The provisioning operation is read. + evaluate_deployment_output = "EvaluateDeploymentOutput" #: The provisioning operation is evaluate output. + deployment_cleanup = "DeploymentCleanup" #: The provisioning operation is cleanup. This operation is part of the 'complete' mode deployment. + + +class PropertyChangeType(str, Enum): + + create = "Create" #: The property does not exist in the current state but is present in the desired state. The property will be created when the deployment is executed. + delete = "Delete" #: The property exists in the current state and is missing from the desired state. It will be deleted when the deployment is executed. + modify = "Modify" #: The property exists in both current and desired state and is different. The value of the property will change when the deployment is executed. + array = "Array" #: The property is an array and contains nested changes. + no_effect = "NoEffect" #: The property will not be set or updated. + + +class ChangeType(str, Enum): + + create = "Create" #: The resource does not exist in the current state but is present in the desired state. The resource will be created when the deployment is executed. + delete = "Delete" #: The resource exists in the current state and is missing from the desired state. The resource will be deleted when the deployment is executed. + ignore = "Ignore" #: The resource exists in the current state and is missing from the desired state. The resource will not be deployed or modified when the deployment is executed. + deploy = "Deploy" #: The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource may or may not change. + no_change = "NoChange" #: The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource will not change. + modify = "Modify" #: The resource exists in the current state and the desired state and will be redeployed when the deployment is executed. The properties of the resource will change. + unsupported = "Unsupported" #: The resource is not supported by What-If. + + +class TagsPatchOperation(str, Enum): + + replace = "Replace" #: The 'replace' option replaces the entire set of existing tags with a new set. + merge = "Merge" #: The 'merge' option allows adding tags with new names and updating the values of tags with existing names. + delete = "Delete" #: The 'delete' option allows selectively deleting tags based on given names or name/value pairs. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/__init__.py new file mode 100644 index 000000000000..3fceb9fb37b4 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/__init__.py @@ -0,0 +1,30 @@ +# 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 ._operations import Operations +from ._deployments_operations import DeploymentsOperations +from ._providers_operations import ProvidersOperations +from ._provider_resource_types_operations import ProviderResourceTypesOperations +from ._resources_operations import ResourcesOperations +from ._resource_groups_operations import ResourceGroupsOperations +from ._tags_operations import TagsOperations +from ._deployment_operations import DeploymentOperations + +__all__ = [ + 'Operations', + 'DeploymentsOperations', + 'ProvidersOperations', + 'ProviderResourceTypesOperations', + 'ResourcesOperations', + 'ResourceGroupsOperations', + 'TagsOperations', + 'DeploymentOperations', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_deployment_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_deployment_operations.py new file mode 100644 index 000000000000..0c23dee19733 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_deployment_operations.py @@ -0,0 +1,729 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DeploymentOperations(object): + """DeploymentOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-01" + + self.config = config + + def get_at_scope( + self, scope, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}'} + + def list_at_scope( + self, scope, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations'} + + def get_at_tenant_scope( + self, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}'} + + def list_at_tenant_scope( + self, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/operations'} + + def get_at_management_group_scope( + self, group_id, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}'} + + def list_at_management_group_scope( + self, group_id, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations'} + + def get_at_subscription_scope( + self, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}'} + + def list_at_subscription_scope( + self, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations'} + + def get( + self, resource_group_name, deployment_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets a deployments operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param operation_id: The ID of the operation to get. + :type operation_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: DeploymentOperation or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}'} + + def list( + self, resource_group_name, deployment_name, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all deployments operations for a deployment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param top: The number of results to return. + :type top: int + :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: An iterator like instance of DeploymentOperation + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperationPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_deployments_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_deployments_operations.py new file mode 100644 index 000000000000..0f4d5ba9dc01 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_deployments_operations.py @@ -0,0 +1,3582 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DeploymentsOperations(object): + """DeploymentsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-01" + + self.config = config + + + def _delete_at_scope_initial( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. This is an asynchronous operation that returns a status of + 202 until the template deployment is successfully deleted. The Location + response header contains the URI that is used to obtain the status of + the process. While the process is running, a call to the URI in the + Location header returns a status of 202. When the process finishes, the + URI in the Location header returns a status of 204 on success. If the + asynchronous request failed, the URI in the Location header returns an + error-level status code. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_at_scope_initial( + scope=scope, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_at_scope_initial( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_at_scope( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources at a given scope. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_at_scope_initial( + scope=scope, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resources partially + deployed. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_at_scope_initial( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate_at_scope( + self, scope, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_scope_initial( + scope=scope, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + def export_template_at_scope( + self, scope, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param scope: The resource scope. + :type scope: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_at_scope( + self, scope, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments at the given scope. + + :param scope: The resource scope. + :type scope: str + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/deployments/'} + + + def _delete_at_tenant_scope_initial( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. This is an asynchronous operation that returns a status of + 202 until the template deployment is successfully deleted. The Location + response header contains the URI that is used to obtain the status of + the process. While the process is running, a call to the URI in the + Location header returns a status of 202. When the process finishes, the + URI in the Location header returns a status of 204 on success. If the + asynchronous request failed, the URI in the Location header returns an + error-level status code. + + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_at_tenant_scope_initial( + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_at_tenant_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_at_tenant_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources at tenant scope. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.ScopedDeployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_at_tenant_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resources partially + deployed. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_at_tenant_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate_at_tenant_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.ScopedDeployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_tenant_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + + def _what_if_at_tenant_scope_initial( + self, deployment_name, location, properties, custom_headers=None, raw=False, **operation_config): + parameters = models.ScopedDeploymentWhatIf(location=location, properties=properties) + + # Construct URL + url = self.what_if_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeploymentWhatIf') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('WhatIfOperationResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def what_if_at_tenant_scope( + self, deployment_name, location, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Returns changes that will be made by the deployment if executed at the + scope of the tenant group. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param location: The location to store the deployment data. + :type location: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfProperties + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WhatIfOperationResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._what_if_at_tenant_scope_initial( + deployment_name=deployment_name, + location=location, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('WhatIfOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + what_if_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'} + + def export_template_at_tenant_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_at_tenant_scope( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments at the tenant scope. + + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_tenant_scope.metadata['url'] + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_tenant_scope.metadata = {'url': '/providers/Microsoft.Resources/deployments/'} + + + def _delete_at_management_group_scope_initial( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. This is an asynchronous operation that returns a status of + 202 until the template deployment is successfully deleted. The Location + response header contains the URI that is used to obtain the status of + the process. While the process is running, a call to the URI in the + Location header returns a status of 202. When the process finishes, the + URI in the Location header returns a status of 204 on success. If the + asynchronous request failed, the URI in the Location header returns an + error-level status code. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_at_management_group_scope_initial( + group_id=group_id, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_at_management_group_scope_initial( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_at_management_group_scope( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources at management group scope. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.ScopedDeployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_at_management_group_scope_initial( + group_id=group_id, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resources partially + deployed. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_at_management_group_scope_initial( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate_at_management_group_scope( + self, group_id, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.ScopedDeployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_management_group_scope_initial( + group_id=group_id, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + + def _what_if_at_management_group_scope_initial( + self, group_id, deployment_name, location, properties, custom_headers=None, raw=False, **operation_config): + parameters = models.ScopedDeploymentWhatIf(location=location, properties=properties) + + # Construct URL + url = self.what_if_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ScopedDeploymentWhatIf') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('WhatIfOperationResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def what_if_at_management_group_scope( + self, group_id, deployment_name, location, properties, custom_headers=None, raw=False, polling=True, **operation_config): + """Returns changes that will be made by the deployment if executed at the + scope of the management group. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param location: The location to store the deployment data. + :type location: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfProperties + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WhatIfOperationResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._what_if_at_management_group_scope_initial( + group_id=group_id, + deployment_name=deployment_name, + location=location, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('WhatIfOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + what_if_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'} + + def export_template_at_management_group_scope( + self, group_id, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param group_id: The management group ID. + :type group_id: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_at_management_group_scope( + self, group_id, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments for a management group. + + :param group_id: The management group ID. + :type group_id: str + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/'} + + + def _delete_at_subscription_scope_initial( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. This is an asynchronous operation that returns a status of + 202 until the template deployment is successfully deleted. The Location + response header contains the URI that is used to obtain the status of + the process. While the process is running, a call to the URI in the + Location header returns a status of 202. When the process finishes, the + URI in the Location header returns a status of 204 on success. If the + asynchronous request failed, the URI in the Location header returns an + error-level status code. + + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_at_subscription_scope_initial( + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_at_subscription_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_at_subscription_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources at subscription scope. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_at_subscription_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resources partially + deployed. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_at_subscription_scope_initial( + self, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate_at_subscription_scope( + self, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_at_subscription_scope_initial( + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + + def _what_if_at_subscription_scope_initial( + self, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): + parameters = models.DeploymentWhatIf(location=location, properties=properties) + + # Construct URL + url = self.what_if_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'DeploymentWhatIf') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('WhatIfOperationResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def what_if_at_subscription_scope( + self, deployment_name, properties, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Returns changes that will be made by the deployment if executed at the + scope of the subscription. + + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfProperties + :param location: The location to store the deployment data. + :type location: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WhatIfOperationResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._what_if_at_subscription_scope_initial( + deployment_name=deployment_name, + properties=properties, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('WhatIfOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + what_if_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'} + + def export_template_at_subscription_scope( + self, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_at_subscription_scope( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments for a subscription. + + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_subscription_scope.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/'} + + + def _delete_initial( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a deployment from the deployment history. + + A template deployment that is currently running cannot be deleted. + Deleting a template deployment removes the associated deployment + operations. Deleting a template deployment does not affect the state of + the resource group. This is an asynchronous operation that returns a + status of 202 until the template deployment is successfully deleted. + The Location response header contains the URI that is used to obtain + the status of the process. While the process is running, a call to the + URI in the Location header returns a status of 202. When the process + finishes, the URI in the Location header returns a status of 204 on + success. If the asynchronous request failed, the URI in the Location + header returns an error-level status code. + + :param resource_group_name: The name of the resource group with the + deployment to delete. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def check_existence( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Checks whether the deployment exists. + + :param resource_group_name: The name of the resource group with the + deployment to check. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + + def _create_or_update_initial( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + 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 [200, 201]: + 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('DeploymentExtended', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Deploys resources to a resource group. + + You can provide the template and parameters directly in the request or + link to JSON files. + + :param resource_group_name: The name of the resource group to deploy + the resources to. The name is case insensitive. The resource group + must already exist. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Additional parameters supplied to the operation. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentExtended or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def get( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Gets a deployment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExtended or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExtended', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'} + + def cancel( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Cancels a currently running template deployment. + + You can cancel a deployment only if the provisioningState is Accepted + or Running. After the deployment is canceled, the provisioningState is + set to Canceled. Canceling a template deployment stops the currently + running template deployment and leaves the resource group partially + deployed. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'} + + + def _validate_initial( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.validate.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'Deployment') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 400]: + 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('DeploymentValidateResult', response) + if response.status_code == 400: + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate( + self, resource_group_name, deployment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether the specified template is syntactically correct and + will be accepted by Azure Resource Manager.. + + :param resource_group_name: The name of the resource group the + template will be deployed to. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param parameters: Parameters to validate. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.Deployment + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DeploymentValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'} + + + def _what_if_initial( + self, resource_group_name, deployment_name, properties, location=None, custom_headers=None, raw=False, **operation_config): + parameters = models.DeploymentWhatIf(location=location, properties=properties) + + # Construct URL + url = self.what_if.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'DeploymentWhatIf') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('WhatIfOperationResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def what_if( + self, resource_group_name, deployment_name, properties, location=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Returns changes that will be made by the deployment if executed at the + scope of the resource group. + + :param resource_group_name: The name of the resource group the + template will be deployed to. The name is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_name: str + :param properties: The deployment properties. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentWhatIfProperties + :param location: The location to store the deployment data. + :type location: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WhatIfOperationResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.WhatIfOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._what_if_initial( + resource_group_name=resource_group_name, + deployment_name=deployment_name, + properties=properties, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('WhatIfOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + what_if.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'} + + def export_template( + self, resource_group_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Exports the template used for specified deployment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param deployment_name: The name of the deployment. + :type deployment_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeploymentExportResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export_template.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'deploymentName': self._serialize.url("deployment_name", deployment_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeploymentExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_template.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'} + + def list_by_resource_group( + self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the deployments for a resource group. + + :param resource_group_name: The name of the resource group with the + deployments to get. The name is case insensitive. + :type resource_group_name: str + :param filter: The filter to apply on the operation. For example, you + can use $filter=provisioningState eq '{state}'. + :type filter: str + :param top: The number of results to get. If null is passed, returns + all deployments. + :type top: int + :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: An iterator like instance of DeploymentExtended + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtendedPaged[~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeploymentExtendedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'} + + def calculate_template_hash( + self, template, custom_headers=None, raw=False, **operation_config): + """Calculate the hash of the given template. + + :param template: The template provided to calculate hash. + :type template: object + :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: TemplateHashResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.TemplateHashResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.calculate_template_hash.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(template, 'object') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateHashResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + calculate_template_hash.metadata = {'url': '/providers/Microsoft.Resources/calculateTemplateHash'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py new file mode 100644 index 000000000000..2627522cb180 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Microsoft.Resources REST API operations. + + :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: An iterator like instance of Operation + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.OperationPaged[~azure.mgmt.resource.resources.v2021_04_01.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Resources/operations'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_provider_resource_types_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_provider_resource_types_operations.py new file mode 100644 index 000000000000..649e8b42ca23 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_provider_resource_types_operations.py @@ -0,0 +1,106 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ProviderResourceTypesOperations(object): + """ProviderResourceTypesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-01" + + self.config = config + + def list( + self, resource_provider_namespace, expand=None, custom_headers=None, raw=False, **operation_config): + """List the resource types for a specified resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param expand: The $expand query parameter. For example, to include + property aliases in response, use $expand=resourceTypes/aliases. + :type expand: 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: ProviderResourceTypeListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderResourceTypeListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderResourceTypeListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/resourceTypes'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_providers_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_providers_operations.py new file mode 100644 index 000000000000..d7e81f685979 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_providers_operations.py @@ -0,0 +1,564 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ProvidersOperations(object): + """ProvidersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-01" + + self.config = config + + def unregister( + self, resource_provider_namespace, custom_headers=None, raw=False, **operation_config): + """Unregisters a subscription from a resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider to unregister. + :type resource_provider_namespace: 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: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.unregister.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + unregister.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister'} + + def register_at_management_group_scope( + self, resource_provider_namespace, group_id, custom_headers=None, raw=False, **operation_config): + """Registers a management group with a resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider to register. + :type resource_provider_namespace: str + :param group_id: The management group ID. + :type group_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.register_at_management_group_scope.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'groupId': self._serialize.url("group_id", group_id, 'str', max_length=90, min_length=1) + } + 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 = {} + 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.post(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + register_at_management_group_scope.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register'} + + def provider_permissions( + self, resource_provider_namespace, custom_headers=None, raw=False, **operation_config): + """Get the provider permissions. + + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: 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: ProviderPermissionListResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderPermissionListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.provider_permissions.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderPermissionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + provider_permissions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/providerPermissions'} + + def register( + self, resource_provider_namespace, third_party_provider_consent=None, custom_headers=None, raw=False, **operation_config): + """Registers a subscription with a resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider to register. + :type resource_provider_namespace: str + :param third_party_provider_consent: The provider consent. + :type third_party_provider_consent: + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderConsentDefinition + :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: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + properties = None + if third_party_provider_consent is not None: + properties = models.ProviderRegistrationRequest(third_party_provider_consent=third_party_provider_consent) + + # Construct URL + url = self.register.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + if properties is not None: + body_content = self._serialize.body(properties, 'ProviderRegistrationRequest') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + register.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register'} + + def list( + self, top=None, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets all resource providers for a subscription. + + :param top: The number of results to return. If null is passed returns + all deployments. + :type top: int + :param expand: The properties to include in the results. For example, + use &$expand=metadata in the query string to retrieve resource + provider metadata. To include property aliases in response, use + $expand=resourceTypes/aliases. + :type expand: 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: An iterator like instance of Provider + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderPaged[~azure.mgmt.resource.resources.v2021_04_01.models.Provider] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProviderPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers'} + + def list_at_tenant_scope( + self, top=None, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets all resource providers for the tenant. + + :param top: The number of results to return. If null is passed returns + all providers. + :type top: int + :param expand: The properties to include in the results. For example, + use &$expand=metadata in the query string to retrieve resource + provider metadata. To include property aliases in response, use + $expand=resourceTypes/aliases. + :type expand: 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: An iterator like instance of Provider + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderPaged[~azure.mgmt.resource.resources.v2021_04_01.models.Provider] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_at_tenant_scope.metadata['url'] + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProviderPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_at_tenant_scope.metadata = {'url': '/providers'} + + def get( + self, resource_provider_namespace, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified resource provider. + + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param expand: The $expand query parameter. For example, to include + property aliases in response, use $expand=resourceTypes/aliases. + :type expand: 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: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}'} + + def get_at_tenant_scope( + self, resource_provider_namespace, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified resource provider at the tenant level. + + :param resource_provider_namespace: The namespace of the resource + provider. + :type resource_provider_namespace: str + :param expand: The $expand query parameter. For example, to include + property aliases in response, use $expand=resourceTypes/aliases. + :type expand: 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: Provider or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_tenant_scope.metadata['url'] + path_format_arguments = { + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Provider', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_tenant_scope.metadata = {'url': '/providers/{resourceProviderNamespace}'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_resource_groups_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_resource_groups_operations.py new file mode 100644 index 000000000000..694241a4fccf --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_resource_groups_operations.py @@ -0,0 +1,570 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ResourceGroupsOperations(object): + """ResourceGroupsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-01" + + self.config = config + + def check_existence( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Checks whether a resource group exists. + + :param resource_group_name: The name of the resource group to check. + 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def create_or_update( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a resource group. + + :param resource_group_name: The name of the resource group to create + or update. Can include alphanumeric, underscore, parentheses, hyphen, + period (except at end), and Unicode characters that match the allowed + characters. + :type resource_group_name: str + :param parameters: Parameters supplied to the create or update a + resource group. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup + :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: ResourceGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ResourceGroup') + + # Construct and send request + 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 [200, 201]: + 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('ResourceGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('ResourceGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + + def _delete_initial( + self, resource_group_name, force_deletion_types=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if force_deletion_types is not None: + query_parameters['forceDeletionTypes'] = self._serialize.query("force_deletion_types", force_deletion_types, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, force_deletion_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 + deleted. Deleting a resource group deletes all of its template + deployments and currently stored operations. + + :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_types: The resource types you want to force + delete. Currently, only the following is supported: + forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets + :type force_deletion_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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + force_deletion_types=force_deletion_types, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def get( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a resource group. + + :param resource_group_name: The name of the resource group to get. 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourceGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ResourceGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + def update( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates a resource group. + + Resource groups can be updated through a simple PATCH operation to a + group address. The format of the request is the same as that for + creating a resource group. If a field is unspecified, the current value + is retained. + + :param resource_group_name: The name of the resource group to update. + The name is case insensitive. + :type resource_group_name: str + :param parameters: Parameters supplied to update a resource group. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroupPatchable + :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: ResourceGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ResourceGroupPatchable') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ResourceGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'} + + + def _export_template_initial( + self, resource_group_name, resources=None, options=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ExportTemplateRequest(resources=resources, options=options) + + # Construct URL + url = self.export_template.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1) + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'ExportTemplateRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('ResourceGroupExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def export_template( + self, resource_group_name, resources=None, options=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Captures the specified resource group as a template. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resources: The IDs of the resources to filter the export by. To + export all resources, supply an array with single entry '*'. + :type resources: list[str] + :param options: The export template options. A CSV-formatted list + containing zero or more of the following: + 'IncludeParameterDefaultValue', 'IncludeComments', + 'SkipResourceNameParameterization', 'SkipAllParameterization' + :type options: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ResourceGroupExportResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroupExportResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroupExportResult]] + :raises: :class:`CloudError` + """ + raw_result = self._export_template_initial( + resource_group_name=resource_group_name, + resources=resources, + options=options, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ResourceGroupExportResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + export_template.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate'} + + def list( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all the resource groups for a subscription. + + :param filter: The filter to apply on the operation.

You can + filter by tag names and values. For example, to filter for a tag name + and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1' + :type filter: str + :param top: The number of results to return. If null is passed, + returns all resource groups. + :type top: int + :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: An iterator like instance of ResourceGroup + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroupPaged[~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ResourceGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_resources_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_resources_operations.py new file mode 100644 index 000000000000..7c4e22e81824 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_resources_operations.py @@ -0,0 +1,1318 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ResourcesOperations(object): + """ResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-01" + + self.config = config + + def list_by_resource_group( + self, resource_group_name, filter=None, expand=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the resources for a resource group. + + :param resource_group_name: The resource group with the resources to + get. + :type resource_group_name: str + :param filter: The filter to apply on the operation.

The + properties you can use for eq (equals) or ne (not equals) are: + location, resourceType, name, resourceGroup, identity, + identity/principalId, plan, plan/publisher, plan/product, plan/name, + plan/version, and plan/promotionCode.

For example, to filter by + a resource type, use: $filter=resourceType eq + 'Microsoft.Network/virtualNetworks'

You can use + substringof(value, property) in the filter. The properties you can use + for substring are: name and resourceGroup.

For example, to get + all resources with 'demo' anywhere in the name, use: + $filter=substringof('demo', name)

You can link more than one + substringof together by adding and/or operators.

You can filter + by tag names and values. For example, to filter for a tag name and + value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When + you filter by a tag name and value, the tags for each resource are not + returned in the results.

You can use some properties together + when filtering. The combinations you can use are: substringof and/or + resourceType, plan and plan/publisher and plan/name, identity and + identity/principalId. + :type filter: str + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. + :type expand: str + :param top: The number of results to return. If null is passed, + returns all resources. + :type top: int + :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: An iterator like instance of GenericResourceExpanded + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResourceExpanded] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'} + + + def _move_resources_initial( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ResourcesMoveInfo(resources=resources, target_resource_group=target_resource_group) + + # Construct URL + url = self.move_resources.metadata['url'] + path_format_arguments = { + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 body + body_content = self._serialize.body(parameters, 'ResourcesMoveInfo') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def move_resources( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Moves resources from one resource group to another resource group. + + The resources to be moved must be in the same source resource group in + the source subscription being used. The target resource group may be in + a different subscription. When moving resources, both the source group + and the target group are locked for the duration of the operation. + Write and delete operations are blocked on the groups until the move + completes. . + + :param source_resource_group_name: The name of the resource group from + the source subscription containing the resources to be moved. + :type source_resource_group_name: str + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._move_resources_initial( + source_resource_group_name=source_resource_group_name, + resources=resources, + target_resource_group=target_resource_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources'} + + + def _validate_move_resources_initial( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ResourcesMoveInfo(resources=resources, target_resource_group=target_resource_group) + + # Construct URL + url = self.validate_move_resources.metadata['url'] + path_format_arguments = { + 'sourceResourceGroupName': self._serialize.url("source_resource_group_name", source_resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 body + body_content = self._serialize.body(parameters, 'ResourcesMoveInfo') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def validate_move_resources( + self, source_resource_group_name, resources=None, target_resource_group=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates whether resources can be moved from one resource group to + another resource group. + + This operation checks whether the specified resources can be moved to + the target. The resources to be moved must be in the same source + resource group in the source subscription being used. The target + resource group may be in a different subscription. If validation + succeeds, it returns HTTP response code 204 (no content). If validation + fails, it returns HTTP response code 409 (Conflict) with an error + message. Retrieve the URL in the Location header value to check the + result of the long-running operation. + + :param source_resource_group_name: The name of the resource group from + the source subscription containing the resources to be validated for + move. + :type source_resource_group_name: str + :param resources: The IDs of the resources. + :type resources: list[str] + :param target_resource_group: The target resource group. + :type target_resource_group: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_move_resources_initial( + source_resource_group_name=source_resource_group_name, + resources=resources, + target_resource_group=target_resource_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_move_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources'} + + def list( + self, filter=None, expand=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get all the resources in a subscription. + + :param filter: The filter to apply on the operation.

The + properties you can use for eq (equals) or ne (not equals) are: + location, resourceType, name, resourceGroup, identity, + identity/principalId, plan, plan/publisher, plan/product, plan/name, + plan/version, and plan/promotionCode.

For example, to filter by + a resource type, use: $filter=resourceType eq + 'Microsoft.Network/virtualNetworks'

You can use + substringof(value, property) in the filter. The properties you can use + for substring are: name and resourceGroup.

For example, to get + all resources with 'demo' anywhere in the name, use: + $filter=substringof('demo', name)

You can link more than one + substringof together by adding and/or operators.

You can filter + by tag names and values. For example, to filter for a tag name and + value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When + you filter by a tag name and value, the tags for each resource are not + returned in the results.

You can use some properties together + when filtering. The combinations you can use are: substringof and/or + resourceType, plan and plan/publisher and plan/name, identity and + identity/principalId. + :type filter: str + :param expand: Comma-separated list of additional properties to be + included in the response. Valid values include `createdTime`, + `changedTime` and `provisioningState`. For example, + `$expand=createdTime,changedTime`. + :type expand: str + :param top: The number of results to return. If null is passed, + returns all resource groups. + :type top: int + :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: An iterator like instance of GenericResourceExpanded + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResourceExpandedPaged[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResourceExpanded] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GenericResourceExpandedPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} + + def check_existence( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + """Checks whether a resource exists. + + :param resource_group_name: The name of the resource group containing + the resource to check. The name is case insensitive. + :type resource_group_name: str + :param resource_provider_namespace: The resource provider of the + resource to check. + :type resource_provider_namespace: str + :param parent_resource_path: The parent resource identity. + :type parent_resource_path: str + :param resource_type: The resource type. + :type resource_type: str + :param resource_name: The name of the resource to check whether it + exists. + :type resource_name: str + :param api_version: The API version to use for the 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a resource. + + :param resource_group_name: The name of the resource group that + contains the resource to delete. 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. + :type resource_type: str + :param resource_name: The name of the resource to delete. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_provider_namespace=resource_provider_namespace, + parent_resource_path=parent_resource_path, + resource_type=resource_type, + resource_name=resource_name, + api_version=api_version, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + 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 [200, 201, 202]: + 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('GenericResource', response) + if response.status_code == 201: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a resource. + + :param resource_group_name: The name of the resource group for 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 to create. + :type resource_type: str + :param resource_name: The name of the resource to create. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Parameters for creating or updating the resource. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_provider_namespace=resource_provider_namespace, + parent_resource_path=parent_resource_path, + resource_type=resource_type, + resource_name=resource_name, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + + def _update_initial( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a resource. + + :param resource_group_name: The name of the resource group for 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 to update. + :type resource_type: str + :param resource_name: The name of the resource to update. + :type resource_name: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Parameters for updating the resource. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_provider_namespace=resource_provider_namespace, + parent_resource_path=parent_resource_path, + resource_type=resource_type, + resource_name=resource_name, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + def get( + self, resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers=None, raw=False, **operation_config): + """Gets a resource. + + :param resource_group_name: The name of the resource group containing + the resource to get. 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. + :type resource_type: str + :param resource_name: The name of the resource to get. + :type resource_name: str + :param api_version: The API version to use for the 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GenericResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'} + + def check_existence_by_id( + self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + """Checks by ID whether a resource exists. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_existence_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + 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.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = (response.status_code == 204) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + return deserialized + check_existence_by_id.metadata = {'url': '/{resourceId}'} + + + def _delete_by_id_initial( + self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_by_id( + self, resource_id, api_version, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_by_id_initial( + resource_id=resource_id, + api_version=api_version, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_by_id.metadata = {'url': '/{resourceId}'} + + + def _create_or_update_by_id_initial( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + 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 [200, 201, 202]: + 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('GenericResource', response) + if response.status_code == 201: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_by_id( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Create or update resource parameters. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_by_id_initial( + resource_id=resource_id, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update_by_id.metadata = {'url': '/{resourceId}'} + + + def _update_by_id_initial( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'GenericResource') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_by_id( + self, resource_id, api_version, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the operation. + :type api_version: str + :param parameters: Update resource parameters. + :type parameters: + ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GenericResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_by_id_initial( + resource_id=resource_id, + api_version=api_version, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_by_id.metadata = {'url': '/{resourceId}'} + + def get_by_id( + self, resource_id, api_version, custom_headers=None, raw=False, **operation_config): + """Gets a resource by ID. + + :param resource_id: The fully qualified ID of the resource, including + the resource name and resource type. Use the format, + /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + :type resource_id: str + :param api_version: The API version to use for the 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GenericResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GenericResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/{resourceId}'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_tags_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_tags_operations.py new file mode 100644 index 000000000000..32af7524a9a0 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_tags_operations.py @@ -0,0 +1,613 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TagsOperations(object): + """TagsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-01" + + self.config = config + + def delete_value( + self, tag_name, tag_value, custom_headers=None, raw=False, **operation_config): + """Deletes a predefined tag value for a predefined tag name. + + This operation allows deleting a value from the list of predefined + values for an existing predefined tag name. The value being deleted + must not be in use as a tag value for the given tag name for any + resource. + + :param tag_name: The name of the tag. + :type tag_name: str + :param tag_value: The value of the tag to delete. + :type tag_value: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_value.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'tagValue': self._serialize.url("tag_value", tag_value, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_value.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}'} + + def create_or_update_value( + self, tag_name, tag_value, custom_headers=None, raw=False, **operation_config): + """Creates a predefined value for a predefined tag name. + + This operation allows adding a value to the list of predefined values + for an existing predefined tag name. A tag value can have a maximum of + 256 characters. + + :param tag_name: The name of the tag. + :type tag_name: str + :param tag_value: The value of the tag to create. + :type tag_value: 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: TagValue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagValue or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update_value.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'tagValue': self._serialize.url("tag_value", tag_value, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.put(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagValue', response) + if response.status_code == 201: + deserialized = self._deserialize('TagValue', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_value.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}'} + + def create_or_update( + self, tag_name, custom_headers=None, raw=False, **operation_config): + """Creates a predefined tag name. + + This operation allows adding a name to the list of predefined tag names + for the given subscription. A tag name can have a maximum of 512 + characters and is case-insensitive. Tag names cannot have the following + prefixes which are reserved for Azure use: 'microsoft', 'azure', + 'windows'. + + :param tag_name: The name of the tag to create. + :type tag_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TagDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagDetails + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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['Accept'] = 'application/json' + 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.put(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagDetails', response) + if response.status_code == 201: + deserialized = self._deserialize('TagDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}'} + + def delete( + self, tag_name, custom_headers=None, raw=False, **operation_config): + """Deletes a predefined tag name. + + This operation allows deleting a name from the list of predefined tag + names for the given subscription. The name being deleted must not be in + use as a tag name for any resource. All predefined values for the given + name must have already been deleted. + + :param tag_name: The name of the tag. + :type tag_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'tagName': self._serialize.url("tag_name", tag_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames/{tagName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a summary of tag usage under the subscription. + + This operation performs a union of predefined tags, resource tags, + resource group tags and subscription tags, and returns a summary of + usage for each tag name and value under the given subscription. In case + of a large number of tags, this operation may return a previously + cached result. + + :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: An iterator like instance of TagDetails + :rtype: + ~azure.mgmt.resource.resources.v2021_04_01.models.TagDetailsPaged[~azure.mgmt.resource.resources.v2021_04_01.models.TagDetails] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TagDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/tagNames'} + + def create_or_update_at_scope( + self, scope, properties, custom_headers=None, raw=False, **operation_config): + """Creates or updates the entire set of tags on a resource or + subscription. + + This operation allows adding or replacing the entire set of tags on the + specified resource or subscription. The specified entity can have a + maximum of 50 tags. + + :param scope: The resource scope. + :type scope: str + :param properties: The set of tags. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.Tags + :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: TagsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagsResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.TagsResource(properties=properties) + + # Construct URL + url = self.create_or_update_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, '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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'TagsResource') + + # Construct and send request + 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 [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('TagsResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + + def update_at_scope( + self, scope, operation=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Selectively updates the set of tags on a resource or subscription. + + This operation allows replacing, merging or selectively deleting tags + on the specified resource or subscription. The specified entity can + have a maximum of 50 tags at the end of the operation. The 'replace' + option replaces the entire set of existing tags with a new set. The + 'merge' option allows adding tags with new names and updating the + values of tags with existing names. The 'delete' option allows + selectively deleting tags based on given names or name/value pairs. + + :param scope: The resource scope. + :type scope: str + :param operation: The operation type for the patch API. Possible + values include: 'Replace', 'Merge', 'Delete' + :type operation: str or + ~azure.mgmt.resource.resources.v2021_04_01.models.TagsPatchOperation + :param properties: The set of tags. + :type properties: + ~azure.mgmt.resource.resources.v2021_04_01.models.Tags + :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: TagsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagsResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.TagsPatchResource(operation=operation, properties=properties) + + # Construct URL + url = self.update_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, '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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'TagsPatchResource') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagsResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + + def get_at_scope( + self, scope, custom_headers=None, raw=False, **operation_config): + """Gets the entire set of tags on a resource or subscription. + + :param scope: The resource scope. + :type scope: 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: TagsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagsResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, '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['Accept'] = 'application/json' + 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, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagsResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} + + def delete_at_scope( + self, scope, custom_headers=None, raw=False, **operation_config): + """Deletes the entire set of tags on a resource or subscription. + + :param scope: The resource scope. + :type scope: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_at_scope.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, '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 = {} + 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.delete(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/tags/default'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/version.py new file mode 100644 index 000000000000..affaef0c987e --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_template_specs_client.py index 2bda5d6e32ee..ee18b12d1522 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_template_specs_client.py @@ -46,7 +46,7 @@ class TemplateSpecsClient(MultiApiClientMixin, SDKClient): :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2019-06-01-preview' + DEFAULT_API_VERSION = '2021-05-01' _PROFILE_TAG = "azure.mgmt.resource.templatespecs.TemplateSpecsClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -74,6 +74,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-06-01-preview: :mod:`v2019_06_01_preview.models` * 2019-06-01-preview: :mod:`v2019_06_preview.models` + * 2021-03-01-preview: :mod:`v2021_03_01_preview.models` + * 2021-05-01: :mod:`v2021_05_01.models` """ if api_version == '2019-06-01-preview': from .v2019_06_01_preview import models @@ -81,6 +83,12 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-06-01-preview': from .v2019_06_preview import models return models + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview import models + return models + elif api_version == '2021-05-01': + from .v2021_05_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -89,12 +97,18 @@ def template_spec_versions(self): * 2019-06-01-preview: :class:`TemplateSpecVersionsOperations` * 2019-06-01-preview: :class:`TemplateSpecVersionsOperations` + * 2021-03-01-preview: :class:`TemplateSpecVersionsOperations` + * 2021-05-01: :class:`TemplateSpecVersionsOperations` """ api_version = self._get_api_version('template_spec_versions') if api_version == '2019-06-01-preview': from .v2019_06_01_preview.operations import TemplateSpecVersionsOperations as OperationClass elif api_version == '2019-06-01-preview': from .v2019_06_preview.operations import TemplateSpecVersionsOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import TemplateSpecVersionsOperations as OperationClass + elif api_version == '2021-05-01': + from .v2021_05_01.operations import TemplateSpecVersionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -105,12 +119,18 @@ def template_specs(self): * 2019-06-01-preview: :class:`TemplateSpecsOperations` * 2019-06-01-preview: :class:`TemplateSpecsOperations` + * 2021-03-01-preview: :class:`TemplateSpecsOperations` + * 2021-05-01: :class:`TemplateSpecsOperations` """ api_version = self._get_api_version('template_specs') if api_version == '2019-06-01-preview': from .v2019_06_01_preview.operations import TemplateSpecsOperations as OperationClass elif api_version == '2019-06-01-preview': from .v2019_06_preview.operations import TemplateSpecsOperations as OperationClass + elif api_version == '2021-03-01-preview': + from .v2021_03_01_preview.operations import TemplateSpecsOperations as OperationClass + elif api_version == '2021-05-01': + from .v2021_05_01.operations import TemplateSpecsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/models.py index ee3facccb01d..ce393b27bae3 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/models.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/models.py @@ -4,4 +4,4 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2019_06_preview.models import * +from .v2021_05_01.models import * diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/__init__.py new file mode 100644 index 000000000000..d2ef69b9f8ab --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import TemplateSpecsClientConfiguration +from ._template_specs_client import TemplateSpecsClient +__all__ = ['TemplateSpecsClient', 'TemplateSpecsClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_configuration.py new file mode 100644 index 000000000000..ef8679ee0fec --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_configuration.py @@ -0,0 +1,49 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class TemplateSpecsClientConfiguration(AzureConfiguration): + """Configuration for TemplateSpecsClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription Id which forms part of the URI for + every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(TemplateSpecsClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py new file mode 100644 index 000000000000..f0814dbe844d --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py @@ -0,0 +1,55 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import TemplateSpecsClientConfiguration +from .operations import TemplateSpecsOperations +from .operations import TemplateSpecVersionsOperations +from . import models + + +class TemplateSpecsClient(SDKClient): + """The APIs listed in this specification can be used to manage Template Spec resources through the Azure Resource Manager. + + :ivar config: Configuration for client. + :vartype config: TemplateSpecsClientConfiguration + + :ivar template_specs: TemplateSpecs operations + :vartype template_specs: azure.mgmt.resource.templatespecs.v2021_03_01_preview.operations.TemplateSpecsOperations + :ivar template_spec_versions: TemplateSpecVersions operations + :vartype template_spec_versions: azure.mgmt.resource.templatespecs.v2021_03_01_preview.operations.TemplateSpecVersionsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription Id which forms part of the URI for + every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = TemplateSpecsClientConfiguration(credentials, subscription_id, base_url) + super(TemplateSpecsClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-03-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.template_specs = TemplateSpecsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.template_spec_versions = TemplateSpecVersionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/__init__.py new file mode 100644 index 000000000000..5d9fb059859a --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/__init__.py @@ -0,0 +1,59 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AzureResourceBase + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse + from ._models_py3 import LinkedTemplateArtifact + from ._models_py3 import SystemData + from ._models_py3 import TemplateSpec + from ._models_py3 import TemplateSpecsError, TemplateSpecsErrorException + from ._models_py3 import TemplateSpecUpdateModel + from ._models_py3 import TemplateSpecVersion + from ._models_py3 import TemplateSpecVersionInfo + from ._models_py3 import TemplateSpecVersionUpdateModel +except (SyntaxError, ImportError): + from ._models import AzureResourceBase + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse + from ._models import LinkedTemplateArtifact + from ._models import SystemData + from ._models import TemplateSpec + from ._models import TemplateSpecsError, TemplateSpecsErrorException + from ._models import TemplateSpecUpdateModel + from ._models import TemplateSpecVersion + from ._models import TemplateSpecVersionInfo + from ._models import TemplateSpecVersionUpdateModel +from ._paged_models import TemplateSpecPaged +from ._paged_models import TemplateSpecVersionPaged +from ._template_specs_client_enums import ( + CreatedByType, + TemplateSpecExpandKind, +) + +__all__ = [ + 'AzureResourceBase', + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'LinkedTemplateArtifact', + 'SystemData', + 'TemplateSpec', + 'TemplateSpecsError', 'TemplateSpecsErrorException', + 'TemplateSpecUpdateModel', + 'TemplateSpecVersion', + 'TemplateSpecVersionInfo', + 'TemplateSpecVersionUpdateModel', + 'TemplateSpecPaged', + 'TemplateSpecVersionPaged', + 'CreatedByType', + 'TemplateSpecExpandKind', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models.py new file mode 100644 index 000000000000..0e4c26f814aa --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models.py @@ -0,0 +1,494 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class AzureResourceBase(Model): + """Common properties for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs): + super(AzureResourceBase, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.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.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class LinkedTemplateArtifact(Model): + """Represents a Template Spec artifact containing an embedded Azure Resource + Manager template for use as a linked template. + + All required parameters must be populated in order to send to Azure. + + :param path: Required. A filesystem safe relative path of the artifact. + :type path: str + :param template: Required. The Azure Resource Manager template. + :type template: object + """ + + _validation = { + 'path': {'required': True}, + 'template': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(LinkedTemplateArtifact, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.template = kwargs.get('template', None) + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TemplateSpec(AzureResourceBase): + """Template Spec object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + :param location: Required. The location of the Template Spec. It cannot be + changed after Template Spec creation. It must be one of the supported + Azure locations. + :type location: str + :param description: Template Spec description. + :type description: str + :param display_name: Template Spec display name. + :type display_name: str + :param metadata: The Template Spec metadata. Metadata is an open-ended + object and is typically a collection of key-value pairs. + :type metadata: object + :ivar versions: High-level information about the versions within this + Template Spec. The keys are the version names. Only populated if the + $expand query parameter is set to 'versions'. + :vartype versions: dict[str, + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersionInfo] + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096}, + 'display_name': {'max_length': 64}, + 'versions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'versions': {'key': 'properties.versions', 'type': '{TemplateSpecVersionInfo}'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TemplateSpec, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.description = kwargs.get('description', None) + self.display_name = kwargs.get('display_name', None) + self.metadata = kwargs.get('metadata', None) + self.versions = None + self.tags = kwargs.get('tags', None) + + +class TemplateSpecsError(Model): + """Template Specs error response. + + :param error: + :type error: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecsError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class TemplateSpecsErrorException(HttpOperationError): + """Server responsed with exception of type: 'TemplateSpecsError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(TemplateSpecsErrorException, self).__init__(deserialize, response, 'TemplateSpecsError', *args) + + +class TemplateSpecUpdateModel(AzureResourceBase): + """Template Spec properties to be updated (only tags are currently supported). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecUpdateModel, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class TemplateSpecVersion(AzureResourceBase): + """Template Spec Version object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + :param location: Required. The location of the Template Spec Version. It + must match the location of the parent Template Spec. + :type location: str + :param description: Template Spec version description. + :type description: str + :param linked_templates: An array of linked template artifacts. + :type linked_templates: + list[~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.LinkedTemplateArtifact] + :param metadata: The version metadata. Metadata is an open-ended object + and is typically a collection of key-value pairs. + :type metadata: object + :param main_template: The main Azure Resource Manager template content. + :type main_template: object + :param ui_form_definition: The Azure Resource Manager template UI + definition content. + :type ui_form_definition: object + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'linked_templates': {'key': 'properties.linkedTemplates', 'type': '[LinkedTemplateArtifact]'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'main_template': {'key': 'properties.mainTemplate', 'type': 'object'}, + 'ui_form_definition': {'key': 'properties.uiFormDefinition', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecVersion, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.description = kwargs.get('description', None) + self.linked_templates = kwargs.get('linked_templates', None) + self.metadata = kwargs.get('metadata', None) + self.main_template = kwargs.get('main_template', None) + self.ui_form_definition = kwargs.get('ui_form_definition', None) + self.tags = kwargs.get('tags', None) + + +class TemplateSpecVersionInfo(Model): + """High-level information about a Template Spec version. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar description: Template Spec version description. + :vartype description: str + :ivar time_created: The timestamp of when the version was created. + :vartype time_created: datetime + :ivar time_modified: The timestamp of when the version was last modified. + :vartype time_modified: datetime + """ + + _validation = { + 'description': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'time_modified': {'key': 'timeModified', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecVersionInfo, self).__init__(**kwargs) + self.description = None + self.time_created = None + self.time_modified = None + + +class TemplateSpecVersionUpdateModel(AzureResourceBase): + """Template Spec Version properties to be updated (only tags are currently + supported). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecVersionUpdateModel, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..3649dbed55d5 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models_py3.py @@ -0,0 +1,494 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class AzureResourceBase(Model): + """Common properties for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureResourceBase, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.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.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class LinkedTemplateArtifact(Model): + """Represents a Template Spec artifact containing an embedded Azure Resource + Manager template for use as a linked template. + + All required parameters must be populated in order to send to Azure. + + :param path: Required. A filesystem safe relative path of the artifact. + :type path: str + :param template: Required. The Azure Resource Manager template. + :type template: object + """ + + _validation = { + 'path': {'required': True}, + 'template': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, *, path: str, template, **kwargs) -> None: + super(LinkedTemplateArtifact, self).__init__(**kwargs) + self.path = path + self.template = template + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TemplateSpec(AzureResourceBase): + """Template Spec object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + :param location: Required. The location of the Template Spec. It cannot be + changed after Template Spec creation. It must be one of the supported + Azure locations. + :type location: str + :param description: Template Spec description. + :type description: str + :param display_name: Template Spec display name. + :type display_name: str + :param metadata: The Template Spec metadata. Metadata is an open-ended + object and is typically a collection of key-value pairs. + :type metadata: object + :ivar versions: High-level information about the versions within this + Template Spec. The keys are the version names. Only populated if the + $expand query parameter is set to 'versions'. + :vartype versions: dict[str, + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersionInfo] + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096}, + 'display_name': {'max_length': 64}, + 'versions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'versions': {'key': 'properties.versions', 'type': '{TemplateSpecVersionInfo}'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, description: str=None, display_name: str=None, metadata=None, tags=None, **kwargs) -> None: + super(TemplateSpec, self).__init__(**kwargs) + self.location = location + self.description = description + self.display_name = display_name + self.metadata = metadata + self.versions = None + self.tags = tags + + +class TemplateSpecsError(Model): + """Template Specs error response. + + :param error: + :type error: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(TemplateSpecsError, self).__init__(**kwargs) + self.error = error + + +class TemplateSpecsErrorException(HttpOperationError): + """Server responsed with exception of type: 'TemplateSpecsError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(TemplateSpecsErrorException, self).__init__(deserialize, response, 'TemplateSpecsError', *args) + + +class TemplateSpecUpdateModel(AzureResourceBase): + """Template Spec properties to be updated (only tags are currently supported). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TemplateSpecUpdateModel, self).__init__(**kwargs) + self.tags = tags + + +class TemplateSpecVersion(AzureResourceBase): + """Template Spec Version object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + :param location: Required. The location of the Template Spec Version. It + must match the location of the parent Template Spec. + :type location: str + :param description: Template Spec version description. + :type description: str + :param linked_templates: An array of linked template artifacts. + :type linked_templates: + list[~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.LinkedTemplateArtifact] + :param metadata: The version metadata. Metadata is an open-ended object + and is typically a collection of key-value pairs. + :type metadata: object + :param main_template: The main Azure Resource Manager template content. + :type main_template: object + :param ui_form_definition: The Azure Resource Manager template UI + definition content. + :type ui_form_definition: object + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'linked_templates': {'key': 'properties.linkedTemplates', 'type': '[LinkedTemplateArtifact]'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'main_template': {'key': 'properties.mainTemplate', 'type': 'object'}, + 'ui_form_definition': {'key': 'properties.uiFormDefinition', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, description: str=None, linked_templates=None, metadata=None, main_template=None, ui_form_definition=None, tags=None, **kwargs) -> None: + super(TemplateSpecVersion, self).__init__(**kwargs) + self.location = location + self.description = description + self.linked_templates = linked_templates + self.metadata = metadata + self.main_template = main_template + self.ui_form_definition = ui_form_definition + self.tags = tags + + +class TemplateSpecVersionInfo(Model): + """High-level information about a Template Spec version. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar description: Template Spec version description. + :vartype description: str + :ivar time_created: The timestamp of when the version was created. + :vartype time_created: datetime + :ivar time_modified: The timestamp of when the version was last modified. + :vartype time_modified: datetime + """ + + _validation = { + 'description': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'time_modified': {'key': 'timeModified', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(TemplateSpecVersionInfo, self).__init__(**kwargs) + self.description = None + self.time_created = None + self.time_modified = None + + +class TemplateSpecVersionUpdateModel(AzureResourceBase): + """Template Spec Version properties to be updated (only tags are currently + supported). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TemplateSpecVersionUpdateModel, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..15d3aa026b5a --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_paged_models.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class TemplateSpecPaged(Paged): + """ + A paging container for iterating over a list of :class:`TemplateSpec ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TemplateSpec]'} + } + + def __init__(self, *args, **kwargs): + + super(TemplateSpecPaged, self).__init__(*args, **kwargs) +class TemplateSpecVersionPaged(Paged): + """ + A paging container for iterating over a list of :class:`TemplateSpecVersion ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TemplateSpecVersion]'} + } + + def __init__(self, *args, **kwargs): + + super(TemplateSpecVersionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_template_specs_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_template_specs_client_enums.py new file mode 100644 index 000000000000..372b2739eb53 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_template_specs_client_enums.py @@ -0,0 +1,25 @@ +# 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 enum import Enum + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class TemplateSpecExpandKind(str, Enum): + + versions = "versions" #: Includes version information with the Template Spec. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/__init__.py new file mode 100644 index 000000000000..46ffcf9773bb --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/__init__.py @@ -0,0 +1,18 @@ +# 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 ._template_specs_operations import TemplateSpecsOperations +from ._template_spec_versions_operations import TemplateSpecVersionsOperations + +__all__ = [ + 'TemplateSpecsOperations', + 'TemplateSpecVersionsOperations', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_template_spec_versions_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_template_spec_versions_operations.py new file mode 100644 index 000000000000..7a312dd04bbd --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_template_spec_versions_operations.py @@ -0,0 +1,386 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TemplateSpecVersionsOperations(object): + """TemplateSpecVersionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api version. Constant value: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-01-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, template_spec_name, template_spec_version, template_spec_version_model, custom_headers=None, raw=False, **operation_config): + """Creates or updates a Template Spec version. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec_version: The version of the Template Spec. + :type template_spec_version: str + :param template_spec_version_model: Template Spec Version supplied to + the operation. + :type template_spec_version_model: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion + :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: TemplateSpecVersion or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecVersion': self._serialize.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(template_spec_version_model, 'TemplateSpecVersion') + + # Construct and send request + 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 [200, 201]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpecVersion', response) + if response.status_code == 201: + deserialized = self._deserialize('TemplateSpecVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}'} + + def update( + self, resource_group_name, template_spec_name, template_spec_version, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates Template Spec Version tags with specified values. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec_version: The version of the Template Spec. + :type template_spec_version: str + :param tags: Resource tags. + :type tags: dict[str, 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: TemplateSpecVersion or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + template_spec_version_update_model = None + if tags is not None: + template_spec_version_update_model = models.TemplateSpecVersionUpdateModel(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecVersion': self._serialize.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + if template_spec_version_update_model is not None: + body_content = self._serialize.body(template_spec_version_update_model, 'TemplateSpecVersionUpdateModel') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpecVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}'} + + def get( + self, resource_group_name, template_spec_name, template_spec_version, custom_headers=None, raw=False, **operation_config): + """Gets a Template Spec version from a specific Template Spec. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec_version: The version of the Template Spec. + :type template_spec_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TemplateSpecVersion or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecVersion': self._serialize.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpecVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}'} + + def delete( + self, resource_group_name, template_spec_name, template_spec_version, custom_headers=None, raw=False, **operation_config): + """Deletes a specific version from a Template Spec. When operation + completes, status code 200 returned without content. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec_version: The version of the Template Spec. + :type template_spec_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecVersion': self._serialize.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}'} + + def list( + self, resource_group_name, template_spec_name, custom_headers=None, raw=False, **operation_config): + """Lists all the Template Spec versions in the specified Template Spec. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TemplateSpecVersion + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersionPaged[~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion] + :raises: + :class:`TemplateSpecsErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TemplateSpecVersionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_template_specs_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_template_specs_operations.py new file mode 100644 index 000000000000..cc906e039933 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_template_specs_operations.py @@ -0,0 +1,453 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TemplateSpecsOperations(object): + """TemplateSpecsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api version. Constant value: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-01-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, template_spec_name, template_spec, custom_headers=None, raw=False, **operation_config): + """Creates or updates a Template Spec. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec: Template Spec supplied to the operation. + :type template_spec: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec + :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: TemplateSpec or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(template_spec, 'TemplateSpec') + + # Construct and send request + 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 [200, 201]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpec', response) + if response.status_code == 201: + deserialized = self._deserialize('TemplateSpec', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}'} + + def update( + self, resource_group_name, template_spec_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates Template Spec tags with specified values. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param tags: Resource tags. + :type tags: dict[str, 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: TemplateSpec or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + template_spec = None + if tags is not None: + template_spec = models.TemplateSpecUpdateModel(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + if template_spec is not None: + body_content = self._serialize.body(template_spec, 'TemplateSpecUpdateModel') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpec', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}'} + + def get( + self, resource_group_name, template_spec_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets a Template Spec with a given name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param expand: Allows for expansion of additional Template Spec + details in the response. Optional. Possible values include: 'versions' + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecExpandKind + :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: TemplateSpec or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpec', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}'} + + def delete( + self, resource_group_name, template_spec_name, custom_headers=None, raw=False, **operation_config): + """Deletes a Template Spec by name. When operation completes, status code + 200 returned without content. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}'} + + def list_by_subscription( + self, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all the Template Specs within the specified subscriptions. + + :param expand: Allows for expansion of additional Template Spec + details in the response. Optional. Possible values include: 'versions' + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecExpandKind + :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: An iterator like instance of TemplateSpec + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecPaged[~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec] + :raises: + :class:`TemplateSpecsErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TemplateSpecPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/'} + + def list_by_resource_group( + self, resource_group_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all the Template Specs within the specified resource group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param expand: Allows for expansion of additional Template Spec + details in the response. Optional. Possible values include: 'versions' + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecExpandKind + :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: An iterator like instance of TemplateSpec + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecPaged[~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec] + :raises: + :class:`TemplateSpecsErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TemplateSpecPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/version.py new file mode 100644 index 000000000000..affaef0c987e --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/__init__.py new file mode 100644 index 000000000000..d2ef69b9f8ab --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import TemplateSpecsClientConfiguration +from ._template_specs_client import TemplateSpecsClient +__all__ = ['TemplateSpecsClient', 'TemplateSpecsClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_configuration.py new file mode 100644 index 000000000000..ef8679ee0fec --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_configuration.py @@ -0,0 +1,49 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class TemplateSpecsClientConfiguration(AzureConfiguration): + """Configuration for TemplateSpecsClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription Id which forms part of the URI for + every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(TemplateSpecsClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py new file mode 100644 index 000000000000..d307c9932004 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py @@ -0,0 +1,55 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import TemplateSpecsClientConfiguration +from .operations import TemplateSpecsOperations +from .operations import TemplateSpecVersionsOperations +from . import models + + +class TemplateSpecsClient(SDKClient): + """The APIs listed in this specification can be used to manage Template Spec resources through the Azure Resource Manager. + + :ivar config: Configuration for client. + :vartype config: TemplateSpecsClientConfiguration + + :ivar template_specs: TemplateSpecs operations + :vartype template_specs: azure.mgmt.resource.templatespecs.v2021_05_01.operations.TemplateSpecsOperations + :ivar template_spec_versions: TemplateSpecVersions operations + :vartype template_spec_versions: azure.mgmt.resource.templatespecs.v2021_05_01.operations.TemplateSpecVersionsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription Id which forms part of the URI for + every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = TemplateSpecsClientConfiguration(credentials, subscription_id, base_url) + super(TemplateSpecsClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-05-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.template_specs = TemplateSpecsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.template_spec_versions = TemplateSpecVersionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/__init__.py new file mode 100644 index 000000000000..5d9fb059859a --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/__init__.py @@ -0,0 +1,59 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AzureResourceBase + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse + from ._models_py3 import LinkedTemplateArtifact + from ._models_py3 import SystemData + from ._models_py3 import TemplateSpec + from ._models_py3 import TemplateSpecsError, TemplateSpecsErrorException + from ._models_py3 import TemplateSpecUpdateModel + from ._models_py3 import TemplateSpecVersion + from ._models_py3 import TemplateSpecVersionInfo + from ._models_py3 import TemplateSpecVersionUpdateModel +except (SyntaxError, ImportError): + from ._models import AzureResourceBase + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse + from ._models import LinkedTemplateArtifact + from ._models import SystemData + from ._models import TemplateSpec + from ._models import TemplateSpecsError, TemplateSpecsErrorException + from ._models import TemplateSpecUpdateModel + from ._models import TemplateSpecVersion + from ._models import TemplateSpecVersionInfo + from ._models import TemplateSpecVersionUpdateModel +from ._paged_models import TemplateSpecPaged +from ._paged_models import TemplateSpecVersionPaged +from ._template_specs_client_enums import ( + CreatedByType, + TemplateSpecExpandKind, +) + +__all__ = [ + 'AzureResourceBase', + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'LinkedTemplateArtifact', + 'SystemData', + 'TemplateSpec', + 'TemplateSpecsError', 'TemplateSpecsErrorException', + 'TemplateSpecUpdateModel', + 'TemplateSpecVersion', + 'TemplateSpecVersionInfo', + 'TemplateSpecVersionUpdateModel', + 'TemplateSpecPaged', + 'TemplateSpecVersionPaged', + 'CreatedByType', + 'TemplateSpecExpandKind', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models.py new file mode 100644 index 000000000000..376ff0aa9642 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models.py @@ -0,0 +1,494 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class AzureResourceBase(Model): + """Common properties for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs): + super(AzureResourceBase, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.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.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.templatespecs.v2021_05_01.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.templatespecs.v2021_05_01.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class LinkedTemplateArtifact(Model): + """Represents a Template Spec artifact containing an embedded Azure Resource + Manager template for use as a linked template. + + All required parameters must be populated in order to send to Azure. + + :param path: Required. A filesystem safe relative path of the artifact. + :type path: str + :param template: Required. The Azure Resource Manager template. + :type template: object + """ + + _validation = { + 'path': {'required': True}, + 'template': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(LinkedTemplateArtifact, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.template = kwargs.get('template', None) + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TemplateSpec(AzureResourceBase): + """Template Spec object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + :param location: Required. The location of the Template Spec. It cannot be + changed after Template Spec creation. It must be one of the supported + Azure locations. + :type location: str + :param description: Template Spec description. + :type description: str + :param display_name: Template Spec display name. + :type display_name: str + :param metadata: The Template Spec metadata. Metadata is an open-ended + object and is typically a collection of key-value pairs. + :type metadata: object + :ivar versions: High-level information about the versions within this + Template Spec. The keys are the version names. Only populated if the + $expand query parameter is set to 'versions'. + :vartype versions: dict[str, + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersionInfo] + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096}, + 'display_name': {'max_length': 64}, + 'versions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'versions': {'key': 'properties.versions', 'type': '{TemplateSpecVersionInfo}'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TemplateSpec, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.description = kwargs.get('description', None) + self.display_name = kwargs.get('display_name', None) + self.metadata = kwargs.get('metadata', None) + self.versions = None + self.tags = kwargs.get('tags', None) + + +class TemplateSpecsError(Model): + """Template Specs error response. + + :param error: + :type error: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecsError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class TemplateSpecsErrorException(HttpOperationError): + """Server responsed with exception of type: 'TemplateSpecsError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(TemplateSpecsErrorException, self).__init__(deserialize, response, 'TemplateSpecsError', *args) + + +class TemplateSpecUpdateModel(AzureResourceBase): + """Template Spec properties to be updated (only tags are currently supported). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecUpdateModel, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class TemplateSpecVersion(AzureResourceBase): + """Template Spec Version object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + :param location: Required. The location of the Template Spec Version. It + must match the location of the parent Template Spec. + :type location: str + :param description: Template Spec version description. + :type description: str + :param linked_templates: An array of linked template artifacts. + :type linked_templates: + list[~azure.mgmt.resource.templatespecs.v2021_05_01.models.LinkedTemplateArtifact] + :param metadata: The version metadata. Metadata is an open-ended object + and is typically a collection of key-value pairs. + :type metadata: object + :param main_template: The main Azure Resource Manager template content. + :type main_template: object + :param ui_form_definition: The Azure Resource Manager template UI + definition content. + :type ui_form_definition: object + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'linked_templates': {'key': 'properties.linkedTemplates', 'type': '[LinkedTemplateArtifact]'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'main_template': {'key': 'properties.mainTemplate', 'type': 'object'}, + 'ui_form_definition': {'key': 'properties.uiFormDefinition', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecVersion, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.description = kwargs.get('description', None) + self.linked_templates = kwargs.get('linked_templates', None) + self.metadata = kwargs.get('metadata', None) + self.main_template = kwargs.get('main_template', None) + self.ui_form_definition = kwargs.get('ui_form_definition', None) + self.tags = kwargs.get('tags', None) + + +class TemplateSpecVersionInfo(Model): + """High-level information about a Template Spec version. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar description: Template Spec version description. + :vartype description: str + :ivar time_created: The timestamp of when the version was created. + :vartype time_created: datetime + :ivar time_modified: The timestamp of when the version was last modified. + :vartype time_modified: datetime + """ + + _validation = { + 'description': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'time_modified': {'key': 'timeModified', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecVersionInfo, self).__init__(**kwargs) + self.description = None + self.time_created = None + self.time_modified = None + + +class TemplateSpecVersionUpdateModel(AzureResourceBase): + """Template Spec Version properties to be updated (only tags are currently + supported). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TemplateSpecVersionUpdateModel, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models_py3.py new file mode 100644 index 000000000000..36fec3a128b9 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models_py3.py @@ -0,0 +1,494 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class AzureResourceBase(Model): + """Common properties for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureResourceBase, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.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.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resource.templatespecs.v2021_05_01.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.templatespecs.v2021_05_01.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class LinkedTemplateArtifact(Model): + """Represents a Template Spec artifact containing an embedded Azure Resource + Manager template for use as a linked template. + + All required parameters must be populated in order to send to Azure. + + :param path: Required. A filesystem safe relative path of the artifact. + :type path: str + :param template: Required. The Azure Resource Manager template. + :type template: object + """ + + _validation = { + 'path': {'required': True}, + 'template': {'required': True}, + } + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, *, path: str, template, **kwargs) -> None: + super(LinkedTemplateArtifact, self).__init__(**kwargs) + self.path = path + self.template = template + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TemplateSpec(AzureResourceBase): + """Template Spec object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + :param location: Required. The location of the Template Spec. It cannot be + changed after Template Spec creation. It must be one of the supported + Azure locations. + :type location: str + :param description: Template Spec description. + :type description: str + :param display_name: Template Spec display name. + :type display_name: str + :param metadata: The Template Spec metadata. Metadata is an open-ended + object and is typically a collection of key-value pairs. + :type metadata: object + :ivar versions: High-level information about the versions within this + Template Spec. The keys are the version names. Only populated if the + $expand query parameter is set to 'versions'. + :vartype versions: dict[str, + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersionInfo] + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096}, + 'display_name': {'max_length': 64}, + 'versions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'versions': {'key': 'properties.versions', 'type': '{TemplateSpecVersionInfo}'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, description: str=None, display_name: str=None, metadata=None, tags=None, **kwargs) -> None: + super(TemplateSpec, self).__init__(**kwargs) + self.location = location + self.description = description + self.display_name = display_name + self.metadata = metadata + self.versions = None + self.tags = tags + + +class TemplateSpecsError(Model): + """Template Specs error response. + + :param error: + :type error: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(TemplateSpecsError, self).__init__(**kwargs) + self.error = error + + +class TemplateSpecsErrorException(HttpOperationError): + """Server responsed with exception of type: 'TemplateSpecsError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(TemplateSpecsErrorException, self).__init__(deserialize, response, 'TemplateSpecsError', *args) + + +class TemplateSpecUpdateModel(AzureResourceBase): + """Template Spec properties to be updated (only tags are currently supported). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TemplateSpecUpdateModel, self).__init__(**kwargs) + self.tags = tags + + +class TemplateSpecVersion(AzureResourceBase): + """Template Spec Version object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + :param location: Required. The location of the Template Spec Version. It + must match the location of the parent Template Spec. + :type location: str + :param description: Template Spec version description. + :type description: str + :param linked_templates: An array of linked template artifacts. + :type linked_templates: + list[~azure.mgmt.resource.templatespecs.v2021_05_01.models.LinkedTemplateArtifact] + :param metadata: The version metadata. Metadata is an open-ended object + and is typically a collection of key-value pairs. + :type metadata: object + :param main_template: The main Azure Resource Manager template content. + :type main_template: object + :param ui_form_definition: The Azure Resource Manager template UI + definition content. + :type ui_form_definition: object + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'linked_templates': {'key': 'properties.linkedTemplates', 'type': '[LinkedTemplateArtifact]'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'main_template': {'key': 'properties.mainTemplate', 'type': 'object'}, + 'ui_form_definition': {'key': 'properties.uiFormDefinition', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, description: str=None, linked_templates=None, metadata=None, main_template=None, ui_form_definition=None, tags=None, **kwargs) -> None: + super(TemplateSpecVersion, self).__init__(**kwargs) + self.location = location + self.description = description + self.linked_templates = linked_templates + self.metadata = metadata + self.main_template = main_template + self.ui_form_definition = ui_form_definition + self.tags = tags + + +class TemplateSpecVersionInfo(Model): + """High-level information about a Template Spec version. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar description: Template Spec version description. + :vartype description: str + :ivar time_created: The timestamp of when the version was created. + :vartype time_created: datetime + :ivar time_modified: The timestamp of when the version was last modified. + :vartype time_modified: datetime + """ + + _validation = { + 'description': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'time_modified': {'key': 'timeModified', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(TemplateSpecVersionInfo, self).__init__(**kwargs) + self.description = None + self.time_created = None + self.time_modified = None + + +class TemplateSpecVersionUpdateModel(AzureResourceBase): + """Template Spec Version properties to be updated (only tags are currently + supported). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar name: Name of this resource. + :vartype name: str + :ivar type: Type of this resource. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.SystemData + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TemplateSpecVersionUpdateModel, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_paged_models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_paged_models.py new file mode 100644 index 000000000000..ab62e5e58b43 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_paged_models.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class TemplateSpecPaged(Paged): + """ + A paging container for iterating over a list of :class:`TemplateSpec ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TemplateSpec]'} + } + + def __init__(self, *args, **kwargs): + + super(TemplateSpecPaged, self).__init__(*args, **kwargs) +class TemplateSpecVersionPaged(Paged): + """ + A paging container for iterating over a list of :class:`TemplateSpecVersion ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TemplateSpecVersion]'} + } + + def __init__(self, *args, **kwargs): + + super(TemplateSpecVersionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_template_specs_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_template_specs_client_enums.py new file mode 100644 index 000000000000..372b2739eb53 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_template_specs_client_enums.py @@ -0,0 +1,25 @@ +# 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 enum import Enum + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class TemplateSpecExpandKind(str, Enum): + + versions = "versions" #: Includes version information with the Template Spec. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/__init__.py new file mode 100644 index 000000000000..46ffcf9773bb --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/__init__.py @@ -0,0 +1,18 @@ +# 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 ._template_specs_operations import TemplateSpecsOperations +from ._template_spec_versions_operations import TemplateSpecVersionsOperations + +__all__ = [ + 'TemplateSpecsOperations', + 'TemplateSpecVersionsOperations', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_template_spec_versions_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_template_spec_versions_operations.py new file mode 100644 index 000000000000..f3cbf9c98b81 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_template_spec_versions_operations.py @@ -0,0 +1,386 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TemplateSpecVersionsOperations(object): + """TemplateSpecVersionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api version. Constant value: "2021-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-05-01" + + self.config = config + + def create_or_update( + self, resource_group_name, template_spec_name, template_spec_version, template_spec_version_model, custom_headers=None, raw=False, **operation_config): + """Creates or updates a Template Spec version. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec_version: The version of the Template Spec. + :type template_spec_version: str + :param template_spec_version_model: Template Spec Version supplied to + the operation. + :type template_spec_version_model: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion + :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: TemplateSpecVersion or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecVersion': self._serialize.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(template_spec_version_model, 'TemplateSpecVersion') + + # Construct and send request + 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 [200, 201]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpecVersion', response) + if response.status_code == 201: + deserialized = self._deserialize('TemplateSpecVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}'} + + def update( + self, resource_group_name, template_spec_name, template_spec_version, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates Template Spec Version tags with specified values. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec_version: The version of the Template Spec. + :type template_spec_version: str + :param tags: Resource tags. + :type tags: dict[str, 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: TemplateSpecVersion or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + template_spec_version_update_model = None + if tags is not None: + template_spec_version_update_model = models.TemplateSpecVersionUpdateModel(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecVersion': self._serialize.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + if template_spec_version_update_model is not None: + body_content = self._serialize.body(template_spec_version_update_model, 'TemplateSpecVersionUpdateModel') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpecVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}'} + + def get( + self, resource_group_name, template_spec_name, template_spec_version, custom_headers=None, raw=False, **operation_config): + """Gets a Template Spec version from a specific Template Spec. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec_version: The version of the Template Spec. + :type template_spec_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TemplateSpecVersion or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecVersion': self._serialize.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpecVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}'} + + def delete( + self, resource_group_name, template_spec_name, template_spec_version, custom_headers=None, raw=False, **operation_config): + """Deletes a specific version from a Template Spec. When operation + completes, status code 200 returned without content. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec_version: The version of the Template Spec. + :type template_spec_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecVersion': self._serialize.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}'} + + def list( + self, resource_group_name, template_spec_name, custom_headers=None, raw=False, **operation_config): + """Lists all the Template Spec versions in the specified Template Spec. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TemplateSpecVersion + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersionPaged[~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion] + :raises: + :class:`TemplateSpecsErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TemplateSpecVersionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_template_specs_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_template_specs_operations.py new file mode 100644 index 000000000000..69c3a3d2b1aa --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_template_specs_operations.py @@ -0,0 +1,453 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TemplateSpecsOperations(object): + """TemplateSpecsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api version. Constant value: "2021-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-05-01" + + self.config = config + + def create_or_update( + self, resource_group_name, template_spec_name, template_spec, custom_headers=None, raw=False, **operation_config): + """Creates or updates a Template Spec. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param template_spec: Template Spec supplied to the operation. + :type template_spec: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec + :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: TemplateSpec or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(template_spec, 'TemplateSpec') + + # Construct and send request + 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 [200, 201]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpec', response) + if response.status_code == 201: + deserialized = self._deserialize('TemplateSpec', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}'} + + def update( + self, resource_group_name, template_spec_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates Template Spec tags with specified values. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param tags: Resource tags. + :type tags: dict[str, 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: TemplateSpec or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + template_spec = None + if tags is not None: + template_spec = models.TemplateSpecUpdateModel(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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['Accept'] = 'application/json' + 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 body + if template_spec is not None: + body_content = self._serialize.body(template_spec, 'TemplateSpecUpdateModel') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpec', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}'} + + def get( + self, resource_group_name, template_spec_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets a Template Spec with a given name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :param expand: Allows for expansion of additional Template Spec + details in the response. Optional. Possible values include: 'versions' + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecExpandKind + :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: TemplateSpec or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpec', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}'} + + def delete( + self, resource_group_name, template_spec_name, custom_headers=None, raw=False, **operation_config): + """Deletes a Template Spec by name. When operation completes, status code + 200 returned without content. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param template_spec_name: Name of the Template Spec. + :type template_spec_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`TemplateSpecsErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'templateSpecName': self._serialize.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}'} + + def list_by_subscription( + self, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all the Template Specs within the specified subscriptions. + + :param expand: Allows for expansion of additional Template Spec + details in the response. Optional. Possible values include: 'versions' + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecExpandKind + :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: An iterator like instance of TemplateSpec + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecPaged[~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec] + :raises: + :class:`TemplateSpecsErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TemplateSpecPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/'} + + def list_by_resource_group( + self, resource_group_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all the Template Specs within the specified resource group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param expand: Allows for expansion of additional Template Spec + details in the response. Optional. Possible values include: 'versions' + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecExpandKind + :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: An iterator like instance of TemplateSpec + :rtype: + ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecPaged[~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec] + :raises: + :class:`TemplateSpecsErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.TemplateSpecsErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TemplateSpecPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/'} diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/version.py new file mode 100644 index 000000000000..affaef0c987e --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" +