From 0af8deab3958acfae24cae2e24060b576c71b076 Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Wed, 8 Jun 2022 13:38:49 +0800 Subject: [PATCH] [AutoRelease] t2-appconfiguration-2022-06-02-69007(Do not merge) (#24673) * code and test * Update CHANGELOG.md Co-authored-by: PythonSdkPipelines Co-authored-by: Jiefeng Chen <51037443+BigCat20196@users.noreply.github.com> --- .../azure-mgmt-appconfiguration/CHANGELOG.md | 13 + .../azure-mgmt-appconfiguration/MANIFEST.in | 1 + .../azure-mgmt-appconfiguration/_meta.json | 6 +- .../_app_configuration_management_client.py | 22 +- .../mgmt/appconfiguration/_configuration.py | 9 +- .../mgmt/appconfiguration/_metadata.json | 8 +- .../azure/mgmt/appconfiguration/_version.py | 2 +- .../_app_configuration_management_client.py | 20 +- .../appconfiguration/aio/_configuration.py | 9 +- .../_configuration_stores_operations.py | 205 +++++--- .../aio/operations/_key_values_operations.py | 76 ++- .../aio/operations/_operations.py | 51 +- ...private_endpoint_connections_operations.py | 81 +++- .../_private_link_resources_operations.py | 34 +- .../appconfiguration/models/_models_py3.py | 163 +++---- .../_configuration_stores_operations.py | 451 +++++++++++------- .../operations/_key_values_operations.py | 167 ++++--- .../operations/_operations.py | 119 +++-- ...private_endpoint_connections_operations.py | 169 ++++--- .../_private_link_resources_operations.py | 79 +-- .../azure-mgmt-appconfiguration/setup.py | 4 + shared_requirements.txt | 1 + 22 files changed, 1035 insertions(+), 655 deletions(-) diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-mgmt-appconfiguration/CHANGELOG.md index 69b6e6a0be7e..d798f3a4137a 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/CHANGELOG.md @@ -1,5 +1,18 @@ # Release History +## 2.1.0 (2022-06-08) + +**Features** + + - Added operation ConfigurationStoresOperations.begin_purge_deleted + - Added operation ConfigurationStoresOperations.get_deleted + - Added operation ConfigurationStoresOperations.list_deleted + - Added operation Operations.regional_check_name_availability + - Model ConfigurationStore has a new parameter create_mode + - Model ConfigurationStore has a new parameter enable_purge_protection + - Model ConfigurationStore has a new parameter soft_delete_retention_in_days + - Model ConfigurationStoreUpdateParameters has a new parameter enable_purge_protection + ## 2.1.0b2 (2022-02-28) **Features** diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/MANIFEST.in b/sdk/appconfiguration/azure-mgmt-appconfiguration/MANIFEST.in index 2c31e8da0cb1..535eedfd4734 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/MANIFEST.in +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/MANIFEST.in @@ -4,3 +4,4 @@ include *.md include azure/__init__.py include azure/mgmt/__init__.py include LICENSE +include azure/mgmt/appconfiguration/py.typed diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/_meta.json b/sdk/appconfiguration/azure-mgmt-appconfiguration/_meta.json index 09253db58359..36bf117192dd 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/_meta.json +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/_meta.json @@ -1,11 +1,11 @@ { "autorest": "3.7.2", "use": [ - "@autorest/python@5.12.0", + "@autorest/python@5.13.0", "@autorest/modelerfour@4.19.3" ], - "commit": "4d25a2a8e6b2f954079c91a0c3ec0d7f905220e3", + "commit": "08894fa8d66cb44dc62a73f7a09530f905985fa3", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/appconfiguration/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "autorest_command": "autorest specification/appconfiguration/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", "readme": "specification/appconfiguration/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py index 39ddce92e045..f7cd3720bfb3 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py @@ -7,11 +7,12 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Optional, TYPE_CHECKING +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 msrest import Deserializer, Serializer from . import models from ._configuration import AppConfigurationManagementClientConfiguration @@ -26,23 +27,26 @@ class AppConfigurationManagementClient: :ivar configuration_stores: ConfigurationStoresOperations operations :vartype configuration_stores: - app_configuration_management_client.operations.ConfigurationStoresOperations + azure.mgmt.appconfiguration.operations.ConfigurationStoresOperations :ivar operations: Operations operations - :vartype operations: app_configuration_management_client.operations.Operations + :vartype operations: azure.mgmt.appconfiguration.operations.Operations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: - app_configuration_management_client.operations.PrivateEndpointConnectionsOperations + azure.mgmt.appconfiguration.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: - app_configuration_management_client.operations.PrivateLinkResourcesOperations + azure.mgmt.appconfiguration.operations.PrivateLinkResourcesOperations :ivar key_values: KeyValuesOperations operations - :vartype key_values: app_configuration_management_client.operations.KeyValuesOperations + :vartype key_values: azure.mgmt.appconfiguration.operations.KeyValuesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Microsoft Azure subscription ID. :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. + :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-05-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -70,7 +74,7 @@ def __init__( def _send_request( self, - request, # type: HttpRequest + request: HttpRequest, **kwargs: Any ) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_configuration.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_configuration.py index 266edba530f2..a475fa81de9d 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_configuration.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_configuration.py @@ -19,7 +19,7 @@ from azure.core.credentials import TokenCredential -class AppConfigurationManagementClientConfiguration(Configuration): +class AppConfigurationManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for AppConfigurationManagementClient. Note that all parameters used to create this instance are saved as instance @@ -29,6 +29,9 @@ class AppConfigurationManagementClientConfiguration(Configuration): :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Microsoft Azure subscription ID. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -38,6 +41,8 @@ def __init__( **kwargs: Any ) -> None: super(AppConfigurationManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -45,7 +50,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-10-01-preview" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-appconfiguration/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_metadata.json b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_metadata.json index 9c6473d91d01..36ff413f4f84 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_metadata.json +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2021-10-01-preview", - "total_api_version_list": ["2021-10-01-preview"], + "chosen_version": "2022-05-01", + "total_api_version_list": ["2022-05-01"], "client": { "name": "AppConfigurationManagementClient", "filename": "_app_configuration_management_client", @@ -10,8 +10,8 @@ "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppConfigurationManagementClientConfiguration\"]}}, \"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\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppConfigurationManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppConfigurationManagementClientConfiguration\"]}, \"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\": [\"AppConfigurationManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_version.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_version.py index b2fff948b5bb..83f24ab50946 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_version.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.1.0b2" +VERSION = "2.1.0" diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/_app_configuration_management_client.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/_app_configuration_management_client.py index fb989ec4964e..bb2242b62130 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/_app_configuration_management_client.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/_app_configuration_management_client.py @@ -7,11 +7,12 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, Optional, TYPE_CHECKING +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 msrest import Deserializer, Serializer from .. import models from ._configuration import AppConfigurationManagementClientConfiguration @@ -26,23 +27,26 @@ class AppConfigurationManagementClient: :ivar configuration_stores: ConfigurationStoresOperations operations :vartype configuration_stores: - app_configuration_management_client.aio.operations.ConfigurationStoresOperations + azure.mgmt.appconfiguration.aio.operations.ConfigurationStoresOperations :ivar operations: Operations operations - :vartype operations: app_configuration_management_client.aio.operations.Operations + :vartype operations: azure.mgmt.appconfiguration.aio.operations.Operations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: - app_configuration_management_client.aio.operations.PrivateEndpointConnectionsOperations + azure.mgmt.appconfiguration.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: - app_configuration_management_client.aio.operations.PrivateLinkResourcesOperations + azure.mgmt.appconfiguration.aio.operations.PrivateLinkResourcesOperations :ivar key_values: KeyValuesOperations operations - :vartype key_values: app_configuration_management_client.aio.operations.KeyValuesOperations + :vartype key_values: azure.mgmt.appconfiguration.aio.operations.KeyValuesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Microsoft Azure subscription ID. :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. + :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-05-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/_configuration.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/_configuration.py index 61edf219e7ae..b9958e5baf01 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/_configuration.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/_configuration.py @@ -19,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AppConfigurationManagementClientConfiguration(Configuration): +class AppConfigurationManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for AppConfigurationManagementClient. Note that all parameters used to create this instance are saved as instance @@ -29,6 +29,9 @@ class AppConfigurationManagementClientConfiguration(Configuration): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Microsoft Azure subscription ID. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -38,6 +41,8 @@ def __init__( **kwargs: Any ) -> None: super(AppConfigurationManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -45,7 +50,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-10-01-preview" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-appconfiguration/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_configuration_stores_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_configuration_stores_operations.py index 26995031beb7..304bd45273fd 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_configuration_stores_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_configuration_stores_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +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 @@ -33,7 +32,7 @@ class ConfigurationStoresOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,15 +58,17 @@ def list( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationStoreListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~app_configuration_management_client.models.ConfigurationStoreListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appconfiguration.models.ConfigurationStoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStoreListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -78,6 +79,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, skip_token=skip_token, template_url=self.list.metadata['url'], ) @@ -88,6 +90,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -106,7 +109,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -120,7 +127,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores"} # type: ignore @distributed_trace def list_by_resource_group( @@ -137,15 +144,17 @@ def list_by_resource_group( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationStoreListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~app_configuration_management_client.models.ConfigurationStoreListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appconfiguration.models.ConfigurationStoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStoreListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -157,6 +166,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, + api_version=api_version, skip_token=skip_token, template_url=self.list_by_resource_group.metadata['url'], ) @@ -168,6 +178,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -186,7 +197,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -200,7 +215,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores"} # type: ignore @distributed_trace_async async def get( @@ -218,7 +233,7 @@ async def get( :type config_store_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationStore, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.ConfigurationStore + :rtype: ~azure.mgmt.appconfiguration.models.ConfigurationStore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStore"] @@ -227,17 +242,24 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + 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(request, stream=False, **kwargs) + 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]: @@ -252,7 +274,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore async def _create_initial( @@ -268,6 +290,7 @@ async def _create_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(config_store_creation_parameters, 'ConfigurationStore') @@ -276,6 +299,7 @@ async def _create_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_initial.metadata['url'], @@ -283,7 +307,11 @@ async def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -301,7 +329,7 @@ async def _create_initial( return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore @distributed_trace_async @@ -320,8 +348,7 @@ async def begin_create( :param config_store_name: The name of the configuration store. :type config_store_name: str :param config_store_creation_parameters: The parameters for creating a configuration store. - :type config_store_creation_parameters: - ~app_configuration_management_client.models.ConfigurationStore + :type config_store_creation_parameters: ~azure.mgmt.appconfiguration.models.ConfigurationStore :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -333,11 +360,12 @@ async def begin_create( :return: An instance of AsyncLROPoller that returns either ConfigurationStore or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~app_configuration_management_client.models.ConfigurationStore] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appconfiguration.models.ConfigurationStore] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStore"] lro_delay = kwargs.pop( 'polling_interval', @@ -349,6 +377,7 @@ async def begin_create( resource_group_name=resource_group_name, config_store_name=config_store_name, config_store_creation_parameters=config_store_creation_parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -373,12 +402,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -390,17 +418,24 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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, 202, 204]: @@ -410,11 +445,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -439,7 +474,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -450,6 +486,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -470,10 +507,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore async def _update_initial( self, @@ -488,6 +524,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(config_store_update_parameters, 'ConfigurationStoreUpdateParameters') @@ -496,6 +533,7 @@ async def _update_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -503,7 +541,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -521,7 +563,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore @distributed_trace_async @@ -541,7 +583,7 @@ async def begin_update( :type config_store_name: str :param config_store_update_parameters: The parameters for updating a configuration store. :type config_store_update_parameters: - ~app_configuration_management_client.models.ConfigurationStoreUpdateParameters + ~azure.mgmt.appconfiguration.models.ConfigurationStoreUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -553,11 +595,12 @@ async def begin_update( :return: An instance of AsyncLROPoller that returns either ConfigurationStore or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~app_configuration_management_client.models.ConfigurationStore] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appconfiguration.models.ConfigurationStore] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStore"] lro_delay = kwargs.pop( 'polling_interval', @@ -569,6 +612,7 @@ async def begin_update( resource_group_name=resource_group_name, config_store_name=config_store_name, config_store_update_parameters=config_store_update_parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -593,10 +637,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore @distributed_trace def list_keys( @@ -616,14 +659,16 @@ def list_keys( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiKeyListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~app_configuration_management_client.models.ApiKeyListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appconfiguration.models.ApiKeyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKeyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -636,6 +681,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, skip_token=skip_token, template_url=self.list_keys.metadata['url'], ) @@ -648,6 +694,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -666,7 +713,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -680,7 +731,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys"} # type: ignore @distributed_trace_async async def regenerate_key( @@ -698,11 +749,10 @@ async def regenerate_key( :param config_store_name: The name of the configuration store. :type config_store_name: str :param regenerate_key_parameters: The parameters for regenerating an access key. - :type regenerate_key_parameters: - ~app_configuration_management_client.models.RegenerateKeyParameters + :type regenerate_key_parameters: ~azure.mgmt.appconfiguration.models.RegenerateKeyParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiKey, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.ApiKey + :rtype: ~azure.mgmt.appconfiguration.models.ApiKey :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKey"] @@ -711,6 +761,7 @@ async def regenerate_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(regenerate_key_parameters, 'RegenerateKeyParameters') @@ -719,6 +770,7 @@ async def regenerate_key( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self.regenerate_key.metadata['url'], @@ -726,7 +778,11 @@ async def regenerate_key( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -741,7 +797,7 @@ async def regenerate_key( return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey'} # type: ignore + regenerate_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey"} # type: ignore @distributed_trace @@ -755,9 +811,11 @@ def list_deleted( :return: An iterator like instance of either DeletedConfigurationStoreListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~app_configuration_management_client.models.DeletedConfigurationStoreListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appconfiguration.models.DeletedConfigurationStoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedConfigurationStoreListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -768,6 +826,7 @@ def prepare_request(next_link=None): request = build_list_deleted_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_deleted.metadata['url'], ) request = _convert_request(request) @@ -777,6 +836,7 @@ def prepare_request(next_link=None): request = build_list_deleted_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -794,7 +854,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -808,7 +872,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores'} # type: ignore + list_deleted.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores"} # type: ignore @distributed_trace_async async def get_deleted( @@ -825,7 +889,7 @@ async def get_deleted( :type config_store_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DeletedConfigurationStore, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.DeletedConfigurationStore + :rtype: ~azure.mgmt.appconfiguration.models.DeletedConfigurationStore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedConfigurationStore"] @@ -834,17 +898,24 @@ async def get_deleted( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_deleted_request( subscription_id=self._config.subscription_id, location=location, config_store_name=config_store_name, + api_version=api_version, template_url=self.get_deleted.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -859,10 +930,10 @@ async def get_deleted( return deserialized - get_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}'} # type: ignore + get_deleted.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}"} # type: ignore - async def _purge_deleted_initial( + async def _purge_deleted_initial( # pylint: disable=inconsistent-return-statements self, location: str, config_store_name: str, @@ -874,17 +945,24 @@ async def _purge_deleted_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_purge_deleted_request_initial( subscription_id=self._config.subscription_id, location=location, config_store_name=config_store_name, + api_version=api_version, template_url=self._purge_deleted_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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, 202, 204]: @@ -894,11 +972,11 @@ async def _purge_deleted_initial( if cls: return cls(pipeline_response, None, {}) - _purge_deleted_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge'} # type: ignore + _purge_deleted_initial.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge"} # type: ignore @distributed_trace_async - async def begin_purge_deleted( + async def begin_purge_deleted( # pylint: disable=inconsistent-return-statements self, location: str, config_store_name: str, @@ -922,7 +1000,8 @@ async def begin_purge_deleted( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -933,6 +1012,7 @@ async def begin_purge_deleted( raw_result = await self._purge_deleted_initial( location=location, config_store_name=config_store_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -953,7 +1033,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_purge_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge'} # type: ignore + begin_purge_deleted.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_key_values_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_key_values_operations.py index 74d01d1cf372..1d8e673c9433 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_key_values_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_key_values_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +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 @@ -33,7 +32,7 @@ class KeyValuesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,14 +65,16 @@ def list_by_configuration_store( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either KeyValueListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~app_configuration_management_client.models.KeyValueListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appconfiguration.models.KeyValueListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyValueListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -86,6 +87,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, skip_token=skip_token, template_url=self.list_by_configuration_store.metadata['url'], ) @@ -98,6 +100,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -116,7 +119,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -130,7 +137,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_configuration_store.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues'} # type: ignore + list_by_configuration_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues"} # type: ignore @distributed_trace_async async def get( @@ -152,7 +159,7 @@ async def get( :type key_value_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: KeyValue, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.KeyValue + :rtype: ~azure.mgmt.appconfiguration.models.KeyValue :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyValue"] @@ -161,18 +168,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, key_value_name=key_value_name, + 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(request, stream=False, **kwargs) + 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]: @@ -187,7 +201,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}"} # type: ignore @distributed_trace_async @@ -209,11 +223,11 @@ async def create_or_update( :param key_value_name: Identifier of key and label combination. Key and label are joined by $ character. Label is optional. :type key_value_name: str - :param key_value_parameters: The parameters for creating a key-value. - :type key_value_parameters: ~app_configuration_management_client.models.KeyValue + :param key_value_parameters: The parameters for creating a key-value. Default value is None. + :type key_value_parameters: ~azure.mgmt.appconfiguration.models.KeyValue :keyword callable cls: A custom type or function that will be passed the direct response :return: KeyValue, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.KeyValue + :rtype: ~azure.mgmt.appconfiguration.models.KeyValue :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyValue"] @@ -222,6 +236,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] if key_value_parameters is not None: @@ -234,6 +249,7 @@ async def create_or_update( resource_group_name=resource_group_name, config_store_name=config_store_name, key_value_name=key_value_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], @@ -241,7 +257,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -256,10 +276,10 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -272,18 +292,25 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, key_value_name=key_value_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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, 202, 204]: @@ -293,11 +320,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -326,7 +353,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -338,6 +366,7 @@ async def begin_delete( resource_group_name=resource_group_name, config_store_name=config_store_name, key_value_name=key_value_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -358,7 +387,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_operations.py index 3018a62e366a..6ac7adcaf67f 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,10 +56,10 @@ async def check_name_availability( :param check_name_availability_parameters: The object containing information for the availability request. :type check_name_availability_parameters: - ~app_configuration_management_client.models.CheckNameAvailabilityParameters + ~azure.mgmt.appconfiguration.models.CheckNameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailabilityStatus, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.NameAvailabilityStatus + :rtype: ~azure.mgmt.appconfiguration.models.NameAvailabilityStatus :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NameAvailabilityStatus"] @@ -69,12 +68,14 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(check_name_availability_parameters, 'CheckNameAvailabilityParameters') request = build_check_name_availability_request( subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -82,7 +83,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -97,7 +102,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability"} # type: ignore @distributed_trace @@ -111,15 +116,17 @@ def list( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDefinitionListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~app_configuration_management_client.models.OperationDefinitionListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appconfiguration.models.OperationDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -129,6 +136,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( + api_version=api_version, skip_token=skip_token, template_url=self.list.metadata['url'], ) @@ -138,6 +146,7 @@ def prepare_request(next_link=None): else: request = build_list_request( + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -156,7 +165,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -170,7 +183,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.AppConfiguration/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.AppConfiguration/operations"} # type: ignore @distributed_trace_async async def regional_check_name_availability( @@ -186,10 +199,10 @@ async def regional_check_name_availability( :param check_name_availability_parameters: The object containing information for the availability request. :type check_name_availability_parameters: - ~app_configuration_management_client.models.CheckNameAvailabilityParameters + ~azure.mgmt.appconfiguration.models.CheckNameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailabilityStatus, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.NameAvailabilityStatus + :rtype: ~azure.mgmt.appconfiguration.models.NameAvailabilityStatus :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NameAvailabilityStatus"] @@ -198,6 +211,7 @@ async def regional_check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(check_name_availability_parameters, 'CheckNameAvailabilityParameters') @@ -205,6 +219,7 @@ async def regional_check_name_availability( request = build_regional_check_name_availability_request( subscription_id=self._config.subscription_id, location=location, + api_version=api_version, content_type=content_type, json=_json, template_url=self.regional_check_name_availability.metadata['url'], @@ -212,7 +227,11 @@ async def regional_check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -227,5 +246,5 @@ async def regional_check_name_availability( return deserialized - regional_check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/checkNameAvailability'} # type: ignore + regional_check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/checkNameAvailability"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_private_endpoint_connections_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_private_endpoint_connections_operations.py index 1199640cba07..34fcdc1174bb 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_private_endpoint_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +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 @@ -33,7 +32,7 @@ class PrivateEndpointConnectionsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,9 +65,11 @@ def list_by_configuration_store( :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~app_configuration_management_client.models.PrivateEndpointConnectionListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appconfiguration.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -81,6 +82,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=self.list_by_configuration_store.metadata['url'], ) request = _convert_request(request) @@ -92,6 +94,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -109,7 +112,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -123,7 +130,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_configuration_store.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections'} # type: ignore + list_by_configuration_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -144,7 +151,7 @@ async def get( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.appconfiguration.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] @@ -153,18 +160,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, + 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(request, stream=False, **kwargs) + 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]: @@ -179,7 +193,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore async def _create_or_update_initial( @@ -196,6 +210,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') @@ -205,6 +220,7 @@ async def _create_or_update_initial( resource_group_name=resource_group_name, config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -212,7 +228,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -230,7 +250,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async @@ -254,7 +274,7 @@ async def begin_create_or_update( :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection properties. :type private_endpoint_connection: - ~app_configuration_management_client.models.PrivateEndpointConnection + ~azure.mgmt.appconfiguration.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -266,11 +286,12 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~app_configuration_management_client.models.PrivateEndpointConnection] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appconfiguration.models.PrivateEndpointConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -283,6 +304,7 @@ async def begin_create_or_update( config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, private_endpoint_connection=private_endpoint_connection, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -307,12 +329,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -325,18 +346,25 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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, 202, 204]: @@ -346,11 +374,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -378,7 +406,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -390,6 +419,7 @@ async def begin_delete( resource_group_name=resource_group_name, config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -410,7 +440,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_private_link_resources_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_private_link_resources_operations.py index 46719c9b5018..fd8ae5e1a991 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_private_link_resources_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/operations/_private_link_resources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class PrivateLinkResourcesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,9 +63,11 @@ def list_by_configuration_store( :return: An iterator like instance of either PrivateLinkResourceListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~app_configuration_management_client.models.PrivateLinkResourceListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appconfiguration.models.PrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -79,6 +80,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=self.list_by_configuration_store.metadata['url'], ) request = _convert_request(request) @@ -90,6 +92,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -107,7 +110,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -121,7 +128,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_configuration_store.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources'} # type: ignore + list_by_configuration_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources"} # type: ignore @distributed_trace_async async def get( @@ -142,7 +149,7 @@ async def get( :type group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResource, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.PrivateLinkResource + :rtype: ~azure.mgmt.appconfiguration.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] @@ -151,18 +158,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, group_name=group_name, + 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(request, stream=False, **kwargs) + 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]: @@ -177,5 +191,5 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models_py3.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models_py3.py index 6db5e3e173cf..669c553abdf0 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models_py3.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models_py3.py @@ -72,7 +72,7 @@ class ApiKeyListResult(msrest.serialization.Model): """The result of a request to list API keys. :ivar value: The collection value. - :vartype value: list[~app_configuration_management_client.models.ApiKey] + :vartype value: list[~azure.mgmt.appconfiguration.models.ApiKey] :ivar next_link: The URI that can be used to request the next set of paged results. :vartype next_link: str """ @@ -91,7 +91,7 @@ def __init__( ): """ :keyword value: The collection value. - :paramtype value: list[~app_configuration_management_client.models.ApiKey] + :paramtype value: list[~azure.mgmt.appconfiguration.models.ApiKey] :keyword next_link: The URI that can be used to request the next set of paged results. :paramtype next_link: str """ @@ -109,7 +109,7 @@ class CheckNameAvailabilityParameters(msrest.serialization.Model): :vartype name: str :ivar type: Required. The resource type to check for name availability. Possible values include: "Microsoft.AppConfiguration/configurationStores". - :vartype type: str or ~app_configuration_management_client.models.ConfigurationResourceType + :vartype type: str or ~azure.mgmt.appconfiguration.models.ConfigurationResourceType """ _validation = { @@ -134,7 +134,7 @@ def __init__( :paramtype name: str :keyword type: Required. The resource type to check for name availability. Possible values include: "Microsoft.AppConfiguration/configurationStores". - :paramtype type: str or ~app_configuration_management_client.models.ConfigurationResourceType + :paramtype type: str or ~azure.mgmt.appconfiguration.models.ConfigurationResourceType """ super(CheckNameAvailabilityParameters, self).__init__(**kwargs) self.name = name @@ -254,29 +254,27 @@ class ConfigurationStore(TrackedResource): :ivar location: Required. The geo-location where the resource lives. :vartype location: str :ivar identity: The managed identity information, if configured. - :vartype identity: ~app_configuration_management_client.models.ResourceIdentity + :vartype identity: ~azure.mgmt.appconfiguration.models.ResourceIdentity :ivar sku: Required. The sku of the configuration store. - :vartype sku: ~app_configuration_management_client.models.Sku + :vartype sku: ~azure.mgmt.appconfiguration.models.Sku :ivar system_data: Resource system metadata. - :vartype system_data: ~app_configuration_management_client.models.SystemData + :vartype system_data: ~azure.mgmt.appconfiguration.models.SystemData :ivar provisioning_state: The provisioning state of the configuration store. Possible values include: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~app_configuration_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.appconfiguration.models.ProvisioningState :ivar creation_date: The creation date of configuration store. :vartype creation_date: ~datetime.datetime :ivar endpoint: The DNS endpoint where the configuration store API will be available. :vartype endpoint: str :ivar encryption: The encryption settings of the configuration store. - :vartype encryption: ~app_configuration_management_client.models.EncryptionProperties + :vartype encryption: ~azure.mgmt.appconfiguration.models.EncryptionProperties :ivar private_endpoint_connections: The list of private endpoint connections that are set up for this resource. :vartype private_endpoint_connections: - list[~app_configuration_management_client.models.PrivateEndpointConnectionReference] + list[~azure.mgmt.appconfiguration.models.PrivateEndpointConnectionReference] :ivar public_network_access: Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~app_configuration_management_client.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.appconfiguration.models.PublicNetworkAccess :ivar disable_local_auth: Disables all authentication methods other than AAD authentication. :vartype disable_local_auth: bool :ivar soft_delete_retention_in_days: The amount of time in days that the configuration store @@ -287,7 +285,7 @@ class ConfigurationStore(TrackedResource): :vartype enable_purge_protection: bool :ivar create_mode: Indicates whether the configuration store need to be recovered. Possible values include: "Recover", "Default". - :vartype create_mode: str or ~app_configuration_management_client.models.CreateMode + :vartype create_mode: str or ~azure.mgmt.appconfiguration.models.CreateMode """ _validation = { @@ -345,15 +343,15 @@ def __init__( :keyword location: Required. The geo-location where the resource lives. :paramtype location: str :keyword identity: The managed identity information, if configured. - :paramtype identity: ~app_configuration_management_client.models.ResourceIdentity + :paramtype identity: ~azure.mgmt.appconfiguration.models.ResourceIdentity :keyword sku: Required. The sku of the configuration store. - :paramtype sku: ~app_configuration_management_client.models.Sku + :paramtype sku: ~azure.mgmt.appconfiguration.models.Sku :keyword encryption: The encryption settings of the configuration store. - :paramtype encryption: ~app_configuration_management_client.models.EncryptionProperties + :paramtype encryption: ~azure.mgmt.appconfiguration.models.EncryptionProperties :keyword public_network_access: Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: "Enabled", "Disabled". :paramtype public_network_access: str or - ~app_configuration_management_client.models.PublicNetworkAccess + ~azure.mgmt.appconfiguration.models.PublicNetworkAccess :keyword disable_local_auth: Disables all authentication methods other than AAD authentication. :paramtype disable_local_auth: bool :keyword soft_delete_retention_in_days: The amount of time in days that the configuration store @@ -364,7 +362,7 @@ def __init__( :paramtype enable_purge_protection: bool :keyword create_mode: Indicates whether the configuration store need to be recovered. Possible values include: "Recover", "Default". - :paramtype create_mode: str or ~app_configuration_management_client.models.CreateMode + :paramtype create_mode: str or ~azure.mgmt.appconfiguration.models.CreateMode """ super(ConfigurationStore, self).__init__(tags=tags, location=location, **kwargs) self.identity = identity @@ -386,7 +384,7 @@ class ConfigurationStoreListResult(msrest.serialization.Model): """The result of a request to list configuration stores. :ivar value: The collection value. - :vartype value: list[~app_configuration_management_client.models.ConfigurationStore] + :vartype value: list[~azure.mgmt.appconfiguration.models.ConfigurationStore] :ivar next_link: The URI that can be used to request the next set of paged results. :vartype next_link: str """ @@ -405,7 +403,7 @@ def __init__( ): """ :keyword value: The collection value. - :paramtype value: list[~app_configuration_management_client.models.ConfigurationStore] + :paramtype value: list[~azure.mgmt.appconfiguration.models.ConfigurationStore] :keyword next_link: The URI that can be used to request the next set of paged results. :paramtype next_link: str """ @@ -418,19 +416,18 @@ class ConfigurationStoreUpdateParameters(msrest.serialization.Model): """The parameters for updating a configuration store. :ivar identity: The managed identity information for the configuration store. - :vartype identity: ~app_configuration_management_client.models.ResourceIdentity + :vartype identity: ~azure.mgmt.appconfiguration.models.ResourceIdentity :ivar sku: The SKU of the configuration store. - :vartype sku: ~app_configuration_management_client.models.Sku + :vartype sku: ~azure.mgmt.appconfiguration.models.Sku :ivar tags: A set of tags. The ARM resource tags. :vartype tags: dict[str, str] :ivar encryption: The encryption settings of the configuration store. - :vartype encryption: ~app_configuration_management_client.models.EncryptionProperties + :vartype encryption: ~azure.mgmt.appconfiguration.models.EncryptionProperties :ivar disable_local_auth: Disables all authentication methods other than AAD authentication. :vartype disable_local_auth: bool :ivar public_network_access: Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or - ~app_configuration_management_client.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.appconfiguration.models.PublicNetworkAccess :ivar enable_purge_protection: Property specifying whether protection against purge is enabled for this configuration store. :vartype enable_purge_protection: bool @@ -460,19 +457,19 @@ def __init__( ): """ :keyword identity: The managed identity information for the configuration store. - :paramtype identity: ~app_configuration_management_client.models.ResourceIdentity + :paramtype identity: ~azure.mgmt.appconfiguration.models.ResourceIdentity :keyword sku: The SKU of the configuration store. - :paramtype sku: ~app_configuration_management_client.models.Sku + :paramtype sku: ~azure.mgmt.appconfiguration.models.Sku :keyword tags: A set of tags. The ARM resource tags. :paramtype tags: dict[str, str] :keyword encryption: The encryption settings of the configuration store. - :paramtype encryption: ~app_configuration_management_client.models.EncryptionProperties + :paramtype encryption: ~azure.mgmt.appconfiguration.models.EncryptionProperties :keyword disable_local_auth: Disables all authentication methods other than AAD authentication. :paramtype disable_local_auth: bool :keyword public_network_access: Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: "Enabled", "Disabled". :paramtype public_network_access: str or - ~app_configuration_management_client.models.PublicNetworkAccess + ~azure.mgmt.appconfiguration.models.PublicNetworkAccess :keyword enable_purge_protection: Property specifying whether protection against purge is enabled for this configuration store. :paramtype enable_purge_protection: bool @@ -558,7 +555,7 @@ class DeletedConfigurationStoreListResult(msrest.serialization.Model): """List of deleted configuration stores. :ivar value: The list of deleted configuration store. - :vartype value: list[~app_configuration_management_client.models.DeletedConfigurationStore] + :vartype value: list[~azure.mgmt.appconfiguration.models.DeletedConfigurationStore] :ivar next_link: The URL to get the next set of deleted configuration stores. :vartype next_link: str """ @@ -577,7 +574,7 @@ def __init__( ): """ :keyword value: The list of deleted configuration store. - :paramtype value: list[~app_configuration_management_client.models.DeletedConfigurationStore] + :paramtype value: list[~azure.mgmt.appconfiguration.models.DeletedConfigurationStore] :keyword next_link: The URL to get the next set of deleted configuration stores. :paramtype next_link: str """ @@ -590,7 +587,7 @@ class EncryptionProperties(msrest.serialization.Model): """The encryption settings for a configuration store. :ivar key_vault_properties: Key vault properties. - :vartype key_vault_properties: ~app_configuration_management_client.models.KeyVaultProperties + :vartype key_vault_properties: ~azure.mgmt.appconfiguration.models.KeyVaultProperties """ _attribute_map = { @@ -605,7 +602,7 @@ def __init__( ): """ :keyword key_vault_properties: Key vault properties. - :paramtype key_vault_properties: ~app_configuration_management_client.models.KeyVaultProperties + :paramtype key_vault_properties: ~azure.mgmt.appconfiguration.models.KeyVaultProperties """ super(EncryptionProperties, self).__init__(**kwargs) self.key_vault_properties = key_vault_properties @@ -653,7 +650,7 @@ class ErrorDetails(msrest.serialization.Model): :ivar message: Error message indicating why the operation failed. :vartype message: str :ivar additional_info: The error additional info. - :vartype additional_info: list[~app_configuration_management_client.models.ErrorAdditionalInfo] + :vartype additional_info: list[~azure.mgmt.appconfiguration.models.ErrorAdditionalInfo] """ _validation = { @@ -684,7 +681,7 @@ class ErrorResponse(msrest.serialization.Model): """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. :ivar error: The details of the error. - :vartype error: ~app_configuration_management_client.models.ErrorDetails + :vartype error: ~azure.mgmt.appconfiguration.models.ErrorDetails """ _attribute_map = { @@ -699,7 +696,7 @@ def __init__( ): """ :keyword error: The details of the error. - :paramtype error: ~app_configuration_management_client.models.ErrorDetails + :paramtype error: ~azure.mgmt.appconfiguration.models.ErrorDetails """ super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -802,7 +799,7 @@ class KeyValueListResult(msrest.serialization.Model): """The result of a request to list key-values. :ivar value: The collection value. - :vartype value: list[~app_configuration_management_client.models.KeyValue] + :vartype value: list[~azure.mgmt.appconfiguration.models.KeyValue] :ivar next_link: The URI that can be used to request the next set of paged results. :vartype next_link: str """ @@ -821,7 +818,7 @@ def __init__( ): """ :keyword value: The collection value. - :paramtype value: list[~app_configuration_management_client.models.KeyValue] + :paramtype value: list[~azure.mgmt.appconfiguration.models.KeyValue] :keyword next_link: The URI that can be used to request the next set of paged results. :paramtype next_link: str """ @@ -958,7 +955,7 @@ class MetricSpecification(msrest.serialization.Model): :ivar internal_metric_name: Internal metric name. :vartype internal_metric_name: str :ivar dimensions: Dimensions of the metric. - :vartype dimensions: list[~app_configuration_management_client.models.MetricDimension] + :vartype dimensions: list[~azure.mgmt.appconfiguration.models.MetricDimension] :ivar fill_gap_with_zero: Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. :vartype fill_gap_with_zero: bool @@ -1003,7 +1000,7 @@ def __init__( :keyword internal_metric_name: Internal metric name. :paramtype internal_metric_name: str :keyword dimensions: Dimensions of the metric. - :paramtype dimensions: list[~app_configuration_management_client.models.MetricDimension] + :paramtype dimensions: list[~azure.mgmt.appconfiguration.models.MetricDimension] :keyword fill_gap_with_zero: Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. :paramtype fill_gap_with_zero: bool @@ -1065,11 +1062,11 @@ class OperationDefinition(msrest.serialization.Model): :ivar is_data_action: Indicates whether the operation is a data action. :vartype is_data_action: bool :ivar display: The display information for the configuration store operation. - :vartype display: ~app_configuration_management_client.models.OperationDefinitionDisplay + :vartype display: ~azure.mgmt.appconfiguration.models.OperationDefinitionDisplay :ivar origin: Origin of the operation. :vartype origin: str :ivar properties: Properties of the operation. - :vartype properties: ~app_configuration_management_client.models.OperationProperties + :vartype properties: ~azure.mgmt.appconfiguration.models.OperationProperties """ _attribute_map = { @@ -1096,11 +1093,11 @@ def __init__( :keyword is_data_action: Indicates whether the operation is a data action. :paramtype is_data_action: bool :keyword display: The display information for the configuration store operation. - :paramtype display: ~app_configuration_management_client.models.OperationDefinitionDisplay + :paramtype display: ~azure.mgmt.appconfiguration.models.OperationDefinitionDisplay :keyword origin: Origin of the operation. :paramtype origin: str :keyword properties: Properties of the operation. - :paramtype properties: ~app_configuration_management_client.models.OperationProperties + :paramtype properties: ~azure.mgmt.appconfiguration.models.OperationProperties """ super(OperationDefinition, self).__init__(**kwargs) self.name = name @@ -1163,7 +1160,7 @@ class OperationDefinitionListResult(msrest.serialization.Model): """The result of a request to list configuration store operations. :ivar value: The collection value. - :vartype value: list[~app_configuration_management_client.models.OperationDefinition] + :vartype value: list[~azure.mgmt.appconfiguration.models.OperationDefinition] :ivar next_link: The URI that can be used to request the next set of paged results. :vartype next_link: str """ @@ -1182,7 +1179,7 @@ def __init__( ): """ :keyword value: The collection value. - :paramtype value: list[~app_configuration_management_client.models.OperationDefinition] + :paramtype value: list[~azure.mgmt.appconfiguration.models.OperationDefinition] :keyword next_link: The URI that can be used to request the next set of paged results. :paramtype next_link: str """ @@ -1195,8 +1192,7 @@ class OperationProperties(msrest.serialization.Model): """Extra Operation properties. :ivar service_specification: Service specifications of the operation. - :vartype service_specification: - ~app_configuration_management_client.models.ServiceSpecification + :vartype service_specification: ~azure.mgmt.appconfiguration.models.ServiceSpecification """ _attribute_map = { @@ -1211,8 +1207,7 @@ def __init__( ): """ :keyword service_specification: Service specifications of the operation. - :paramtype service_specification: - ~app_configuration_management_client.models.ServiceSpecification + :paramtype service_specification: ~azure.mgmt.appconfiguration.models.ServiceSpecification """ super(OperationProperties, self).__init__(**kwargs) self.service_specification = service_specification @@ -1256,14 +1251,13 @@ class PrivateEndpointConnection(msrest.serialization.Model): :vartype type: str :ivar provisioning_state: The provisioning status of the private endpoint connection. Possible values include: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~app_configuration_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.appconfiguration.models.ProvisioningState :ivar private_endpoint: The resource of private endpoint. - :vartype private_endpoint: ~app_configuration_management_client.models.PrivateEndpoint + :vartype private_endpoint: ~azure.mgmt.appconfiguration.models.PrivateEndpoint :ivar private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :vartype private_link_service_connection_state: - ~app_configuration_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.appconfiguration.models.PrivateLinkServiceConnectionState """ _validation = { @@ -1291,11 +1285,11 @@ def __init__( ): """ :keyword private_endpoint: The resource of private endpoint. - :paramtype private_endpoint: ~app_configuration_management_client.models.PrivateEndpoint + :paramtype private_endpoint: ~azure.mgmt.appconfiguration.models.PrivateEndpoint :keyword private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :paramtype private_link_service_connection_state: - ~app_configuration_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.appconfiguration.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.id = None @@ -1310,7 +1304,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. :ivar value: The collection value. - :vartype value: list[~app_configuration_management_client.models.PrivateEndpointConnection] + :vartype value: list[~azure.mgmt.appconfiguration.models.PrivateEndpointConnection] :ivar next_link: The URI that can be used to request the next set of paged results. :vartype next_link: str """ @@ -1329,7 +1323,7 @@ def __init__( ): """ :keyword value: The collection value. - :paramtype value: list[~app_configuration_management_client.models.PrivateEndpointConnection] + :paramtype value: list[~azure.mgmt.appconfiguration.models.PrivateEndpointConnection] :keyword next_link: The URI that can be used to request the next set of paged results. :paramtype next_link: str """ @@ -1351,14 +1345,13 @@ class PrivateEndpointConnectionReference(msrest.serialization.Model): :vartype type: str :ivar provisioning_state: The provisioning status of the private endpoint connection. Possible values include: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". - :vartype provisioning_state: str or - ~app_configuration_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.appconfiguration.models.ProvisioningState :ivar private_endpoint: The resource of private endpoint. - :vartype private_endpoint: ~app_configuration_management_client.models.PrivateEndpoint + :vartype private_endpoint: ~azure.mgmt.appconfiguration.models.PrivateEndpoint :ivar private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :vartype private_link_service_connection_state: - ~app_configuration_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.appconfiguration.models.PrivateLinkServiceConnectionState """ _validation = { @@ -1386,11 +1379,11 @@ def __init__( ): """ :keyword private_endpoint: The resource of private endpoint. - :paramtype private_endpoint: ~app_configuration_management_client.models.PrivateEndpoint + :paramtype private_endpoint: ~azure.mgmt.appconfiguration.models.PrivateEndpoint :keyword private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :paramtype private_link_service_connection_state: - ~app_configuration_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.appconfiguration.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnectionReference, self).__init__(**kwargs) self.id = None @@ -1457,7 +1450,7 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """A list of private link resources. :ivar value: The collection value. - :vartype value: list[~app_configuration_management_client.models.PrivateLinkResource] + :vartype value: list[~azure.mgmt.appconfiguration.models.PrivateLinkResource] :ivar next_link: The URI that can be used to request the next set of paged results. :vartype next_link: str """ @@ -1476,7 +1469,7 @@ def __init__( ): """ :keyword value: The collection value. - :paramtype value: list[~app_configuration_management_client.models.PrivateLinkResource] + :paramtype value: list[~azure.mgmt.appconfiguration.models.PrivateLinkResource] :keyword next_link: The URI that can be used to request the next set of paged results. :paramtype next_link: str """ @@ -1492,12 +1485,12 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): :ivar status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :vartype status: str or ~app_configuration_management_client.models.ConnectionStatus + :vartype status: str or ~azure.mgmt.appconfiguration.models.ConnectionStatus :ivar description: The private link service connection description. :vartype description: str :ivar actions_required: Any action that is required beyond basic workflow (approve/ reject/ disconnect). Possible values include: "None", "Recreate". - :vartype actions_required: str or ~app_configuration_management_client.models.ActionsRequired + :vartype actions_required: str or ~azure.mgmt.appconfiguration.models.ActionsRequired """ _validation = { @@ -1520,7 +1513,7 @@ def __init__( """ :keyword status: The private link service connection status. Possible values include: "Pending", "Approved", "Rejected", "Disconnected". - :paramtype status: str or ~app_configuration_management_client.models.ConnectionStatus + :paramtype status: str or ~azure.mgmt.appconfiguration.models.ConnectionStatus :keyword description: The private link service connection description. :paramtype description: str """ @@ -1564,12 +1557,11 @@ class ResourceIdentity(msrest.serialization.Model): both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. Possible values include: "None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned". - :vartype type: str or ~app_configuration_management_client.models.IdentityType + :vartype type: str or ~azure.mgmt.appconfiguration.models.IdentityType :ivar user_assigned_identities: The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :vartype user_assigned_identities: dict[str, - ~app_configuration_management_client.models.UserIdentity] + :vartype user_assigned_identities: dict[str, ~azure.mgmt.appconfiguration.models.UserIdentity] :ivar principal_id: The principal id of the identity. This property will only be provided for a system-assigned identity. :vartype principal_id: str @@ -1602,12 +1594,12 @@ def __init__( includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. Possible values include: "None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned". - :paramtype type: str or ~app_configuration_management_client.models.IdentityType + :paramtype type: str or ~azure.mgmt.appconfiguration.models.IdentityType :keyword user_assigned_identities: The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :paramtype user_assigned_identities: dict[str, - ~app_configuration_management_client.models.UserIdentity] + ~azure.mgmt.appconfiguration.models.UserIdentity] """ super(ResourceIdentity, self).__init__(**kwargs) self.type = type @@ -1620,10 +1612,9 @@ class ServiceSpecification(msrest.serialization.Model): """Service specification payload. :ivar log_specifications: Specifications of the Log for Azure Monitoring. - :vartype log_specifications: list[~app_configuration_management_client.models.LogSpecification] + :vartype log_specifications: list[~azure.mgmt.appconfiguration.models.LogSpecification] :ivar metric_specifications: Specifications of the Metrics for Azure Monitoring. - :vartype metric_specifications: - list[~app_configuration_management_client.models.MetricSpecification] + :vartype metric_specifications: list[~azure.mgmt.appconfiguration.models.MetricSpecification] """ _attribute_map = { @@ -1640,11 +1631,9 @@ def __init__( ): """ :keyword log_specifications: Specifications of the Log for Azure Monitoring. - :paramtype log_specifications: - list[~app_configuration_management_client.models.LogSpecification] + :paramtype log_specifications: list[~azure.mgmt.appconfiguration.models.LogSpecification] :keyword metric_specifications: Specifications of the Metrics for Azure Monitoring. - :paramtype metric_specifications: - list[~app_configuration_management_client.models.MetricSpecification] + :paramtype metric_specifications: list[~azure.mgmt.appconfiguration.models.MetricSpecification] """ super(ServiceSpecification, self).__init__(**kwargs) self.log_specifications = log_specifications @@ -1689,15 +1678,14 @@ class SystemData(msrest.serialization.Model): :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 ~app_configuration_management_client.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.appconfiguration.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 - ~app_configuration_management_client.models.CreatedByType + :vartype last_modified_by_type: str or ~azure.mgmt.appconfiguration.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ @@ -1727,15 +1715,14 @@ def __init__( :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 ~app_configuration_management_client.models.CreatedByType + :paramtype created_by_type: str or ~azure.mgmt.appconfiguration.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 - ~app_configuration_management_client.models.CreatedByType + :paramtype last_modified_by_type: str or ~azure.mgmt.appconfiguration.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_configuration_stores_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_configuration_stores_operations.py index 514ba48b8ef3..e565f543bae7 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_configuration_stores_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_configuration_stores_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +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 @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -35,31 +35,32 @@ def build_list_request( skip_token: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip_token is not None: - query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + _query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -71,32 +72,33 @@ def build_list_by_resource_group_request( skip_token: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores") # 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'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip_token is not None: - query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + _query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -107,31 +109,32 @@ def build_get_request( config_store_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") # 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'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -145,35 +148,35 @@ def build_create_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-10-01-preview" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") # 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'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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 = 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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -186,31 +189,32 @@ def build_delete_request_initial( config_store_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") # 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'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -224,35 +228,35 @@ def build_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-10-01-preview" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") # 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'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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 = 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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -267,33 +271,34 @@ def build_list_keys_request( skip_token: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys") # 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'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip_token is not None: - query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + _query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -307,35 +312,35 @@ def build_regenerate_key_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-10-01-preview" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey") # 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'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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 = 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') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -346,29 +351,30 @@ def build_list_deleted_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -379,31 +385,32 @@ def build_get_deleted_request( config_store_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "location": _SERIALIZER.url("location", location, 'str'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -414,31 +421,32 @@ def build_purge_deleted_request_initial( config_store_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "location": _SERIALIZER.url("location", location, 'str'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -449,7 +457,7 @@ class ConfigurationStoresOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -475,15 +483,17 @@ def list( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationStoreListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~app_configuration_management_client.models.ConfigurationStoreListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.appconfiguration.models.ConfigurationStoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStoreListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -494,6 +504,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, skip_token=skip_token, template_url=self.list.metadata['url'], ) @@ -504,6 +515,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -522,7 +534,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -536,7 +552,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores"} # type: ignore @distributed_trace def list_by_resource_group( @@ -553,15 +569,17 @@ def list_by_resource_group( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationStoreListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~app_configuration_management_client.models.ConfigurationStoreListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.appconfiguration.models.ConfigurationStoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStoreListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -573,6 +591,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, + api_version=api_version, skip_token=skip_token, template_url=self.list_by_resource_group.metadata['url'], ) @@ -584,6 +603,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -602,7 +622,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -616,7 +640,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores"} # type: ignore @distributed_trace def get( @@ -634,7 +658,7 @@ def get( :type config_store_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfigurationStore, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.ConfigurationStore + :rtype: ~azure.mgmt.appconfiguration.models.ConfigurationStore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStore"] @@ -643,17 +667,24 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + 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(request, stream=False, **kwargs) + 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]: @@ -668,7 +699,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore def _create_initial( @@ -684,6 +715,7 @@ def _create_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(config_store_creation_parameters, 'ConfigurationStore') @@ -692,6 +724,7 @@ def _create_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_initial.metadata['url'], @@ -699,7 +732,11 @@ def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -717,7 +754,7 @@ def _create_initial( return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + _create_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore @distributed_trace @@ -736,8 +773,7 @@ def begin_create( :param config_store_name: The name of the configuration store. :type config_store_name: str :param config_store_creation_parameters: The parameters for creating a configuration store. - :type config_store_creation_parameters: - ~app_configuration_management_client.models.ConfigurationStore + :type config_store_creation_parameters: ~azure.mgmt.appconfiguration.models.ConfigurationStore :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -748,12 +784,12 @@ def begin_create( Retry-After header is present. :return: An instance of LROPoller that returns either ConfigurationStore or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~app_configuration_management_client.models.ConfigurationStore] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appconfiguration.models.ConfigurationStore] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStore"] lro_delay = kwargs.pop( 'polling_interval', @@ -765,6 +801,7 @@ def begin_create( resource_group_name=resource_group_name, config_store_name=config_store_name, config_store_creation_parameters=config_store_creation_parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -789,12 +826,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + begin_create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -806,17 +842,24 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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, 202, 204]: @@ -826,11 +869,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -855,7 +898,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -866,6 +910,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -886,10 +931,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore def _update_initial( self, @@ -904,6 +948,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(config_store_update_parameters, 'ConfigurationStoreUpdateParameters') @@ -912,6 +957,7 @@ def _update_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -919,7 +965,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -937,7 +987,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore @distributed_trace @@ -957,7 +1007,7 @@ def begin_update( :type config_store_name: str :param config_store_update_parameters: The parameters for updating a configuration store. :type config_store_update_parameters: - ~app_configuration_management_client.models.ConfigurationStoreUpdateParameters + ~azure.mgmt.appconfiguration.models.ConfigurationStoreUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -968,12 +1018,12 @@ def begin_update( Retry-After header is present. :return: An instance of LROPoller that returns either ConfigurationStore or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~app_configuration_management_client.models.ConfigurationStore] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appconfiguration.models.ConfigurationStore] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationStore"] lro_delay = kwargs.pop( 'polling_interval', @@ -985,6 +1035,7 @@ def begin_update( resource_group_name=resource_group_name, config_store_name=config_store_name, config_store_update_parameters=config_store_update_parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -1009,10 +1060,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}"} # type: ignore @distributed_trace def list_keys( @@ -1032,14 +1082,15 @@ def list_keys( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiKeyListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~app_configuration_management_client.models.ApiKeyListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appconfiguration.models.ApiKeyListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKeyListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1052,6 +1103,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, skip_token=skip_token, template_url=self.list_keys.metadata['url'], ) @@ -1064,6 +1116,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -1082,7 +1135,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -1096,7 +1153,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys"} # type: ignore @distributed_trace def regenerate_key( @@ -1114,11 +1171,10 @@ def regenerate_key( :param config_store_name: The name of the configuration store. :type config_store_name: str :param regenerate_key_parameters: The parameters for regenerating an access key. - :type regenerate_key_parameters: - ~app_configuration_management_client.models.RegenerateKeyParameters + :type regenerate_key_parameters: ~azure.mgmt.appconfiguration.models.RegenerateKeyParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiKey, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.ApiKey + :rtype: ~azure.mgmt.appconfiguration.models.ApiKey :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKey"] @@ -1127,6 +1183,7 @@ def regenerate_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(regenerate_key_parameters, 'RegenerateKeyParameters') @@ -1135,6 +1192,7 @@ def regenerate_key( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self.regenerate_key.metadata['url'], @@ -1142,7 +1200,11 @@ def regenerate_key( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -1157,7 +1219,7 @@ def regenerate_key( return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey'} # type: ignore + regenerate_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey"} # type: ignore @distributed_trace @@ -1171,9 +1233,11 @@ def list_deleted( :return: An iterator like instance of either DeletedConfigurationStoreListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~app_configuration_management_client.models.DeletedConfigurationStoreListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.appconfiguration.models.DeletedConfigurationStoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedConfigurationStoreListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1184,6 +1248,7 @@ def prepare_request(next_link=None): request = build_list_deleted_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_deleted.metadata['url'], ) request = _convert_request(request) @@ -1193,6 +1258,7 @@ def prepare_request(next_link=None): request = build_list_deleted_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1210,7 +1276,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -1224,7 +1294,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores'} # type: ignore + list_deleted.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores"} # type: ignore @distributed_trace def get_deleted( @@ -1241,7 +1311,7 @@ def get_deleted( :type config_store_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DeletedConfigurationStore, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.DeletedConfigurationStore + :rtype: ~azure.mgmt.appconfiguration.models.DeletedConfigurationStore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedConfigurationStore"] @@ -1250,17 +1320,24 @@ def get_deleted( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_deleted_request( subscription_id=self._config.subscription_id, location=location, config_store_name=config_store_name, + api_version=api_version, template_url=self.get_deleted.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -1275,10 +1352,10 @@ def get_deleted( return deserialized - get_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}'} # type: ignore + get_deleted.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}"} # type: ignore - def _purge_deleted_initial( + def _purge_deleted_initial( # pylint: disable=inconsistent-return-statements self, location: str, config_store_name: str, @@ -1290,17 +1367,24 @@ def _purge_deleted_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_purge_deleted_request_initial( subscription_id=self._config.subscription_id, location=location, config_store_name=config_store_name, + api_version=api_version, template_url=self._purge_deleted_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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, 202, 204]: @@ -1310,11 +1394,11 @@ def _purge_deleted_initial( if cls: return cls(pipeline_response, None, {}) - _purge_deleted_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge'} # type: ignore + _purge_deleted_initial.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge"} # type: ignore @distributed_trace - def begin_purge_deleted( + def begin_purge_deleted( # pylint: disable=inconsistent-return-statements self, location: str, config_store_name: str, @@ -1338,7 +1422,8 @@ def begin_purge_deleted( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1349,6 +1434,7 @@ def begin_purge_deleted( raw_result = self._purge_deleted_initial( location=location, config_store_name=config_store_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -1369,7 +1455,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_purge_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge'} # type: ignore + begin_purge_deleted.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_key_values_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_key_values_operations.py index 67976b702312..6a5b44a740e3 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_key_values_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_key_values_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +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 @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,33 +37,34 @@ def build_list_by_configuration_store_request( skip_token: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues") # 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'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip_token is not None: - query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + _query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -75,10 +76,11 @@ def build_get_request( key_value_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") # 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'), @@ -86,21 +88,21 @@ def build_get_request( "keyValueName": _SERIALIZER.url("key_value_name", key_value_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -115,12 +117,12 @@ def build_create_or_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-10-01-preview" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") # 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'), @@ -128,23 +130,23 @@ def build_create_or_update_request( "keyValueName": _SERIALIZER.url("key_value_name", key_value_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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 = 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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -158,10 +160,11 @@ def build_delete_request_initial( key_value_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") # 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'), @@ -169,21 +172,21 @@ def build_delete_request_initial( "keyValueName": _SERIALIZER.url("key_value_name", key_value_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -194,7 +197,7 @@ class KeyValuesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -227,14 +230,15 @@ def list_by_configuration_store( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either KeyValueListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~app_configuration_management_client.models.KeyValueListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appconfiguration.models.KeyValueListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyValueListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -247,6 +251,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, skip_token=skip_token, template_url=self.list_by_configuration_store.metadata['url'], ) @@ -259,6 +264,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -277,7 +283,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -291,7 +301,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_configuration_store.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues'} # type: ignore + list_by_configuration_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues"} # type: ignore @distributed_trace def get( @@ -313,7 +323,7 @@ def get( :type key_value_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: KeyValue, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.KeyValue + :rtype: ~azure.mgmt.appconfiguration.models.KeyValue :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyValue"] @@ -322,18 +332,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, key_value_name=key_value_name, + 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(request, stream=False, **kwargs) + 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]: @@ -348,7 +365,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}"} # type: ignore @distributed_trace @@ -370,11 +387,11 @@ def create_or_update( :param key_value_name: Identifier of key and label combination. Key and label are joined by $ character. Label is optional. :type key_value_name: str - :param key_value_parameters: The parameters for creating a key-value. - :type key_value_parameters: ~app_configuration_management_client.models.KeyValue + :param key_value_parameters: The parameters for creating a key-value. Default value is None. + :type key_value_parameters: ~azure.mgmt.appconfiguration.models.KeyValue :keyword callable cls: A custom type or function that will be passed the direct response :return: KeyValue, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.KeyValue + :rtype: ~azure.mgmt.appconfiguration.models.KeyValue :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyValue"] @@ -383,6 +400,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] if key_value_parameters is not None: @@ -395,6 +413,7 @@ def create_or_update( resource_group_name=resource_group_name, config_store_name=config_store_name, key_value_name=key_value_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], @@ -402,7 +421,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -417,10 +440,10 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -433,18 +456,25 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, key_value_name=key_value_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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, 202, 204]: @@ -454,11 +484,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -487,7 +517,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -499,6 +530,7 @@ def begin_delete( resource_group_name=resource_group_name, config_store_name=config_store_name, key_value_name=key_value_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -519,7 +551,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_operations.py index 4eacc664ddcc..cc4f5199b962 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -34,33 +34,33 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-10-01-preview" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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 = 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') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -72,26 +72,27 @@ def build_list_request( skip_token: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/providers/Microsoft.AppConfiguration/operations') + _url = kwargs.pop("template_url", "/providers/Microsoft.AppConfiguration/operations") # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if skip_token is not None: - query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + _query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -104,34 +105,34 @@ def build_regional_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-10-01-preview" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/checkNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/checkNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "location": _SERIALIZER.url("location", location, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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 = 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') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -144,7 +145,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -170,10 +171,10 @@ def check_name_availability( :param check_name_availability_parameters: The object containing information for the availability request. :type check_name_availability_parameters: - ~app_configuration_management_client.models.CheckNameAvailabilityParameters + ~azure.mgmt.appconfiguration.models.CheckNameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailabilityStatus, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.NameAvailabilityStatus + :rtype: ~azure.mgmt.appconfiguration.models.NameAvailabilityStatus :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NameAvailabilityStatus"] @@ -182,12 +183,14 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(check_name_availability_parameters, 'CheckNameAvailabilityParameters') request = build_check_name_availability_request( subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -195,7 +198,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -210,7 +217,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability"} # type: ignore @distributed_trace @@ -224,15 +231,17 @@ def list( :param skip_token: A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for - subsequent calls. + subsequent calls. Default value is None. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationDefinitionListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~app_configuration_management_client.models.OperationDefinitionListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.appconfiguration.models.OperationDefinitionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationDefinitionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -242,6 +251,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( + api_version=api_version, skip_token=skip_token, template_url=self.list.metadata['url'], ) @@ -251,6 +261,7 @@ def prepare_request(next_link=None): else: request = build_list_request( + api_version=api_version, skip_token=skip_token, template_url=next_link, ) @@ -269,7 +280,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -283,7 +298,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.AppConfiguration/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.AppConfiguration/operations"} # type: ignore @distributed_trace def regional_check_name_availability( @@ -299,10 +314,10 @@ def regional_check_name_availability( :param check_name_availability_parameters: The object containing information for the availability request. :type check_name_availability_parameters: - ~app_configuration_management_client.models.CheckNameAvailabilityParameters + ~azure.mgmt.appconfiguration.models.CheckNameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailabilityStatus, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.NameAvailabilityStatus + :rtype: ~azure.mgmt.appconfiguration.models.NameAvailabilityStatus :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NameAvailabilityStatus"] @@ -311,6 +326,7 @@ def regional_check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(check_name_availability_parameters, 'CheckNameAvailabilityParameters') @@ -318,6 +334,7 @@ def regional_check_name_availability( request = build_regional_check_name_availability_request( subscription_id=self._config.subscription_id, location=location, + api_version=api_version, content_type=content_type, json=_json, template_url=self.regional_check_name_availability.metadata['url'], @@ -325,7 +342,11 @@ def regional_check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -340,5 +361,5 @@ def regional_check_name_availability( return deserialized - regional_check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/checkNameAvailability'} # type: ignore + regional_check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/checkNameAvailability"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_endpoint_connections_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_endpoint_connections_operations.py index 474ddd842b49..a245a8bdeb24 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_endpoint_connections_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_endpoint_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +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 @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -35,31 +35,32 @@ def build_list_by_configuration_store_request( config_store_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections") # 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'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -71,10 +72,11 @@ def build_get_request( private_endpoint_connection_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") # 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'), @@ -82,21 +84,21 @@ def build_get_request( "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -111,12 +113,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-10-01-preview" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") # 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'), @@ -124,23 +126,23 @@ def build_create_or_update_request_initial( "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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 = 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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -154,10 +156,11 @@ def build_delete_request_initial( private_endpoint_connection_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") # 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'), @@ -165,21 +168,21 @@ def build_delete_request_initial( "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -190,7 +193,7 @@ class PrivateEndpointConnectionsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -223,9 +226,11 @@ def list_by_configuration_store( :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~app_configuration_management_client.models.PrivateEndpointConnectionListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.appconfiguration.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -238,6 +243,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=self.list_by_configuration_store.metadata['url'], ) request = _convert_request(request) @@ -249,6 +255,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -266,7 +273,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -280,7 +291,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_configuration_store.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections'} # type: ignore + list_by_configuration_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -301,7 +312,7 @@ def get( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.appconfiguration.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] @@ -310,18 +321,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, + 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(request, stream=False, **kwargs) + 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]: @@ -336,7 +354,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore def _create_or_update_initial( @@ -353,6 +371,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') @@ -362,6 +381,7 @@ def _create_or_update_initial( resource_group_name=resource_group_name, config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -369,7 +389,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -387,7 +411,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace @@ -411,7 +435,7 @@ def begin_create_or_update( :type private_endpoint_connection_name: str :param private_endpoint_connection: The private endpoint connection properties. :type private_endpoint_connection: - ~app_configuration_management_client.models.PrivateEndpointConnection + ~azure.mgmt.appconfiguration.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -423,11 +447,12 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~app_configuration_management_client.models.PrivateEndpointConnection] + ~azure.core.polling.LROPoller[~azure.mgmt.appconfiguration.models.PrivateEndpointConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -440,6 +465,7 @@ def begin_create_or_update( config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, private_endpoint_connection=private_endpoint_connection, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -464,12 +490,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -482,18 +507,25 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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, 202, 204]: @@ -503,11 +535,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, config_store_name: str, @@ -535,7 +567,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -547,6 +580,7 @@ def begin_delete( resource_group_name=resource_group_name, config_store_name=config_store_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -567,7 +601,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_link_resources_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_link_resources_operations.py index 769e07af5ee0..931297b2d8f2 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_link_resources_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_link_resources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,31 +32,32 @@ def build_list_by_configuration_store_request( config_store_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources") # 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'), "configStoreName": _SERIALIZER.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -68,10 +69,11 @@ def build_get_request( group_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-10-01-preview" + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}") # 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'), @@ -79,21 +81,21 @@ def build_get_request( "groupName": _SERIALIZER.url("group_name", group_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _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') + _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') + _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, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -104,7 +106,7 @@ class PrivateLinkResourcesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~app_configuration_management_client.models + :type models: ~azure.mgmt.appconfiguration.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -137,9 +139,11 @@ def list_by_configuration_store( :return: An iterator like instance of either PrivateLinkResourceListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~app_configuration_management_client.models.PrivateLinkResourceListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.appconfiguration.models.PrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -152,6 +156,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=self.list_by_configuration_store.metadata['url'], ) request = _convert_request(request) @@ -163,6 +168,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -180,7 +186,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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]: @@ -194,7 +204,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_configuration_store.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources'} # type: ignore + list_by_configuration_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources"} # type: ignore @distributed_trace def get( @@ -215,7 +225,7 @@ def get( :type group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResource, or the result of cls(response) - :rtype: ~app_configuration_management_client.models.PrivateLinkResource + :rtype: ~azure.mgmt.appconfiguration.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] @@ -224,18 +234,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-05-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, config_store_name=config_store_name, group_name=group_name, + 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(request, stream=False, **kwargs) + 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]: @@ -250,5 +267,5 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}"} # type: ignore diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py index 0b78a1a58bf7..cc891aa90dd3 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py @@ -65,6 +65,10 @@ 'azure', 'azure.mgmt', ]), + include_package_data=True, + package_data={ + 'pytyped': ['py.typed'], + }, install_requires=[ 'msrest>=0.6.21', 'azure-common~=1.1', diff --git a/shared_requirements.txt b/shared_requirements.txt index d980f72352e1..bbfd9dbb2c34 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -357,6 +357,7 @@ opentelemetry-sdk<2.0.0,>=1.5.0,!=1.10a0 #override azure-mgmt-deviceupdate azure-mgmt-core>=1.3.0,<2.0.0 #override azure-mgmt-keyvault msrest>=0.6.21 #override azure-mgmt-keyvault azure-mgmt-core>=1.3.0,<2.0.0 +#override azure-mgmt-appconfiguration azure-mgmt-core>=1.3.0,<2.0.0 #override azure-mgmt-imagebuilder msrest>=0.6.21 #override azure-mgmt-imagebuilder azure-mgmt-core>=1.3.0,<2.0.0 #override azure-mgmt-sqlvirtualmachine azure-mgmt-core>=1.3.0,<2.0.0