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 11839 in Azure/azure-rest-api-specs
Merge 580aa447663236d8fa8fcbf93c4936de8df7f95b into 0b3f617
- Loading branch information
SDKAuto
committed
Dec 8, 2020
1 parent
b85bb25
commit 3c270b8
Showing
20 changed files
with
2,890 additions
and
339 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
67 changes: 67 additions & 0 deletions
67
sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_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,67 @@ | ||
# 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, 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 azure.core.credentials_async import AsyncTokenCredential | ||
|
||
|
||
class ResourceMoverServiceAPIConfiguration(Configuration): | ||
"""Configuration for ResourceMoverServiceAPI. | ||
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 Subscription ID. | ||
:type subscription_id: str | ||
""" | ||
|
||
def __init__( | ||
self, | ||
credential: "AsyncTokenCredential", | ||
subscription_id: str, | ||
**kwargs: Any | ||
) -> 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(ResourceMoverServiceAPIConfiguration, self).__init__(**kwargs) | ||
|
||
self.credential = credential | ||
self.subscription_id = subscription_id | ||
self.api_version = "2019-10-01-preview" | ||
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) | ||
kwargs.setdefault('sdk_moniker', 'mgmt-resourcemover/{}'.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.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**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) |
78 changes: 78 additions & 0 deletions
78
...over/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/_resource_mover_service_api.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,78 @@ | ||
# 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, Optional, TYPE_CHECKING | ||
|
||
from azure.mgmt.core import AsyncARMPipelineClient | ||
from msrest import Deserializer, Serializer | ||
|
||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from azure.core.credentials_async import AsyncTokenCredential | ||
|
||
from ._configuration import ResourceMoverServiceAPIConfiguration | ||
from .operations import MoveCollectionsOperations | ||
from .operations import MoveResourcesOperations | ||
from .operations import UnresolvedDependenciesOperations | ||
from .operations import OperationsDiscoveryOperations | ||
from .. import models | ||
|
||
|
||
class ResourceMoverServiceAPI(object): | ||
"""A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region. | ||
:ivar move_collections: MoveCollectionsOperations operations | ||
:vartype move_collections: resource_mover_service_api.aio.operations.MoveCollectionsOperations | ||
:ivar move_resources: MoveResourcesOperations operations | ||
:vartype move_resources: resource_mover_service_api.aio.operations.MoveResourcesOperations | ||
:ivar unresolved_dependencies: UnresolvedDependenciesOperations operations | ||
:vartype unresolved_dependencies: resource_mover_service_api.aio.operations.UnresolvedDependenciesOperations | ||
:ivar operations_discovery: OperationsDiscoveryOperations operations | ||
:vartype operations_discovery: resource_mover_service_api.aio.operations.OperationsDiscoveryOperations | ||
:param credential: Credential needed for the client to connect to Azure. | ||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential | ||
:param subscription_id: The Subscription ID. | ||
:type subscription_id: str | ||
:param str base_url: Service URL | ||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. | ||
""" | ||
|
||
def __init__( | ||
self, | ||
credential: "AsyncTokenCredential", | ||
subscription_id: str, | ||
base_url: Optional[str] = None, | ||
**kwargs: Any | ||
) -> None: | ||
if not base_url: | ||
base_url = 'https://management.azure.com' | ||
self._config = ResourceMoverServiceAPIConfiguration(credential, subscription_id, **kwargs) | ||
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) | ||
|
||
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.move_collections = MoveCollectionsOperations( | ||
self._client, self._config, self._serialize, self._deserialize) | ||
self.move_resources = MoveResourcesOperations( | ||
self._client, self._config, self._serialize, self._deserialize) | ||
self.unresolved_dependencies = UnresolvedDependenciesOperations( | ||
self._client, self._config, self._serialize, self._deserialize) | ||
self.operations_discovery = OperationsDiscoveryOperations( | ||
self._client, self._config, self._serialize, self._deserialize) | ||
|
||
async def close(self) -> None: | ||
await self._client.close() | ||
|
||
async def __aenter__(self) -> "ResourceMoverServiceAPI": | ||
await self._client.__aenter__() | ||
return self | ||
|
||
async def __aexit__(self, *exc_details) -> None: | ||
await self._client.__aexit__(*exc_details) |
19 changes: 19 additions & 0 deletions
19
...esourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/aio/operations/__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,19 @@ | ||
# 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 ._move_collections_operations import MoveCollectionsOperations | ||
from ._move_resources_operations import MoveResourcesOperations | ||
from ._unresolved_dependencies_operations import UnresolvedDependenciesOperations | ||
from ._operations_discovery_operations import OperationsDiscoveryOperations | ||
|
||
__all__ = [ | ||
'MoveCollectionsOperations', | ||
'MoveResourcesOperations', | ||
'UnresolvedDependenciesOperations', | ||
'OperationsDiscoveryOperations', | ||
] |
Oops, something went wrong.