forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generated from f9fc2d73ad70827428065857e5ef8ff83e82c019
- Loading branch information
SDK Automation
committed
Sep 18, 2020
1 parent
27e4203
commit 67969ee
Showing
564 changed files
with
91,363 additions
and
7,883 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/aio/_configuration_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
from typing import Any | ||
|
||
from azure.core.configuration import Configuration | ||
from azure.core.pipeline import policies | ||
|
||
from .._version import VERSION | ||
|
||
|
||
class FeatureClientConfiguration(Configuration): | ||
"""Configuration for FeatureClient. | ||
Note that all parameters used to create this instance are saved as instance | ||
attributes. | ||
:param credential: Credential needed for the client to connect to Azure. | ||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential | ||
:param subscription_id: The ID of the target subscription. | ||
:type subscription_id: str | ||
""" | ||
|
||
def __init__( | ||
self, | ||
credential, # type: "AsyncTokenCredential" | ||
subscription_id, # type: str | ||
**kwargs # type: Any | ||
) -> None: | ||
# 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(FeatureClientConfiguration, self).__init__(**kwargs) | ||
|
||
self.credential = credential | ||
self.subscription_id = subscription_id | ||
self.credential_scopes = ['https://management.azure.com/.default'] | ||
self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) | ||
kwargs.setdefault('sdk_moniker', 'azure-mgmt-resource/{}'.format(VERSION)) | ||
self._configure(**kwargs) | ||
|
||
def _configure( | ||
self, | ||
**kwargs: Any | ||
) -> None: | ||
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) | ||
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) | ||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) | ||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) | ||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) | ||
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) | ||
self.authentication_policy = kwargs.get('authentication_policy') | ||
if self.credential and not self.authentication_policy: | ||
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) |
112 changes: 112 additions & 0 deletions
112
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/aio/_feature_client_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.mgmt.core import AsyncARMPipelineClient | ||
from msrest import Serializer, Deserializer | ||
|
||
from azure.profiles import KnownProfiles, ProfileDefinition | ||
from azure.profiles.multiapiclient import MultiApiClientMixin | ||
from ._configuration_async import FeatureClientConfiguration | ||
from ._operations_mixin_async import FeatureClientOperationsMixin | ||
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 FeatureClient(FeatureClientOperationsMixin, MultiApiClientMixin, _SDKClient): | ||
"""Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control feature exposure to users. Resource providers typically use this mechanism to provide public/private preview for new features prior to making them generally available. Users need to explicitly register for AFEC features to get access to such functionality. | ||
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. | ||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential | ||
:param subscription_id: The ID of the target subscription. | ||
:type subscription_id: str | ||
:param str api_version: API version to use if no profile is provided, or if | ||
missing in profile. | ||
:param str base_url: Service URL | ||
: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 = '2015-12-01' | ||
_PROFILE_TAG = "azure.mgmt.resource.FeatureClient" | ||
LATEST_PROFILE = ProfileDefinition({ | ||
_PROFILE_TAG: { | ||
None: DEFAULT_API_VERSION, | ||
}}, | ||
_PROFILE_TAG + " latest" | ||
) | ||
|
||
def __init__( | ||
self, | ||
credential, # type: "AsyncTokenCredential" | ||
subscription_id, # type: str | ||
api_version=None, | ||
base_url=None, | ||
profile=KnownProfiles.default, | ||
**kwargs # type: Any | ||
) -> None: | ||
if not base_url: | ||
base_url = 'https://management.azure.com' | ||
self._config = FeatureClientConfiguration(credential, subscription_id, **kwargs) | ||
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
super(FeatureClient, self).__init__( | ||
credential, | ||
self._config, | ||
api_version=api_version, | ||
profile=profile | ||
) | ||
|
||
@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: | ||
* 2015-12-01: :mod:`v2015_12_01.models<azure.mgmt.resource.v2015_12_01.models>` | ||
""" | ||
if api_version == '2015-12-01': | ||
from ..v2015_12_01 import models | ||
return models | ||
raise NotImplementedError("APIVersion {} is not available".format(api_version)) | ||
|
||
@property | ||
def features(self): | ||
"""Instance depends on the API version: | ||
* 2015-12-01: :class:`FeaturesOperations<azure.mgmt.resource.v2015_12_01.aio.operations_async.FeaturesOperations>` | ||
""" | ||
api_version = self._get_api_version('features') | ||
if api_version == '2015-12-01': | ||
from ..v2015_12_01.aio.operations_async import FeaturesOperations as OperationClass | ||
else: | ||
raise NotImplementedError("APIVersion {} is not available".format(api_version)) | ||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) | ||
|
||
async def close(self): | ||
await self._client.close() | ||
async def __aenter__(self): | ||
await self._client.__aenter__() | ||
return self | ||
async def __aexit__(self, *exc_details): | ||
await self._client.__aexit__(*exc_details) |
45 changes: 45 additions & 0 deletions
45
...resources/azure-mgmt-resource/azure/mgmt/resource/features/aio/_operations_mixin_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
from msrest import Serializer, Deserializer | ||
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar | ||
import warnings | ||
|
||
from azure.core.async_paging import AsyncItemPaged, AsyncList | ||
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error | ||
from azure.core.pipeline import PipelineResponse | ||
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest | ||
from azure.mgmt.core.exceptions import ARMErrorFormat | ||
|
||
|
||
class FeatureClientOperationsMixin(object): | ||
|
||
def list_operations( | ||
self, | ||
**kwargs | ||
) -> AsyncItemPaged["models.OperationListResult"]: | ||
"""Lists all of the available Microsoft.Features REST API operations. | ||
:keyword callable cls: A custom type or function that will be passed the direct response | ||
:return: OperationListResult, or the result of cls(response) | ||
:rtype: ~azure.mgmt.resource.features.v2015_12_01.models.OperationListResult | ||
:raises: ~azure.core.exceptions.HttpResponseError | ||
""" | ||
api_version = self._get_api_version('list_operations') | ||
if api_version == '2015-12-01': | ||
from ..v2015_12_01.aio.operations_async import FeatureClientOperationsMixin as OperationClass | ||
else: | ||
raise NotImplementedError("APIVersion {} is not available".format(api_version)) | ||
mixin_instance = OperationClass() | ||
mixin_instance._client = self._client | ||
mixin_instance._config = self._config | ||
mixin_instance._serialize = Serializer(self._models_dict(api_version)) | ||
mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) | ||
return mixin_instance.list_operations(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.