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 16948 in Azure/azure-rest-api-specs
Merge fa8e5305acb4f7924d27db9459730a00d9298477 into 3c5135f
- Loading branch information
SDKAuto
committed
Dec 3, 2021
1 parent
e0a5c3a
commit 6fa16d5
Showing
57 changed files
with
6,279 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
sdk/externalidentities/azure-mgmt-externalidentities/CHANGELOG.md
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 |
21 changes: 21 additions & 0 deletions
21
sdk/externalidentities/azure-mgmt-externalidentities/LICENSE.txt
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2021 Microsoft | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
6 changes: 6 additions & 0 deletions
6
sdk/externalidentities/azure-mgmt-externalidentities/MANIFEST.in
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,6 @@ | ||
include _meta.json | ||
recursive-include tests *.py *.yaml | ||
include *.md | ||
include azure/__init__.py | ||
include azure/mgmt/__init__.py | ||
include LICENSE.txt |
27 changes: 27 additions & 0 deletions
27
sdk/externalidentities/azure-mgmt-externalidentities/README.md
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.6+. | ||
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-externalidentities%2FREADME.png) |
11 changes: 11 additions & 0 deletions
11
sdk/externalidentities/azure-mgmt-externalidentities/_meta.json
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,11 @@ | ||
{ | ||
"autorest": "3.4.5", | ||
"use": [ | ||
"@autorest/[email protected]", | ||
"@autorest/[email protected]" | ||
], | ||
"commit": "0e77befbf7b81b2cc40f7999ae5a46dd49b7ba5e", | ||
"repository_url": "https://github.com/Azure/azure-rest-api-specs", | ||
"autorest_command": "autorest specification/cpim/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.5", | ||
"readme": "specification/cpim/resource-manager/readme.md" | ||
} |
1 change: 1 addition & 0 deletions
1
sdk/externalidentities/azure-mgmt-externalidentities/azure/__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 @@ | ||
__path__ = __import__("pkgutil").extend_path(__path__, __name__) |
1 change: 1 addition & 0 deletions
1
sdk/externalidentities/azure-mgmt-externalidentities/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 @@ | ||
__path__ = __import__("pkgutil").extend_path(__path__, __name__) |
16 changes: 16 additions & 0 deletions
16
...xternalidentities/azure-mgmt-externalidentities/azure/mgmt/externalidentities/__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,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 ._external_identities_configuration_client import ExternalIdentitiesConfigurationClient | ||
__all__ = ['ExternalIdentitiesConfigurationClient'] | ||
|
||
try: | ||
from ._patch import patch_sdk # type: ignore | ||
patch_sdk() | ||
except ImportError: | ||
pass |
71 changes: 71 additions & 0 deletions
71
...lidentities/azure-mgmt-externalidentities/azure/mgmt/externalidentities/_configuration.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,71 @@ | ||
# 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 TYPE_CHECKING | ||
|
||
from azure.core.configuration import Configuration | ||
from azure.core.pipeline import policies | ||
from azure.mgmt.core.policies import ARMHttpLoggingPolicy | ||
|
||
from ._version import VERSION | ||
|
||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from typing import Any | ||
|
||
from azure.core.credentials import TokenCredential | ||
|
||
class ExternalIdentitiesConfigurationClientConfiguration(Configuration): | ||
"""Configuration for ExternalIdentitiesConfigurationClient. | ||
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 Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). | ||
: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(ExternalIdentitiesConfigurationClientConfiguration, 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-externalidentities/{}'.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) |
154 changes: 154 additions & 0 deletions
154
...rnalidentities/azure/mgmt/externalidentities/_external_identities_configuration_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,154 @@ | ||
# 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 TYPE_CHECKING | ||
|
||
from azure.mgmt.core import ARMPipelineClient | ||
from azure.profiles import KnownProfiles, ProfileDefinition | ||
from azure.profiles.multiapiclient import MultiApiClientMixin | ||
from msrest import Deserializer, Serializer | ||
|
||
from ._configuration import ExternalIdentitiesConfigurationClientConfiguration | ||
|
||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from typing import Any, Optional | ||
|
||
from azure.core.credentials import TokenCredential | ||
from azure.core.pipeline.transport import HttpRequest, HttpResponse | ||
|
||
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 ExternalIdentitiesConfigurationClient(MultiApiClientMixin, _SDKClient): | ||
"""External Identities Configuration Client. | ||
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 Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). | ||
:type subscription_id: str | ||
: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 | ||
: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 = '2020-05-01-preview' | ||
_PROFILE_TAG = "azure.mgmt.externalidentities.ExternalIdentitiesConfigurationClient" | ||
LATEST_PROFILE = ProfileDefinition({ | ||
_PROFILE_TAG: { | ||
None: DEFAULT_API_VERSION, | ||
'b2_ctenants': '2019-01-01-preview', | ||
}}, | ||
_PROFILE_TAG + " latest" | ||
) | ||
|
||
def __init__( | ||
self, | ||
credential, # type: "TokenCredential" | ||
subscription_id, # type: str | ||
api_version=None, # type: Optional[str] | ||
base_url=None, # type: Optional[str] | ||
profile=KnownProfiles.default, # type: KnownProfiles | ||
**kwargs # type: Any | ||
): | ||
if not base_url: | ||
base_url = 'https://management.azure.com' | ||
self._config = ExternalIdentitiesConfigurationClientConfiguration(credential, subscription_id, **kwargs) | ||
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
super(ExternalIdentitiesConfigurationClient, 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: | ||
* 2019-01-01-preview: :mod:`v2019_01_01_preview.models<azure.mgmt.externalidentities.v2019_01_01_preview.models>` | ||
* 2020-05-01-preview: :mod:`v2020_05_01_preview.models<azure.mgmt.externalidentities.v2020_05_01_preview.models>` | ||
""" | ||
if api_version == '2019-01-01-preview': | ||
from .v2019_01_01_preview import models | ||
return models | ||
elif api_version == '2020-05-01-preview': | ||
from .v2020_05_01_preview import models | ||
return models | ||
raise ValueError("API version {} is not available".format(api_version)) | ||
|
||
@property | ||
def b2_ctenants(self): | ||
"""Instance depends on the API version: | ||
* 2019-01-01-preview: :class:`B2CTenantsOperations<azure.mgmt.externalidentities.v2019_01_01_preview.operations.B2CTenantsOperations>` | ||
""" | ||
api_version = self._get_api_version('b2_ctenants') | ||
if api_version == '2019-01-01-preview': | ||
from .v2019_01_01_preview.operations import B2CTenantsOperations as OperationClass | ||
else: | ||
raise ValueError("API version {} does not have operation group 'b2_ctenants'".format(api_version)) | ||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) | ||
|
||
@property | ||
def guest_usages(self): | ||
"""Instance depends on the API version: | ||
* 2020-05-01-preview: :class:`GuestUsagesOperations<azure.mgmt.externalidentities.v2020_05_01_preview.operations.GuestUsagesOperations>` | ||
""" | ||
api_version = self._get_api_version('guest_usages') | ||
if api_version == '2020-05-01-preview': | ||
from .v2020_05_01_preview.operations import GuestUsagesOperations as OperationClass | ||
else: | ||
raise ValueError("API version {} does not have operation group 'guest_usages'".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: | ||
* 2019-01-01-preview: :class:`Operations<azure.mgmt.externalidentities.v2019_01_01_preview.operations.Operations>` | ||
* 2020-05-01-preview: :class:`Operations<azure.mgmt.externalidentities.v2020_05_01_preview.operations.Operations>` | ||
""" | ||
api_version = self._get_api_version('operations') | ||
if api_version == '2019-01-01-preview': | ||
from .v2019_01_01_preview.operations import Operations as OperationClass | ||
elif api_version == '2020-05-01-preview': | ||
from .v2020_05_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) |
8 changes: 8 additions & 0 deletions
8
...xternalidentities/azure-mgmt-externalidentities/azure/mgmt/externalidentities/_version.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,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" |
10 changes: 10 additions & 0 deletions
10
...nalidentities/azure-mgmt-externalidentities/azure/mgmt/externalidentities/aio/__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,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 ._external_identities_configuration_client import ExternalIdentitiesConfigurationClient | ||
__all__ = ['ExternalIdentitiesConfigurationClient'] |
Oops, something went wrong.