Skip to content

[AutoPR track2_azure-mgmt-appconfiguration] update path #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions sdk/appconfiguration/azure-mgmt-appconfiguration/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"autorest": "3.8.4",
"use": [
"@autorest/python@5.13.0",
"@autorest/modelerfour@4.19.3"
"@autorest/python@6.1.4",
"@autorest/modelerfour@4.23.5"
],
"commit": "08894fa8d66cb44dc62a73f7a09530f905985fa3",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"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",
"commit": "65909f9e91a64162f394f257958c172a2c5b4de5",
"repository_url": "https://github.com/openapi-env-test/azure-rest-api-specs",
"autorest_command": "autorest specification/appconfiguration/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.4 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
"readme": "specification/appconfiguration/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
# --------------------------------------------------------------------------

from ._app_configuration_management_client import AppConfigurationManagementClient
__all__ = ['AppConfigurationManagementClient']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass

from ._version import VERSION

__version__ = VERSION
__all__ = ['AppConfigurationManagementClient']

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
Original file line number Diff line number Diff line change
@@ -1,112 +1,200 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin

from . import models
from ._configuration import AppConfigurationManagementClientConfiguration
from .operations import ConfigurationStoresOperations, KeyValuesOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations
from ._serialization import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential

class AppConfigurationManagementClient:
class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Will be removed in final version of multiapi azure-core based client
"""
pass

class AppConfigurationManagementClient(MultiApiClientMixin, _SDKClient):
"""AppConfigurationManagementClient.

:ivar configuration_stores: ConfigurationStoresOperations operations
:vartype configuration_stores:
azure.mgmt.appconfiguration.operations.ConfigurationStoresOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.appconfiguration.operations.Operations
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
:vartype private_endpoint_connections:
azure.mgmt.appconfiguration.operations.PrivateEndpointConnectionsOperations
:ivar private_link_resources: PrivateLinkResourcesOperations operations
:vartype private_link_resources:
azure.mgmt.appconfiguration.operations.PrivateLinkResourcesOperations
:ivar key_values: KeyValuesOperations operations
:vartype key_values: azure.mgmt.appconfiguration.operations.KeyValuesOperations
:param credential: Credential needed for the client to connect to Azure.
This ready contains multiple API versions, to help you deal with all of the Azure clouds
(Azure Stack, Azure Government, Azure China, etc.).
By default, it uses the latest API version available on public Azure.
For production, you should stick to a particular api-version and/or profile.
The profile sets a mapping between an operation group and its API version.
The api-version parameter sets the default API version if the operation
group is not described in the profile.

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Microsoft Azure subscription ID.
:param subscription_id: The Microsoft Azure subscription ID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
: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.
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2022-05-01'
_PROFILE_TAG = "azure.mgmt.appconfiguration.AppConfigurationManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
'replicas': '2022-03-01-preview',
}},
_PROFILE_TAG + " latest"
)

def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
api_version=None, # type: Optional[str]
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AppConfigurationManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
self._config = AppConfigurationManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(AppConfigurationManagementClient, self).__init__(
api_version=api_version,
profile=profile
)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.configuration_stores = ConfigurationStoresOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
self.key_values = KeyValuesOperations(self._client, self._config, self._serialize, self._deserialize)
@classmethod
def _models_dict(cls, api_version):
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}

@classmethod
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
"""Runs the network request through the client's chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client._send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart

:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.HttpResponse
* 2022-03-01-preview: :mod:`v2022_03_01_preview.models<azure.mgmt.appconfiguration.v2022_03_01_preview.models>`
* 2022-05-01: :mod:`v2022_05_01.models<azure.mgmt.appconfiguration.v2022_05_01.models>`
"""

request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)
if api_version == '2022-03-01-preview':
from .v2022_03_01_preview import models
return models
elif api_version == '2022-05-01':
from .v2022_05_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
def configuration_stores(self):
"""Instance depends on the API version:

* 2022-03-01-preview: :class:`ConfigurationStoresOperations<azure.mgmt.appconfiguration.v2022_03_01_preview.operations.ConfigurationStoresOperations>`
* 2022-05-01: :class:`ConfigurationStoresOperations<azure.mgmt.appconfiguration.v2022_05_01.operations.ConfigurationStoresOperations>`
"""
api_version = self._get_api_version('configuration_stores')
if api_version == '2022-03-01-preview':
from .v2022_03_01_preview.operations import ConfigurationStoresOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import ConfigurationStoresOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'configuration_stores'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def key_values(self):
"""Instance depends on the API version:

* 2022-03-01-preview: :class:`KeyValuesOperations<azure.mgmt.appconfiguration.v2022_03_01_preview.operations.KeyValuesOperations>`
* 2022-05-01: :class:`KeyValuesOperations<azure.mgmt.appconfiguration.v2022_05_01.operations.KeyValuesOperations>`
"""
api_version = self._get_api_version('key_values')
if api_version == '2022-03-01-preview':
from .v2022_03_01_preview.operations import KeyValuesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import KeyValuesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'key_values'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def operations(self):
"""Instance depends on the API version:

* 2022-03-01-preview: :class:`Operations<azure.mgmt.appconfiguration.v2022_03_01_preview.operations.Operations>`
* 2022-05-01: :class:`Operations<azure.mgmt.appconfiguration.v2022_05_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2022-03-01-preview':
from .v2022_03_01_preview.operations import Operations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def private_endpoint_connections(self):
"""Instance depends on the API version:

* 2022-03-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.appconfiguration.v2022_03_01_preview.operations.PrivateEndpointConnectionsOperations>`
* 2022-05-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.appconfiguration.v2022_05_01.operations.PrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2022-03-01-preview':
from .v2022_03_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import PrivateEndpointConnectionsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def private_link_resources(self):
"""Instance depends on the API version:

* 2022-03-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.appconfiguration.v2022_03_01_preview.operations.PrivateLinkResourcesOperations>`
* 2022-05-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.appconfiguration.v2022_05_01.operations.PrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2022-03-01-preview':
from .v2022_03_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import PrivateLinkResourcesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def replicas(self):
"""Instance depends on the API version:

* 2022-03-01-preview: :class:`ReplicasOperations<azure.mgmt.appconfiguration.v2022_03_01_preview.operations.ReplicasOperations>`
"""
api_version = self._get_api_version('replicas')
if api_version == '2022-03-01-preview':
from .v2022_03_01_preview.operations import ReplicasOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'replicas'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

def close(self):
# type: () -> None
self._client.close()

def __enter__(self):
# type: () -> AppConfigurationManagementClient
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -18,41 +20,35 @@
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


class AppConfigurationManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
class AppConfigurationManagementClientConfiguration(Configuration):
"""Configuration for AppConfigurationManagementClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Microsoft Azure subscription ID.
:param subscription_id: The Microsoft Azure subscription ID. Required.
: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__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
super(AppConfigurationManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-05-01") # type: str

**kwargs # type: Any
):
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(AppConfigurationManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-appconfiguration/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'azure-mgmt-appconfiguration/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down
Loading