diff --git a/sdk/resources/azure-mgmt-resource/_meta.json b/sdk/resources/azure-mgmt-resource/_meta.json index 185a22e3ae3d..ca9ff1be969a 100644 --- a/sdk/resources/azure-mgmt-resource/_meta.json +++ b/sdk/resources/azure-mgmt-resource/_meta.json @@ -4,8 +4,8 @@ "@autorest/python@5.13.0", "@autorest/modelerfour@4.19.3" ], - "commit": "7541a993a77afbb3ef49f9b0b93b537af093e8da", + "commit": "d96cc3b17a5c9867b072dc737bf0a388fc445d13", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/resources/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "autorest_command": "autorest specification/resources/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/resources/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_changes_client.py index 2bf61f24e139..6b96bcffc095 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_changes_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_changes_client.py @@ -96,29 +96,16 @@ def models(cls, api_version=DEFAULT_API_VERSION): raise ValueError("API version {} is not available".format(api_version)) @property - def change_resource(self): + def changes(self): """Instance depends on the API version: - * 2022-03-01-preview: :class:`ChangeResourceOperations` + * 2022-03-01-preview: :class:`ChangesOperations` """ - api_version = self._get_api_version('change_resource') + api_version = self._get_api_version('changes') if api_version == '2022-03-01-preview': - from .v2022_03_01_preview.operations import ChangeResourceOperations as OperationClass + from .v2022_03_01_preview.operations import ChangesOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'change_resource'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def change_resources(self): - """Instance depends on the API version: - - * 2022-03-01-preview: :class:`ChangeResourcesOperations` - """ - api_version = self._get_api_version('change_resources') - if api_version == '2022-03-01-preview': - from .v2022_03_01_preview.operations import ChangeResourcesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'change_resources'".format(api_version)) + raise ValueError("API version {} does not have operation group 'changes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) def close(self): diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/aio/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/aio/_changes_client.py index 366bb25c0831..94e2266fc6d3 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/aio/_changes_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/aio/_changes_client.py @@ -95,29 +95,16 @@ def models(cls, api_version=DEFAULT_API_VERSION): raise ValueError("API version {} is not available".format(api_version)) @property - def change_resource(self): + def changes(self): """Instance depends on the API version: - * 2022-03-01-preview: :class:`ChangeResourceOperations` + * 2022-03-01-preview: :class:`ChangesOperations` """ - api_version = self._get_api_version('change_resource') + api_version = self._get_api_version('changes') if api_version == '2022-03-01-preview': - from ..v2022_03_01_preview.aio.operations import ChangeResourceOperations as OperationClass + from ..v2022_03_01_preview.aio.operations import ChangesOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'change_resource'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def change_resources(self): - """Instance depends on the API version: - - * 2022-03-01-preview: :class:`ChangeResourcesOperations` - """ - api_version = self._get_api_version('change_resources') - if api_version == '2022-03-01-preview': - from ..v2022_03_01_preview.aio.operations import ChangeResourcesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'change_resources'".format(api_version)) + raise ValueError("API version {} does not have operation group 'changes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) async def close(self): diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_changes_client.py index 06927538d5bf..5c35785ad370 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_changes_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_changes_client.py @@ -16,7 +16,7 @@ from . import models from ._configuration import ChangesClientConfiguration -from .operations import ChangeResourceOperations, ChangeResourcesOperations +from .operations import ChangesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -25,12 +25,8 @@ class ChangesClient: """The Resource Changes Client. - :ivar change_resources: ChangeResourcesOperations operations - :vartype change_resources: - azure.mgmt.resource.changes.v2022_03_01_preview.operations.ChangeResourcesOperations - :ivar change_resource: ChangeResourceOperations operations - :vartype change_resource: - azure.mgmt.resource.changes.v2022_03_01_preview.operations.ChangeResourceOperations + :ivar changes: ChangesOperations operations + :vartype changes: azure.mgmt.resource.changes.v2022_03_01_preview.operations.ChangesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. @@ -57,8 +53,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.change_resources = ChangeResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.change_resource = ChangeResourceOperations(self._client, self._config, self._serialize, self._deserialize) + self.changes = ChangesOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_metadata.json b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_metadata.json index d954b0eb144a..4fb31652547b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_metadata.json +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_metadata.json @@ -97,7 +97,6 @@ "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { - "change_resources": "ChangeResourcesOperations", - "change_resource": "ChangeResourceOperations" + "changes": "ChangesOperations" } } \ No newline at end of file diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/_changes_client.py index 0e827bd44156..58389b7a2765 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/_changes_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/_changes_client.py @@ -16,7 +16,7 @@ from .. import models from ._configuration import ChangesClientConfiguration -from .operations import ChangeResourceOperations, ChangeResourcesOperations +from .operations import ChangesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -25,12 +25,9 @@ class ChangesClient: """The Resource Changes Client. - :ivar change_resources: ChangeResourcesOperations operations - :vartype change_resources: - azure.mgmt.resource.changes.v2022_03_01_preview.aio.operations.ChangeResourcesOperations - :ivar change_resource: ChangeResourceOperations operations - :vartype change_resource: - azure.mgmt.resource.changes.v2022_03_01_preview.aio.operations.ChangeResourceOperations + :ivar changes: ChangesOperations operations + :vartype changes: + azure.mgmt.resource.changes.v2022_03_01_preview.aio.operations.ChangesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. @@ -57,8 +54,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.change_resources = ChangeResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.change_resource = ChangeResourceOperations(self._client, self._config, self._serialize, self._deserialize) + self.changes = ChangesOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/operations/__init__.py index 0c5ec2d5dfee..f3c0a138bab4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/operations/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/operations/__init__.py @@ -6,10 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._operations import ChangeResourcesOperations -from ._operations import ChangeResourceOperations +from ._operations import ChangesOperations __all__ = [ - 'ChangeResourcesOperations', - 'ChangeResourceOperations', + 'ChangesOperations', ] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/operations/_operations.py index c96c52271422..aaee9af63735 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/aio/operations/_operations.py @@ -19,12 +19,12 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._operations import build_change_resource_get_request, build_change_resources_list_request +from ...operations._operations import build_changes_get_request, build_changes_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class ChangeResourcesOperations: - """ChangeResourcesOperations async operations. +class ChangesOperations: + """ChangesOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. @@ -87,7 +87,7 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_change_resources_list_request( + request = build_changes_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): else: - request = build_change_resources_list_request( + request = build_changes_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, @@ -145,27 +145,6 @@ async def get_next(next_link=None): get_next, extract_data ) list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes"} # type: ignore -class ChangeResourceOperations: - """ChangeResourceOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.resource.changes.v2022_03_01_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config @distributed_trace_async async def get( @@ -203,7 +182,7 @@ async def get( api_version = kwargs.pop('api_version', "2022-03-01-preview") # type: str - request = build_change_resource_get_request( + request = build_changes_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/operations/__init__.py index 0c5ec2d5dfee..f3c0a138bab4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/operations/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/operations/__init__.py @@ -6,10 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._operations import ChangeResourcesOperations -from ._operations import ChangeResourceOperations +from ._operations import ChangesOperations __all__ = [ - 'ChangeResourcesOperations', - 'ChangeResourceOperations', + 'ChangesOperations', ] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/operations/_operations.py index f8d50cc189ab..5288eda99f75 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_03_01_preview/operations/_operations.py @@ -26,7 +26,7 @@ _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_change_resources_list_request( +def build_changes_list_request( subscription_id: str, resource_group_name: str, resource_provider_namespace: str, @@ -73,7 +73,7 @@ def build_change_resources_list_request( ) -def build_change_resource_get_request( +def build_changes_get_request( subscription_id: str, resource_group_name: str, resource_provider_namespace: str, @@ -114,8 +114,8 @@ def build_change_resource_get_request( **kwargs ) -class ChangeResourcesOperations(object): - """ChangeResourcesOperations operations. +class ChangesOperations(object): + """ChangesOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. @@ -178,7 +178,7 @@ def list( def prepare_request(next_link=None): if not next_link: - request = build_change_resources_list_request( + request = build_changes_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, @@ -194,7 +194,7 @@ def prepare_request(next_link=None): else: - request = build_change_resources_list_request( + request = build_changes_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, @@ -236,27 +236,6 @@ def get_next(next_link=None): get_next, extract_data ) list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Resources/changes"} # type: ignore -class ChangeResourceOperations(object): - """ChangeResourceOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.resource.changes.v2022_03_01_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config @distributed_trace def get( @@ -294,7 +273,7 @@ def get( api_version = kwargs.pop('api_version', "2022-03-01-preview") # type: str - request = build_change_resource_get_request( + request = build_changes_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" 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 index 778a7edd6099..e5754a47ce68 100644 --- 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 @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" 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 index 778a7edd6099..e5754a47ce68 100644 --- 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 @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +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 0e33382564b5..ebf54ec2e381 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 @@ -55,7 +55,7 @@ class TemplateSpecsClient(MultiApiClientMixin, _SDKClient): :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2021-05-01' + DEFAULT_API_VERSION = '2022-02-01' _PROFILE_TAG = "azure.mgmt.resource.templatespecs.TemplateSpecsClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -91,6 +91,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-06-01-preview: :mod:`v2019_06_01_preview.models` * 2021-03-01-preview: :mod:`v2021_03_01_preview.models` * 2021-05-01: :mod:`v2021_05_01.models` + * 2022-02-01: :mod:`v2022_02_01.models` """ if api_version == '2019-06-01-preview': from .v2019_06_01_preview import models @@ -101,6 +102,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-05-01': from .v2021_05_01 import models return models + elif api_version == '2022-02-01': + from .v2022_02_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -110,6 +114,7 @@ def template_spec_versions(self): * 2019-06-01-preview: :class:`TemplateSpecVersionsOperations` * 2021-03-01-preview: :class:`TemplateSpecVersionsOperations` * 2021-05-01: :class:`TemplateSpecVersionsOperations` + * 2022-02-01: :class:`TemplateSpecVersionsOperations` """ api_version = self._get_api_version('template_spec_versions') if api_version == '2019-06-01-preview': @@ -118,6 +123,8 @@ def template_spec_versions(self): 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 + elif api_version == '2022-02-01': + from .v2022_02_01.operations import TemplateSpecVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'template_spec_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -129,6 +136,7 @@ def template_specs(self): * 2019-06-01-preview: :class:`TemplateSpecsOperations` * 2021-03-01-preview: :class:`TemplateSpecsOperations` * 2021-05-01: :class:`TemplateSpecsOperations` + * 2022-02-01: :class:`TemplateSpecsOperations` """ api_version = self._get_api_version('template_specs') if api_version == '2019-06-01-preview': @@ -137,6 +145,8 @@ def template_specs(self): 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 + elif api_version == '2022-02-01': + from .v2022_02_01.operations import TemplateSpecsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'template_specs'".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/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/aio/_template_specs_client.py index 025277567bf1..8fc59bf16817 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/aio/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/aio/_template_specs_client.py @@ -54,7 +54,7 @@ class TemplateSpecsClient(MultiApiClientMixin, _SDKClient): :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2021-05-01' + DEFAULT_API_VERSION = '2022-02-01' _PROFILE_TAG = "azure.mgmt.resource.templatespecs.TemplateSpecsClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -90,6 +90,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-06-01-preview: :mod:`v2019_06_01_preview.models` * 2021-03-01-preview: :mod:`v2021_03_01_preview.models` * 2021-05-01: :mod:`v2021_05_01.models` + * 2022-02-01: :mod:`v2022_02_01.models` """ if api_version == '2019-06-01-preview': from ..v2019_06_01_preview import models @@ -100,6 +101,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-05-01': from ..v2021_05_01 import models return models + elif api_version == '2022-02-01': + from ..v2022_02_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -109,6 +113,7 @@ def template_spec_versions(self): * 2019-06-01-preview: :class:`TemplateSpecVersionsOperations` * 2021-03-01-preview: :class:`TemplateSpecVersionsOperations` * 2021-05-01: :class:`TemplateSpecVersionsOperations` + * 2022-02-01: :class:`TemplateSpecVersionsOperations` """ api_version = self._get_api_version('template_spec_versions') if api_version == '2019-06-01-preview': @@ -117,6 +122,8 @@ def template_spec_versions(self): from ..v2021_03_01_preview.aio.operations import TemplateSpecVersionsOperations as OperationClass elif api_version == '2021-05-01': from ..v2021_05_01.aio.operations import TemplateSpecVersionsOperations as OperationClass + elif api_version == '2022-02-01': + from ..v2022_02_01.aio.operations import TemplateSpecVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'template_spec_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -128,6 +135,7 @@ def template_specs(self): * 2019-06-01-preview: :class:`TemplateSpecsOperations` * 2021-03-01-preview: :class:`TemplateSpecsOperations` * 2021-05-01: :class:`TemplateSpecsOperations` + * 2022-02-01: :class:`TemplateSpecsOperations` """ api_version = self._get_api_version('template_specs') if api_version == '2019-06-01-preview': @@ -136,6 +144,8 @@ def template_specs(self): from ..v2021_03_01_preview.aio.operations import TemplateSpecsOperations as OperationClass elif api_version == '2021-05-01': from ..v2021_05_01.aio.operations import TemplateSpecsOperations as OperationClass + elif api_version == '2022-02-01': + from ..v2022_02_01.aio.operations import TemplateSpecsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'template_specs'".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 ce393b27bae3..0b7b50d44ade 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 .v2021_05_01.models import * +from .v2022_02_01.models import * diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py index 778a7edd6099..e5754a47ce68 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" 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 index 778a7edd6099..e5754a47ce68 100644 --- 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 @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" 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 index 778a7edd6099..e5754a47ce68 100644 --- 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 @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "21.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/__init__.py new file mode 100644 index 000000000000..4005d4a7201e --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/__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_client import TemplateSpecsClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['TemplateSpecsClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_configuration.py new file mode 100644 index 000000000000..1aaff68b1960 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_configuration.py @@ -0,0 +1,73 @@ +# 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 typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class TemplateSpecsClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for TemplateSpecsClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription Id which forms part of the URI for every service call. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(TemplateSpecsClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-resource/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_metadata.json b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_metadata.json new file mode 100644 index 000000000000..268c0c939f4b --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_metadata.json @@ -0,0 +1,103 @@ +{ + "chosen_version": "2022-02-01", + "total_api_version_list": ["2022-02-01"], + "client": { + "name": "TemplateSpecsClient", + "filename": "_template_specs_client", + "description": "The APIs listed in this specification can be used to manage Template Spec resources through the Azure Resource Manager.", + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"TemplateSpecsClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"TemplateSpecsClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription Id which forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "Subscription Id which forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "template_specs": "TemplateSpecsOperations", + "template_spec_versions": "TemplateSpecVersionsOperations" + } +} \ No newline at end of file diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_patch.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py new file mode 100644 index 000000000000..a8ad7f1016f1 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py @@ -0,0 +1,101 @@ +# 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 copy import deepcopy +from typing import Any, TYPE_CHECKING + +from msrest import Deserializer, Serializer + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient + +from . import models +from ._configuration import TemplateSpecsClientConfiguration +from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +class TemplateSpecsClient: + """The APIs listed in this specification can be used to manage Template Spec resources through the + Azure Resource Manager. + + :ivar template_specs: TemplateSpecsOperations operations + :vartype template_specs: + azure.mgmt.resource.templatespecs.v2022_02_01.operations.TemplateSpecsOperations + :ivar template_spec_versions: TemplateSpecVersionsOperations operations + :vartype template_spec_versions: + azure.mgmt.resource.templatespecs.v2022_02_01.operations.TemplateSpecVersionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription Id which forms part of the URI for every service call. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = TemplateSpecsClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + 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) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> TemplateSpecsClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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 azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py @@ -0,0 +1,9 @@ +# 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/v2022_02_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/__init__.py new file mode 100644 index 000000000000..9c8e93c3f82a --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/__init__.py @@ -0,0 +1,15 @@ +# 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_client import TemplateSpecsClient +__all__ = ['TemplateSpecsClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_configuration.py new file mode 100644 index 000000000000..9b8aa0ac5db8 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_configuration.py @@ -0,0 +1,72 @@ +# 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 typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class TemplateSpecsClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for TemplateSpecsClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription Id which forms part of the URI for every service call. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(TemplateSpecsClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-resource/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_patch.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py new file mode 100644 index 000000000000..7880cce4c3aa --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py @@ -0,0 +1,98 @@ +# 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 copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from msrest import Deserializer, Serializer + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient + +from .. import models +from ._configuration import TemplateSpecsClientConfiguration +from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class TemplateSpecsClient: + """The APIs listed in this specification can be used to manage Template Spec resources through the + Azure Resource Manager. + + :ivar template_specs: TemplateSpecsOperations operations + :vartype template_specs: + azure.mgmt.resource.templatespecs.v2022_02_01.aio.operations.TemplateSpecsOperations + :ivar template_spec_versions: TemplateSpecVersionsOperations operations + :vartype template_spec_versions: + azure.mgmt.resource.templatespecs.v2022_02_01.aio.operations.TemplateSpecVersionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription Id which forms part of the URI for every service call. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = TemplateSpecsClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + 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) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "TemplateSpecsClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/__init__.py new file mode 100644 index 000000000000..cb4936f69ad5 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/__init__.py @@ -0,0 +1,15 @@ +# 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 TemplateSpecsOperations +from ._operations import TemplateSpecVersionsOperations + +__all__ = [ + 'TemplateSpecsOperations', + 'TemplateSpecVersionsOperations', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py new file mode 100644 index 000000000000..d792778e33ae --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py @@ -0,0 +1,1119 @@ +# pylint: disable=too-many-lines +# 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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_template_spec_versions_create_or_update_request, build_template_spec_versions_delete_request, build_template_spec_versions_get_built_in_request, build_template_spec_versions_get_request, build_template_spec_versions_list_built_ins_request, build_template_spec_versions_list_request, build_template_spec_versions_update_request, build_template_specs_create_or_update_request, build_template_specs_delete_request, build_template_specs_get_built_in_request, build_template_specs_get_request, build_template_specs_list_built_ins_request, build_template_specs_list_by_resource_group_request, build_template_specs_list_by_subscription_request, build_template_specs_update_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TemplateSpecsOperations: + """TemplateSpecsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.resource.templatespecs.v2022_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + template_spec_name: str, + template_spec: "_models.TemplateSpec", + **kwargs: Any + ) -> "_models.TemplateSpec": + """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.v2022_02_01.models.TemplateSpec + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpec, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpec"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(template_spec, 'TemplateSpec') + + request = build_template_specs_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + template_spec_name: str, + template_spec: Optional["_models.TemplateSpecUpdateModel"] = None, + **kwargs: Any + ) -> "_models.TemplateSpec": + """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 template_spec: Template Spec resource with the tags to be updated. Default value is + None. + :type template_spec: + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecUpdateModel + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpec, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpec"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + if template_spec is not None: + _json = self._serialize.body(template_spec, 'TemplateSpecUpdateModel') + else: + _json = None + + request = build_template_specs_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + template_spec_name: str, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> "_models.TemplateSpec": + """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. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpec, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpec"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_specs_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + template_spec_name: str, + **kwargs: Any + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_specs_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.TemplateSpecsListResult"]: + """Lists all the Template Specs within the specified subscriptions. + + :param expand: Allows for expansion of additional Template Spec details in the response. + Optional. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecsListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_specs_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + expand=expand, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_specs_list_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.TemplateSpecsListResult"]: + """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. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecsListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_specs_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + expand=expand, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_specs_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/"} # type: ignore + + @distributed_trace_async + async def get_built_in( + self, + template_spec_name: str, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> "_models.TemplateSpec": + """Gets a built-in Template Spec with a given name. + + :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. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpec, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpec"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_specs_get_built_in_request( + template_spec_name=template_spec_name, + api_version=api_version, + expand=expand, + template_url=self.get_built_in.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_built_in.metadata = {'url': "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace + def list_built_ins( + self, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.TemplateSpecsListResult"]: + """Lists built-in Template Specs. + + :param expand: Allows for expansion of additional Template Spec details in the response. + Optional. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecsListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_specs_list_built_ins_request( + api_version=api_version, + expand=expand, + template_url=self.list_built_ins.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_specs_list_built_ins_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_built_ins.metadata = {'url': "/providers/Microsoft.Resources/builtInTemplateSpecs/"} # type: ignore +class TemplateSpecVersionsOperations: + """TemplateSpecVersionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.resource.templatespecs.v2022_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + template_spec_version_model: "_models.TemplateSpecVersion", + **kwargs: Any + ) -> "_models.TemplateSpecVersion": + """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.v2022_02_01.models.TemplateSpecVersion + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpecVersion, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(template_spec_version_model, 'TemplateSpecVersion') + + request = build_template_spec_versions_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + template_spec_version_update_model: Optional["_models.TemplateSpecVersionUpdateModel"] = None, + **kwargs: Any + ) -> "_models.TemplateSpecVersion": + """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 template_spec_version_update_model: Template Spec Version resource with the tags to be + updated. Default value is None. + :type template_spec_version_update_model: + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersionUpdateModel + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpecVersion, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + if template_spec_version_update_model is not None: + _json = self._serialize.body(template_spec_version_update_model, 'TemplateSpecVersionUpdateModel') + else: + _json = None + + request = build_template_spec_versions_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + **kwargs: Any + ) -> "_models.TemplateSpecVersion": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpecVersion, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_spec_versions_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + **kwargs: Any + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_spec_versions_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + template_spec_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.TemplateSpecVersionsListResult"]: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecVersionsListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_spec_versions_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_spec_versions_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecVersionsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions"} # type: ignore + + @distributed_trace + def list_built_ins( + self, + template_spec_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.TemplateSpecVersionsListResult"]: + """Lists all the Template Spec versions in the specified built-in Template Spec. + + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecVersionsListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_spec_versions_list_built_ins_request( + template_spec_name=template_spec_name, + api_version=api_version, + template_url=self.list_built_ins.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_spec_versions_list_built_ins_request( + template_spec_name=template_spec_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecVersionsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_built_ins.metadata = {'url': "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions"} # type: ignore + + @distributed_trace_async + async def get_built_in( + self, + template_spec_name: str, + template_spec_version: str, + **kwargs: Any + ) -> "_models.TemplateSpecVersion": + """Gets a Template Spec version from a specific built-in Template Spec. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpecVersion, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_spec_versions_get_built_in_request( + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + template_url=self.get_built_in.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_built_in.metadata = {'url': "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/__init__.py new file mode 100644 index 000000000000..2b966fa1d8bb --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/__init__.py @@ -0,0 +1,45 @@ +# 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 ._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 TemplateSpecUpdateModel +from ._models_py3 import TemplateSpecVersion +from ._models_py3 import TemplateSpecVersionInfo +from ._models_py3 import TemplateSpecVersionUpdateModel +from ._models_py3 import TemplateSpecVersionsListResult +from ._models_py3 import TemplateSpecsError +from ._models_py3 import TemplateSpecsListResult + + +from ._template_specs_client_enums import ( + CreatedByType, + TemplateSpecExpandKind, +) + +__all__ = [ + 'AzureResourceBase', + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'LinkedTemplateArtifact', + 'SystemData', + 'TemplateSpec', + 'TemplateSpecUpdateModel', + 'TemplateSpecVersion', + 'TemplateSpecVersionInfo', + 'TemplateSpecVersionUpdateModel', + 'TemplateSpecVersionsListResult', + 'TemplateSpecsError', + 'TemplateSpecsListResult', + 'CreatedByType', + 'TemplateSpecExpandKind', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_models_py3.py new file mode 100644 index 000000000000..746f7c48990e --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_models_py3.py @@ -0,0 +1,664 @@ +# 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 datetime +from typing import Any, Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._template_specs_client_enums import * + + +class AzureResourceBase(msrest.serialization.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.v2022_02_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 ErrorAdditionalInfo(msrest.serialization.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: any + """ + + _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(msrest.serialization.Model): + """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.v2022_02_01.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.resource.templatespecs.v2022_02_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(msrest.serialization.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. + + :ivar path: Required. A filesystem safe relative path of the artifact. + :vartype path: str + :ivar template: Required. The Azure Resource Manager template. + :vartype template: any + """ + + _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: Any, + **kwargs + ): + """ + :keyword path: Required. A filesystem safe relative path of the artifact. + :paramtype path: str + :keyword template: Required. The Azure Resource Manager template. + :paramtype template: any + """ + super(LinkedTemplateArtifact, self).__init__(**kwargs) + self.path = path + self.template = template + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.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: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + 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.v2022_02_01.models.SystemData + :ivar 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. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar description: Template Spec description. + :vartype description: str + :ivar display_name: Template Spec display name. + :vartype display_name: str + :ivar metadata: The Template Spec metadata. Metadata is an open-ended object and is typically a + collection of key-value pairs. + :vartype metadata: any + :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.v2022_02_01.models.TemplateSpecVersionInfo] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096, 'min_length': 0}, + 'display_name': {'max_length': 64, 'min_length': 0}, + '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'}, + 'tags': {'key': 'tags', '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}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + display_name: Optional[str] = None, + metadata: Optional[Any] = None, + **kwargs + ): + """ + :keyword 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. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword description: Template Spec description. + :paramtype description: str + :keyword display_name: Template Spec display name. + :paramtype display_name: str + :keyword metadata: The Template Spec metadata. Metadata is an open-ended object and is + typically a collection of key-value pairs. + :paramtype metadata: any + """ + super(TemplateSpec, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.description = description + self.display_name = display_name + self.metadata = metadata + self.versions = None + + +class TemplateSpecsError(msrest.serialization.Model): + """Template Specs error response. + + :ivar error: Common error response for all Azure Resource Manager APIs to return error details + for failed operations. (This also follows the OData error response format.). + :vartype error: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponse"] = None, + **kwargs + ): + """ + :keyword error: Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response format.). + :paramtype error: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.ErrorResponse + """ + super(TemplateSpecsError, self).__init__(**kwargs) + self.error = error + + +class TemplateSpecsListResult(msrest.serialization.Model): + """List of Template Specs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of Template Specs. + :vartype value: list[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec] + :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': '[TemplateSpec]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["TemplateSpec"]] = None, + **kwargs + ): + """ + :keyword value: An array of Template Specs. + :paramtype value: list[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec] + """ + super(TemplateSpecsListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +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.v2022_02_01.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype 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: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ + 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.v2022_02_01.models.SystemData + :ivar location: Required. The location of the Template Spec Version. It must match the location + of the parent Template Spec. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar description: Template Spec version description. + :vartype description: str + :ivar linked_templates: An array of linked template artifacts. + :vartype linked_templates: + list[~azure.mgmt.resource.templatespecs.v2022_02_01.models.LinkedTemplateArtifact] + :ivar metadata: The version metadata. Metadata is an open-ended object and is typically a + collection of key-value pairs. + :vartype metadata: any + :ivar main_template: The main Azure Resource Manager template content. + :vartype main_template: any + :ivar ui_form_definition: The Azure Resource Manager template UI definition content. + :vartype ui_form_definition: any + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'description': {'max_length': 4096, 'min_length': 0}, + } + + _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'}, + 'tags': {'key': 'tags', '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'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + linked_templates: Optional[List["LinkedTemplateArtifact"]] = None, + metadata: Optional[Any] = None, + main_template: Optional[Any] = None, + ui_form_definition: Optional[Any] = None, + **kwargs + ): + """ + :keyword location: Required. The location of the Template Spec Version. It must match the + location of the parent Template Spec. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword description: Template Spec version description. + :paramtype description: str + :keyword linked_templates: An array of linked template artifacts. + :paramtype linked_templates: + list[~azure.mgmt.resource.templatespecs.v2022_02_01.models.LinkedTemplateArtifact] + :keyword metadata: The version metadata. Metadata is an open-ended object and is typically a + collection of key-value pairs. + :paramtype metadata: any + :keyword main_template: The main Azure Resource Manager template content. + :paramtype main_template: any + :keyword ui_form_definition: The Azure Resource Manager template UI definition content. + :paramtype ui_form_definition: any + """ + super(TemplateSpecVersion, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.description = description + self.linked_templates = linked_templates + self.metadata = metadata + self.main_template = main_template + self.ui_form_definition = ui_form_definition + + +class TemplateSpecVersionInfo(msrest.serialization.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.datetime + :ivar time_modified: The timestamp of when the version was last modified. + :vartype time_modified: ~datetime.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 TemplateSpecVersionsListResult(msrest.serialization.Model): + """List of Template Specs versions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of Template Spec versions. + :vartype value: list[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion] + :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': '[TemplateSpecVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["TemplateSpecVersion"]] = None, + **kwargs + ): + """ + :keyword value: An array of Template Spec versions. + :paramtype value: + list[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion] + """ + super(TemplateSpecVersionsListResult, self).__init__(**kwargs) + self.value = value + self.next_link = 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.v2022_02_01.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype 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: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ + super(TemplateSpecVersionUpdateModel, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_template_specs_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_template_specs_client_enums.py new file mode 100644 index 000000000000..ef8823668c7e --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_template_specs_client_enums.py @@ -0,0 +1,26 @@ +# 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 +from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class TemplateSpecExpandKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Includes version information with the Template Spec. + VERSIONS = "versions" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/__init__.py new file mode 100644 index 000000000000..cb4936f69ad5 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/__init__.py @@ -0,0 +1,15 @@ +# 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 TemplateSpecsOperations +from ._operations import TemplateSpecVersionsOperations + +__all__ = [ + 'TemplateSpecsOperations', + 'TemplateSpecVersionsOperations', +] diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py new file mode 100644 index 000000000000..c7d3112be123 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py @@ -0,0 +1,1696 @@ +# pylint: disable=too-many-lines +# 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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_template_specs_create_or_update_request( + subscription_id: str, + resource_group_name: str, + template_spec_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_template_specs_update_request( + subscription_id: str, + resource_group_name: str, + template_spec_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_template_specs_get_request( + subscription_id: str, + resource_group_name: str, + template_spec_name: str, + *, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_specs_delete_request( + subscription_id: str, + resource_group_name: str, + template_spec_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_specs_list_by_subscription_request( + subscription_id: str, + *, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_specs_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + *, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_specs_get_built_in_request( + template_spec_name: str, + *, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}") + path_format_arguments = { + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_specs_list_built_ins_request( + *, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/builtInTemplateSpecs/") + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_spec_versions_create_or_update_request( + subscription_id: str, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecVersion": _SERIALIZER.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_template_spec_versions_update_request( + subscription_id: str, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecVersion": _SERIALIZER.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_template_spec_versions_get_request( + subscription_id: str, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecVersion": _SERIALIZER.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_spec_versions_delete_request( + subscription_id: str, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecVersion": _SERIALIZER.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_spec_versions_list_request( + subscription_id: str, + resource_group_name: str, + template_spec_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_spec_versions_list_built_ins_request( + template_spec_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions") + path_format_arguments = { + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_template_spec_versions_get_built_in_request( + template_spec_name: str, + template_spec_version: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions/{templateSpecVersion}") # pylint: disable=line-too-long + path_format_arguments = { + "templateSpecName": _SERIALIZER.url("template_spec_name", template_spec_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + "templateSpecVersion": _SERIALIZER.url("template_spec_version", template_spec_version, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +class TemplateSpecsOperations(object): + """TemplateSpecsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.resource.templatespecs.v2022_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + template_spec_name: str, + template_spec: "_models.TemplateSpec", + **kwargs: Any + ) -> "_models.TemplateSpec": + """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.v2022_02_01.models.TemplateSpec + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpec, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpec"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(template_spec, 'TemplateSpec') + + request = build_template_specs_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name: str, + template_spec_name: str, + template_spec: Optional["_models.TemplateSpecUpdateModel"] = None, + **kwargs: Any + ) -> "_models.TemplateSpec": + """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 template_spec: Template Spec resource with the tags to be updated. Default value is + None. + :type template_spec: + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecUpdateModel + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpec, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpec"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + if template_spec is not None: + _json = self._serialize.body(template_spec, 'TemplateSpecUpdateModel') + else: + _json = None + + request = build_template_specs_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace + def get( + self, + resource_group_name: str, + template_spec_name: str, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> "_models.TemplateSpec": + """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. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpec, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpec"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_specs_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + template_spec_name: str, + **kwargs: Any + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_specs_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> Iterable["_models.TemplateSpecsListResult"]: + """Lists all the Template Specs within the specified subscriptions. + + :param expand: Allows for expansion of additional Template Spec details in the response. + Optional. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecsListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_specs_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + expand=expand, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_specs_list_by_subscription_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> Iterable["_models.TemplateSpecsListResult"]: + """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. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecsListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_specs_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + expand=expand, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_specs_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/"} # type: ignore + + @distributed_trace + def get_built_in( + self, + template_spec_name: str, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> "_models.TemplateSpec": + """Gets a built-in Template Spec with a given name. + + :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. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpec, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpec"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_specs_get_built_in_request( + template_spec_name=template_spec_name, + api_version=api_version, + expand=expand, + template_url=self.get_built_in.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpec', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_built_in.metadata = {'url': "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}"} # type: ignore + + + @distributed_trace + def list_built_ins( + self, + expand: Optional[Union[str, "_models.TemplateSpecExpandKind"]] = None, + **kwargs: Any + ) -> Iterable["_models.TemplateSpecsListResult"]: + """Lists built-in Template Specs. + + :param expand: Allows for expansion of additional Template Spec details in the response. + Optional. Default value is None. + :type expand: str or + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecExpandKind + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecsListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_specs_list_built_ins_request( + api_version=api_version, + expand=expand, + template_url=self.list_built_ins.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_specs_list_built_ins_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_built_ins.metadata = {'url': "/providers/Microsoft.Resources/builtInTemplateSpecs/"} # type: ignore +class TemplateSpecVersionsOperations(object): + """TemplateSpecVersionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.resource.templatespecs.v2022_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + template_spec_version_model: "_models.TemplateSpecVersion", + **kwargs: Any + ) -> "_models.TemplateSpecVersion": + """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.v2022_02_01.models.TemplateSpecVersion + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpecVersion, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(template_spec_version_model, 'TemplateSpecVersion') + + request = build_template_spec_versions_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + template_spec_version_update_model: Optional["_models.TemplateSpecVersionUpdateModel"] = None, + **kwargs: Any + ) -> "_models.TemplateSpecVersion": + """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 template_spec_version_update_model: Template Spec Version resource with the tags to be + updated. Default value is None. + :type template_spec_version_update_model: + ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersionUpdateModel + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpecVersion, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + if template_spec_version_update_model is not None: + _json = self._serialize.body(template_spec_version_update_model, 'TemplateSpecVersionUpdateModel') + else: + _json = None + + request = build_template_spec_versions_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + + + @distributed_trace + def get( + self, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + **kwargs: Any + ) -> "_models.TemplateSpecVersion": + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpecVersion, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_spec_versions_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + template_spec_name: str, + template_spec_version: str, + **kwargs: Any + ) -> None: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_spec_versions_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + template_spec_name: str, + **kwargs: Any + ) -> Iterable["_models.TemplateSpecVersionsListResult"]: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecVersionsListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_spec_versions_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_spec_versions_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_spec_name=template_spec_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecVersionsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions"} # type: ignore + + @distributed_trace + def list_built_ins( + self, + template_spec_name: str, + **kwargs: Any + ) -> Iterable["_models.TemplateSpecVersionsListResult"]: + """Lists all the Template Spec versions in the specified built-in Template Spec. + + :param template_spec_name: Name of the Template Spec. + :type template_spec_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TemplateSpecVersionsListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_template_spec_versions_list_built_ins_request( + template_spec_name=template_spec_name, + api_version=api_version, + template_url=self.list_built_ins.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_template_spec_versions_list_built_ins_request( + template_spec_name=template_spec_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TemplateSpecVersionsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_built_ins.metadata = {'url': "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions"} # type: ignore + + @distributed_trace + def get_built_in( + self, + template_spec_name: str, + template_spec_version: str, + **kwargs: Any + ) -> "_models.TemplateSpecVersion": + """Gets a Template Spec version from a specific built-in Template Spec. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TemplateSpecVersion, or the result of cls(response) + :rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TemplateSpecVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + + + request = build_template_spec_versions_get_built_in_request( + template_spec_name=template_spec_name, + template_spec_version=template_spec_version, + api_version=api_version, + template_url=self.get_built_in.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.TemplateSpecsError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TemplateSpecVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_built_in.metadata = {'url': "/providers/Microsoft.Resources/builtInTemplateSpecs/{templateSpecName}/versions/{templateSpecVersion}"} # type: ignore + diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/py.typed b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file