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.
CodeGen from PR 13172 in Azure/azure-rest-api-specs
Merge db39b2f5bb9ad5304f131fdfe0558047868e077b into be2b34f
- Loading branch information
SDKAuto
committed
Mar 1, 2021
1 parent
79d9f53
commit 29b875e
Showing
58 changed files
with
10,726 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Release History | ||
|
||
## 0.1.0 (1970-01-01) | ||
|
||
* Initial Release |
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,5 @@ | ||
recursive-include tests *.py *.yaml | ||
include *.md | ||
include azure/__init__.py | ||
include azure/mgmt/__init__.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,27 @@ | ||
# Microsoft Azure SDK for Python | ||
|
||
This is the Microsoft Azure MyService Management Client Library. | ||
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. | ||
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). | ||
|
||
|
||
# Usage | ||
|
||
|
||
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) | ||
|
||
|
||
|
||
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) | ||
Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. | ||
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) | ||
|
||
|
||
# Provide Feedback | ||
|
||
If you encounter any bugs or have suggestions, please file an issue in the | ||
[Issues](https://github.com/Azure/azure-sdk-for-python/issues) | ||
section of the project. | ||
|
||
|
||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-adp%2FREADME.png) |
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 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
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 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
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,16 @@ | ||
# 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 ._adp_management_client import AdpManagementClient | ||
__all__ = ['AdpManagementClient'] | ||
|
||
try: | ||
from ._patch import patch_sdk # type: ignore | ||
patch_sdk() | ||
except ImportError: | ||
pass |
149 changes: 149 additions & 0 deletions
149
sdk/adp/azure-mgmt-adp/azure/mgmt/adp/_adp_management_client.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,149 @@ | ||
# 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 ARMPipelineClient | ||
from msrest import Serializer, Deserializer | ||
|
||
from azure.profiles import KnownProfiles, ProfileDefinition | ||
from azure.profiles.multiapiclient import MultiApiClientMixin | ||
from ._configuration import AdpManagementClientConfiguration | ||
|
||
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 AdpManagementClient(MultiApiClientMixin, _SDKClient): | ||
"""Microsoft Autonomous Development Platform. | ||
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.TokenCredential | ||
: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 = '2021-02-01-preview' | ||
_PROFILE_TAG = "azure.mgmt.adp.AdpManagementClient" | ||
LATEST_PROFILE = ProfileDefinition({ | ||
_PROFILE_TAG: { | ||
None: DEFAULT_API_VERSION, | ||
}}, | ||
_PROFILE_TAG + " latest" | ||
) | ||
|
||
def __init__( | ||
self, | ||
credential, # type: "TokenCredential" | ||
subscription_id, # type: str | ||
api_version=None, | ||
base_url=None, | ||
profile=KnownProfiles.default, | ||
**kwargs # type: Any | ||
): | ||
if not base_url: | ||
base_url = 'https://management.azure.com' | ||
self._config = AdpManagementClientConfiguration(credential, subscription_id, **kwargs) | ||
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
super(AdpManagementClient, self).__init__( | ||
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: | ||
* 2020-07-01-preview: :mod:`v2020_07_01_preview.models<azure.mgmt.adp.v2020_07_01_preview.models>` | ||
* 2021-02-01-preview: :mod:`v2021_02_01_preview.models<azure.mgmt.adp.v2021_02_01_preview.models>` | ||
""" | ||
if api_version == '2020-07-01-preview': | ||
from .v2020_07_01_preview import models | ||
return models | ||
elif api_version == '2021-02-01-preview': | ||
from .v2021_02_01_preview import models | ||
return models | ||
raise ValueError("API version {} is not available".format(api_version)) | ||
|
||
@property | ||
def accounts(self): | ||
"""Instance depends on the API version: | ||
* 2020-07-01-preview: :class:`AccountsOperations<azure.mgmt.adp.v2020_07_01_preview.operations.AccountsOperations>` | ||
* 2021-02-01-preview: :class:`AccountsOperations<azure.mgmt.adp.v2021_02_01_preview.operations.AccountsOperations>` | ||
""" | ||
api_version = self._get_api_version('accounts') | ||
if api_version == '2020-07-01-preview': | ||
from .v2020_07_01_preview.operations import AccountsOperations as OperationClass | ||
elif api_version == '2021-02-01-preview': | ||
from .v2021_02_01_preview.operations import AccountsOperations as OperationClass | ||
else: | ||
raise ValueError("API version {} does not have operation group 'accounts'".format(api_version)) | ||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) | ||
|
||
@property | ||
def data_pools(self): | ||
"""Instance depends on the API version: | ||
* 2020-07-01-preview: :class:`DataPoolsOperations<azure.mgmt.adp.v2020_07_01_preview.operations.DataPoolsOperations>` | ||
* 2021-02-01-preview: :class:`DataPoolsOperations<azure.mgmt.adp.v2021_02_01_preview.operations.DataPoolsOperations>` | ||
""" | ||
api_version = self._get_api_version('data_pools') | ||
if api_version == '2020-07-01-preview': | ||
from .v2020_07_01_preview.operations import DataPoolsOperations as OperationClass | ||
elif api_version == '2021-02-01-preview': | ||
from .v2021_02_01_preview.operations import DataPoolsOperations as OperationClass | ||
else: | ||
raise ValueError("API version {} does not have operation group 'data_pools'".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: | ||
* 2020-07-01-preview: :class:`Operations<azure.mgmt.adp.v2020_07_01_preview.operations.Operations>` | ||
* 2021-02-01-preview: :class:`Operations<azure.mgmt.adp.v2021_02_01_preview.operations.Operations>` | ||
""" | ||
api_version = self._get_api_version('operations') | ||
if api_version == '2020-07-01-preview': | ||
from .v2020_07_01_preview.operations import Operations as OperationClass | ||
elif api_version == '2021-02-01-preview': | ||
from .v2021_02_01_preview.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))) | ||
|
||
def close(self): | ||
self._client.close() | ||
def __enter__(self): | ||
self._client.__enter__() | ||
return self | ||
def __exit__(self, *exc_details): | ||
self._client.__exit__(*exc_details) |
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,66 @@ | ||
# 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 azure.mgmt.core.policies import ARMHttpLoggingPolicy | ||
|
||
from ._version import VERSION | ||
|
||
|
||
class AdpManagementClientConfiguration(Configuration): | ||
"""Configuration for AdpManagementClient. | ||
Note that all parameters used to create this instance are saved as instance | ||
attributes. | ||
:param credential: Credential needed for the client to connect to Azure. | ||
:type credential: ~azure.core.credentials.TokenCredential | ||
:param subscription_id: The ID of the target subscription. | ||
:type subscription_id: str | ||
""" | ||
|
||
def __init__( | ||
self, | ||
credential, # type: "TokenCredential" | ||
subscription_id, # 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(AdpManagementClientConfiguration, self).__init__(**kwargs) | ||
|
||
self.credential = credential | ||
self.subscription_id = subscription_id | ||
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) | ||
kwargs.setdefault('sdk_moniker', 'azure-mgmt-adp/{}'.format(VERSION)) | ||
self._configure(**kwargs) | ||
|
||
def _configure( | ||
self, | ||
**kwargs # type: Any | ||
): | ||
# type: (...) -> None | ||
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) | ||
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) | ||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) | ||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) | ||
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) | ||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) | ||
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) | ||
self.authentication_policy = kwargs.get('authentication_policy') | ||
if self.credential and not self.authentication_policy: | ||
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
|
||
VERSION = "0.1.0" |
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,10 @@ | ||
# 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 ._adp_management_client import AdpManagementClient | ||
__all__ = ['AdpManagementClient'] |
Oops, something went wrong.