[AutoRelease] t2-databox-2024-10-30-61405(can only be merged by SDK owner) (#38182)
* code and test * update-testcase --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <v-chenjiang@microsoft.com>
This commit is contained in:
Родитель
5886bccb14
Коммит
fa77d33a81
|
@ -1,5 +1,11 @@
|
|||
# Release History
|
||||
|
||||
## 3.0.0 (2024-10-30)
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- This package now only targets the latest Api-Version available on Azure and removes APIs of other Api-Version. After this change, the package can have much smaller size. If your application requires a specific and non-latest Api-Version, it's recommended to pin this package to the previous released version; If your application always only use latest Api-Version, please ingore this change.
|
||||
|
||||
## 2.0.0 (2023-05-22)
|
||||
|
||||
### Features Added
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Microsoft Azure SDK for Python
|
||||
|
||||
This is the Microsoft Azure Data Box Management Client Library.
|
||||
This package has been tested with Python 3.7+.
|
||||
This package has been tested with Python 3.8+.
|
||||
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
|
||||
|
||||
## _Disclaimer_
|
||||
|
@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
|
|||
|
||||
### Prerequisites
|
||||
|
||||
- Python 3.7+ is required to use this package.
|
||||
- Python 3.8+ is required to use this package.
|
||||
- [Azure subscription](https://azure.microsoft.com/free/)
|
||||
|
||||
### Install the package
|
||||
|
@ -59,6 +59,3 @@ Code samples for this package can be found at:
|
|||
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-databox%2FREADME.png)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"commit": "6e70667577cfb7bc194785683ca591b95abd524c",
|
||||
"commit": "2776cb32cd6ca9ea953a13ae26c954b989e83367",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
|
||||
"autorest": "3.9.2",
|
||||
"autorest": "3.10.2",
|
||||
"use": [
|
||||
"@autorest/python@6.4.8",
|
||||
"@autorest/modelerfour@4.24.3"
|
||||
"@autorest/python@6.19.0",
|
||||
"@autorest/modelerfour@4.27.0"
|
||||
],
|
||||
"autorest_command": "autorest specification/databox/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
|
||||
"autorest_command": "autorest specification/databox/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2022-12 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
|
||||
"readme": "specification/databox/resource-manager/readme.md"
|
||||
}
|
|
@ -7,14 +7,20 @@
|
|||
# --------------------------------------------------------------------------
|
||||
|
||||
from ._data_box_management_client import DataBoxManagementClient
|
||||
__all__ = ['DataBoxManagementClient']
|
||||
|
||||
try:
|
||||
from ._patch import patch_sdk # type: ignore
|
||||
patch_sdk()
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from ._version import VERSION
|
||||
|
||||
__version__ = VERSION
|
||||
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"DataBoxManagementClient",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
||||
|
|
|
@ -1,16 +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
|
||||
from azure.core.pipeline import policies
|
||||
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
|
||||
|
||||
|
@ -20,7 +17,8 @@ if TYPE_CHECKING:
|
|||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
class DataBoxManagementClientConfiguration(Configuration):
|
||||
|
||||
class DataBoxManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
|
||||
"""Configuration for DataBoxManagementClient.
|
||||
|
||||
Note that all parameters used to create this instance are saved as instance
|
||||
|
@ -30,38 +28,38 @@ class DataBoxManagementClientConfiguration(Configuration):
|
|||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2022-12-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
|
||||
):
|
||||
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
|
||||
api_version: str = kwargs.pop("api_version", "2022-12-01")
|
||||
|
||||
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(DataBoxManagementClientConfiguration, 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-databox/{}'.format(VERSION))
|
||||
self.api_version = api_version
|
||||
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
|
||||
kwargs.setdefault("sdk_moniker", "mgmt-databox/{}".format(VERSION))
|
||||
self.polling_interval = kwargs.get("polling_interval", 30)
|
||||
self._configure(**kwargs)
|
||||
|
||||
def _configure(
|
||||
self,
|
||||
**kwargs: Any
|
||||
):
|
||||
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')
|
||||
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.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
|
||||
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
|
||||
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
|
||||
self.authentication_policy = kwargs.get("authentication_policy")
|
||||
if self.credential and not self.authentication_policy:
|
||||
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
|
||||
self.authentication_policy = ARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
||||
|
|
|
@ -1,288 +1,120 @@
|
|||
# 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, Optional, TYPE_CHECKING
|
||||
from copy import deepcopy
|
||||
from typing import Any, TYPE_CHECKING
|
||||
from typing_extensions import Self
|
||||
|
||||
from azure.core.pipeline import policies
|
||||
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 azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
|
||||
|
||||
from . import models as _models
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
from ._operations_mixin import DataBoxManagementClientOperationsMixin
|
||||
from ._serialization import Deserializer, Serializer
|
||||
from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
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 DataBoxManagementClient(DataBoxManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient):
|
||||
class DataBoxManagementClient(
|
||||
DataBoxManagementClientOperationsMixin
|
||||
): # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DataBox 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.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.databox.operations.Operations
|
||||
:ivar jobs: JobsOperations operations
|
||||
:vartype jobs: azure.mgmt.databox.operations.JobsOperations
|
||||
:ivar service: ServiceOperations operations
|
||||
:vartype service: azure.mgmt.databox.operations.ServiceOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
: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
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
: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.
|
||||
:keyword api_version: Api Version. Default value is "2022-12-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.
|
||||
"""
|
||||
|
||||
DEFAULT_API_VERSION = '2022-12-01'
|
||||
_PROFILE_TAG = "azure.mgmt.databox.DataBoxManagementClient"
|
||||
LATEST_PROFILE = ProfileDefinition({
|
||||
_PROFILE_TAG: {
|
||||
None: DEFAULT_API_VERSION,
|
||||
}},
|
||||
_PROFILE_TAG + " latest"
|
||||
)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "TokenCredential",
|
||||
subscription_id: str,
|
||||
api_version: Optional[str]=None,
|
||||
base_url: str = "https://management.azure.com",
|
||||
profile: KnownProfiles=KnownProfiles.default,
|
||||
**kwargs: Any
|
||||
):
|
||||
self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs)
|
||||
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
|
||||
super(DataBoxManagementClient, self).__init__(
|
||||
api_version=api_version,
|
||||
profile=profile
|
||||
) -> None:
|
||||
self._config = DataBoxManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
_policies = kwargs.pop("policies", None)
|
||||
if _policies is None:
|
||||
_policies = [
|
||||
policies.RequestIdPolicy(**kwargs),
|
||||
self._config.headers_policy,
|
||||
self._config.user_agent_policy,
|
||||
self._config.proxy_policy,
|
||||
policies.ContentDecodePolicy(**kwargs),
|
||||
ARMAutoResourceProviderRegistrationPolicy(),
|
||||
self._config.redirect_policy,
|
||||
self._config.retry_policy,
|
||||
self._config.authentication_policy,
|
||||
self._config.custom_hook_policy,
|
||||
self._config.logging_policy,
|
||||
policies.DistributedTracingPolicy(**kwargs),
|
||||
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
|
||||
self._config.http_logging_policy,
|
||||
]
|
||||
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def _models_dict(cls, api_version):
|
||||
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
|
||||
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.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
@classmethod
|
||||
def models(cls, api_version=DEFAULT_API_VERSION):
|
||||
"""Module depends on the API version:
|
||||
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
|
||||
"""Runs the network request through the client's chained policies.
|
||||
|
||||
* 2018-01-01: :mod:`v2018_01_01.models<azure.mgmt.databox.v2018_01_01.models>`
|
||||
* 2019-09-01: :mod:`v2019_09_01.models<azure.mgmt.databox.v2019_09_01.models>`
|
||||
* 2020-04-01: :mod:`v2020_04_01.models<azure.mgmt.databox.v2020_04_01.models>`
|
||||
* 2020-11-01: :mod:`v2020_11_01.models<azure.mgmt.databox.v2020_11_01.models>`
|
||||
* 2021-03-01: :mod:`v2021_03_01.models<azure.mgmt.databox.v2021_03_01.models>`
|
||||
* 2021-05-01: :mod:`v2021_05_01.models<azure.mgmt.databox.v2021_05_01.models>`
|
||||
* 2021-08-01-preview: :mod:`v2021_08_01_preview.models<azure.mgmt.databox.v2021_08_01_preview.models>`
|
||||
* 2021-12-01: :mod:`v2021_12_01.models<azure.mgmt.databox.v2021_12_01.models>`
|
||||
* 2022-02-01: :mod:`v2022_02_01.models<azure.mgmt.databox.v2022_02_01.models>`
|
||||
* 2022-09-01: :mod:`v2022_09_01.models<azure.mgmt.databox.v2022_09_01.models>`
|
||||
* 2022-10-01: :mod:`v2022_10_01.models<azure.mgmt.databox.v2022_10_01.models>`
|
||||
* 2022-12-01: :mod:`v2022_12_01.models<azure.mgmt.databox.v2022_12_01.models>`
|
||||
>>> 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/dpcodegen/python/send_request
|
||||
|
||||
: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
|
||||
"""
|
||||
if api_version == '2018-01-01':
|
||||
from .v2018_01_01 import models
|
||||
return models
|
||||
elif api_version == '2019-09-01':
|
||||
from .v2019_09_01 import models
|
||||
return models
|
||||
elif api_version == '2020-04-01':
|
||||
from .v2020_04_01 import models
|
||||
return models
|
||||
elif api_version == '2020-11-01':
|
||||
from .v2020_11_01 import models
|
||||
return models
|
||||
elif api_version == '2021-03-01':
|
||||
from .v2021_03_01 import models
|
||||
return models
|
||||
elif api_version == '2021-05-01':
|
||||
from .v2021_05_01 import models
|
||||
return models
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from .v2021_08_01_preview import models
|
||||
return models
|
||||
elif api_version == '2021-12-01':
|
||||
from .v2021_12_01 import models
|
||||
return models
|
||||
elif api_version == '2022-02-01':
|
||||
from .v2022_02_01 import models
|
||||
return models
|
||||
elif api_version == '2022-09-01':
|
||||
from .v2022_09_01 import models
|
||||
return models
|
||||
elif api_version == '2022-10-01':
|
||||
from .v2022_10_01 import models
|
||||
return models
|
||||
elif api_version == '2022-12-01':
|
||||
from .v2022_12_01 import models
|
||||
return models
|
||||
raise ValueError("API version {} is not available".format(api_version))
|
||||
|
||||
@property
|
||||
def jobs(self):
|
||||
"""Instance depends on the API version:
|
||||
request_copy = deepcopy(request)
|
||||
request_copy.url = self._client.format_url(request_copy.url)
|
||||
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
|
||||
|
||||
* 2018-01-01: :class:`JobsOperations<azure.mgmt.databox.v2018_01_01.operations.JobsOperations>`
|
||||
* 2019-09-01: :class:`JobsOperations<azure.mgmt.databox.v2019_09_01.operations.JobsOperations>`
|
||||
* 2020-04-01: :class:`JobsOperations<azure.mgmt.databox.v2020_04_01.operations.JobsOperations>`
|
||||
* 2020-11-01: :class:`JobsOperations<azure.mgmt.databox.v2020_11_01.operations.JobsOperations>`
|
||||
* 2021-03-01: :class:`JobsOperations<azure.mgmt.databox.v2021_03_01.operations.JobsOperations>`
|
||||
* 2021-05-01: :class:`JobsOperations<azure.mgmt.databox.v2021_05_01.operations.JobsOperations>`
|
||||
* 2021-08-01-preview: :class:`JobsOperations<azure.mgmt.databox.v2021_08_01_preview.operations.JobsOperations>`
|
||||
* 2021-12-01: :class:`JobsOperations<azure.mgmt.databox.v2021_12_01.operations.JobsOperations>`
|
||||
* 2022-02-01: :class:`JobsOperations<azure.mgmt.databox.v2022_02_01.operations.JobsOperations>`
|
||||
* 2022-09-01: :class:`JobsOperations<azure.mgmt.databox.v2022_09_01.operations.JobsOperations>`
|
||||
* 2022-10-01: :class:`JobsOperations<azure.mgmt.databox.v2022_10_01.operations.JobsOperations>`
|
||||
* 2022-12-01: :class:`JobsOperations<azure.mgmt.databox.v2022_12_01.operations.JobsOperations>`
|
||||
"""
|
||||
api_version = self._get_api_version('jobs')
|
||||
if api_version == '2018-01-01':
|
||||
from .v2018_01_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2019-09-01':
|
||||
from .v2019_09_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2020-04-01':
|
||||
from .v2020_04_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2020-11-01':
|
||||
from .v2020_11_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2021-03-01':
|
||||
from .v2021_03_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2021-05-01':
|
||||
from .v2021_05_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from .v2021_08_01_preview.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2021-12-01':
|
||||
from .v2021_12_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2022-02-01':
|
||||
from .v2022_02_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2022-09-01':
|
||||
from .v2022_09_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2022-10-01':
|
||||
from .v2022_10_01.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2022-12-01':
|
||||
from .v2022_12_01.operations import JobsOperations as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation group 'jobs'".format(api_version))
|
||||
self._config.api_version = 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:
|
||||
|
||||
* 2018-01-01: :class:`Operations<azure.mgmt.databox.v2018_01_01.operations.Operations>`
|
||||
* 2019-09-01: :class:`Operations<azure.mgmt.databox.v2019_09_01.operations.Operations>`
|
||||
* 2020-04-01: :class:`Operations<azure.mgmt.databox.v2020_04_01.operations.Operations>`
|
||||
* 2020-11-01: :class:`Operations<azure.mgmt.databox.v2020_11_01.operations.Operations>`
|
||||
* 2021-03-01: :class:`Operations<azure.mgmt.databox.v2021_03_01.operations.Operations>`
|
||||
* 2021-05-01: :class:`Operations<azure.mgmt.databox.v2021_05_01.operations.Operations>`
|
||||
* 2021-08-01-preview: :class:`Operations<azure.mgmt.databox.v2021_08_01_preview.operations.Operations>`
|
||||
* 2021-12-01: :class:`Operations<azure.mgmt.databox.v2021_12_01.operations.Operations>`
|
||||
* 2022-02-01: :class:`Operations<azure.mgmt.databox.v2022_02_01.operations.Operations>`
|
||||
* 2022-09-01: :class:`Operations<azure.mgmt.databox.v2022_09_01.operations.Operations>`
|
||||
* 2022-10-01: :class:`Operations<azure.mgmt.databox.v2022_10_01.operations.Operations>`
|
||||
* 2022-12-01: :class:`Operations<azure.mgmt.databox.v2022_12_01.operations.Operations>`
|
||||
"""
|
||||
api_version = self._get_api_version('operations')
|
||||
if api_version == '2018-01-01':
|
||||
from .v2018_01_01.operations import Operations as OperationClass
|
||||
elif api_version == '2019-09-01':
|
||||
from .v2019_09_01.operations import Operations as OperationClass
|
||||
elif api_version == '2020-04-01':
|
||||
from .v2020_04_01.operations import Operations as OperationClass
|
||||
elif api_version == '2020-11-01':
|
||||
from .v2020_11_01.operations import Operations as OperationClass
|
||||
elif api_version == '2021-03-01':
|
||||
from .v2021_03_01.operations import Operations as OperationClass
|
||||
elif api_version == '2021-05-01':
|
||||
from .v2021_05_01.operations import Operations as OperationClass
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from .v2021_08_01_preview.operations import Operations as OperationClass
|
||||
elif api_version == '2021-12-01':
|
||||
from .v2021_12_01.operations import Operations as OperationClass
|
||||
elif api_version == '2022-02-01':
|
||||
from .v2022_02_01.operations import Operations as OperationClass
|
||||
elif api_version == '2022-09-01':
|
||||
from .v2022_09_01.operations import Operations as OperationClass
|
||||
elif api_version == '2022-10-01':
|
||||
from .v2022_10_01.operations import Operations as OperationClass
|
||||
elif api_version == '2022-12-01':
|
||||
from .v2022_12_01.operations import Operations as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
|
||||
self._config.api_version = api_version
|
||||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
|
||||
|
||||
@property
|
||||
def service(self):
|
||||
"""Instance depends on the API version:
|
||||
|
||||
* 2018-01-01: :class:`ServiceOperations<azure.mgmt.databox.v2018_01_01.operations.ServiceOperations>`
|
||||
* 2019-09-01: :class:`ServiceOperations<azure.mgmt.databox.v2019_09_01.operations.ServiceOperations>`
|
||||
* 2020-04-01: :class:`ServiceOperations<azure.mgmt.databox.v2020_04_01.operations.ServiceOperations>`
|
||||
* 2020-11-01: :class:`ServiceOperations<azure.mgmt.databox.v2020_11_01.operations.ServiceOperations>`
|
||||
* 2021-03-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_03_01.operations.ServiceOperations>`
|
||||
* 2021-05-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_05_01.operations.ServiceOperations>`
|
||||
* 2021-08-01-preview: :class:`ServiceOperations<azure.mgmt.databox.v2021_08_01_preview.operations.ServiceOperations>`
|
||||
* 2021-12-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_12_01.operations.ServiceOperations>`
|
||||
* 2022-02-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_02_01.operations.ServiceOperations>`
|
||||
* 2022-09-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_09_01.operations.ServiceOperations>`
|
||||
* 2022-10-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_10_01.operations.ServiceOperations>`
|
||||
* 2022-12-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_12_01.operations.ServiceOperations>`
|
||||
"""
|
||||
api_version = self._get_api_version('service')
|
||||
if api_version == '2018-01-01':
|
||||
from .v2018_01_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2019-09-01':
|
||||
from .v2019_09_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2020-04-01':
|
||||
from .v2020_04_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2020-11-01':
|
||||
from .v2020_11_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2021-03-01':
|
||||
from .v2021_03_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2021-05-01':
|
||||
from .v2021_05_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from .v2021_08_01_preview.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2021-12-01':
|
||||
from .v2021_12_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2022-02-01':
|
||||
from .v2022_02_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2022-09-01':
|
||||
from .v2022_09_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2022-10-01':
|
||||
from .v2022_10_01.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2022-12-01':
|
||||
from .v2022_12_01.operations import ServiceOperations as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation group 'service'".format(api_version))
|
||||
self._config.api_version = api_version
|
||||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
|
||||
|
||||
def close(self):
|
||||
def close(self) -> None:
|
||||
self._client.close()
|
||||
def __enter__(self):
|
||||
|
||||
def __enter__(self) -> Self:
|
||||
self._client.__enter__()
|
||||
return self
|
||||
def __exit__(self, *exc_details):
|
||||
|
||||
def __exit__(self, *exc_details: Any) -> None:
|
||||
self._client.__exit__(*exc_details)
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
# 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 ._serialization import Serializer, Deserializer
|
||||
from typing import Any, IO, Optional, Union
|
||||
|
||||
from . import models as _models
|
||||
|
||||
|
||||
class DataBoxManagementClientOperationsMixin(object):
|
||||
|
||||
def mitigate( # pylint: disable=inconsistent-return-statements
|
||||
self,
|
||||
job_name: str,
|
||||
resource_group_name: str,
|
||||
mitigate_job_request: Union[_models.MitigateJobRequest, IO],
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
"""Request to mitigate for a given job.
|
||||
|
||||
:param job_name: The name of the job Resource within the specified resource group. job names
|
||||
must be between 3 and 24 characters in length and use any alphanumeric and underscore only.
|
||||
Required.
|
||||
:type job_name: str
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO
|
||||
type. Required.
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: None or the result of cls(response)
|
||||
:rtype: None
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
api_version = self._get_api_version('mitigate')
|
||||
if api_version == '2021-03-01':
|
||||
from .v2021_03_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2021-05-01':
|
||||
from .v2021_05_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from .v2021_08_01_preview.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2021-12-01':
|
||||
from .v2021_12_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2022-02-01':
|
||||
from .v2022_02_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2022-09-01':
|
||||
from .v2022_09_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2022-10-01':
|
||||
from .v2022_10_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2022-12-01':
|
||||
from .v2022_12_01.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation 'mitigate'".format(api_version))
|
||||
mixin_instance = OperationClass()
|
||||
mixin_instance._client = self._client
|
||||
mixin_instance._config = self._config
|
||||
mixin_instance._config.api_version = api_version
|
||||
mixin_instance._serialize = Serializer(self._models_dict(api_version))
|
||||
mixin_instance._serialize.client_side_validation = False
|
||||
mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
|
||||
return mixin_instance.mitigate(job_name, resource_group_name, mitigate_job_request, **kwargs)
|
|
@ -63,8 +63,8 @@ import xml.etree.ElementTree as ET
|
|||
|
||||
import isodate # type: ignore
|
||||
|
||||
from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback
|
||||
from azure.core.serialization import NULL as AzureCoreNull
|
||||
from azure.core.exceptions import DeserializationError, SerializationError
|
||||
from azure.core.serialization import NULL as CoreNull
|
||||
|
||||
_BOM = codecs.BOM_UTF8.decode(encoding="utf-8")
|
||||
|
||||
|
@ -124,7 +124,7 @@ class RawDeserializer:
|
|||
pass
|
||||
|
||||
return ET.fromstring(data_as_str) # nosec
|
||||
except ET.ParseError:
|
||||
except ET.ParseError as err:
|
||||
# It might be because the server has an issue, and returned JSON with
|
||||
# content-type XML....
|
||||
# So let's try a JSON load, and if it's still broken
|
||||
|
@ -143,7 +143,9 @@ class RawDeserializer:
|
|||
# The function hack is because Py2.7 messes up with exception
|
||||
# context otherwise.
|
||||
_LOGGER.critical("Wasn't XML not JSON, failing")
|
||||
raise_with_traceback(DeserializationError, "XML is invalid")
|
||||
raise DeserializationError("XML is invalid") from err
|
||||
elif content_type.startswith("text/"):
|
||||
return data_as_str
|
||||
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))
|
||||
|
||||
@classmethod
|
||||
|
@ -170,13 +172,6 @@ class RawDeserializer:
|
|||
return None
|
||||
|
||||
|
||||
try:
|
||||
basestring # type: ignore
|
||||
unicode_str = unicode # type: ignore
|
||||
except NameError:
|
||||
basestring = str
|
||||
unicode_str = str
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
|
@ -295,7 +290,7 @@ class Model(object):
|
|||
_validation: Dict[str, Dict[str, Any]] = {}
|
||||
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
self.additional_properties: Dict[str, Any] = {}
|
||||
self.additional_properties: Optional[Dict[str, Any]] = {}
|
||||
for k in kwargs:
|
||||
if k not in self._attribute_map:
|
||||
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
|
||||
|
@ -340,7 +335,7 @@ class Model(object):
|
|||
return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None))
|
||||
|
||||
def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
|
||||
"""Return the JSON that would be sent to azure from this model.
|
||||
"""Return the JSON that would be sent to server from this model.
|
||||
|
||||
This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`.
|
||||
|
||||
|
@ -351,14 +346,12 @@ class Model(object):
|
|||
:rtype: dict
|
||||
"""
|
||||
serializer = Serializer(self._infer_class_models())
|
||||
return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs)
|
||||
return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore
|
||||
|
||||
def as_dict(
|
||||
self,
|
||||
keep_readonly: bool = True,
|
||||
key_transformer: Callable[
|
||||
[str, Dict[str, Any], Any], Any
|
||||
] = attribute_transformer,
|
||||
key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
|
||||
**kwargs: Any
|
||||
) -> JSON:
|
||||
"""Return a dict that can be serialized using json.dump.
|
||||
|
@ -392,7 +385,7 @@ class Model(object):
|
|||
:rtype: dict
|
||||
"""
|
||||
serializer = Serializer(self._infer_class_models())
|
||||
return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs)
|
||||
return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore
|
||||
|
||||
@classmethod
|
||||
def _infer_class_models(cls):
|
||||
|
@ -417,7 +410,7 @@ class Model(object):
|
|||
:raises: DeserializationError if something went wrong
|
||||
"""
|
||||
deserializer = Deserializer(cls._infer_class_models())
|
||||
return deserializer(cls.__name__, data, content_type=content_type)
|
||||
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
|
||||
|
||||
@classmethod
|
||||
def from_dict(
|
||||
|
@ -447,7 +440,7 @@ class Model(object):
|
|||
if key_extractors is None
|
||||
else key_extractors
|
||||
)
|
||||
return deserializer(cls.__name__, data, content_type=content_type)
|
||||
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
|
||||
|
||||
@classmethod
|
||||
def _flatten_subtype(cls, key, objects):
|
||||
|
@ -547,7 +540,7 @@ class Serializer(object):
|
|||
"multiple": lambda x, y: x % y != 0,
|
||||
}
|
||||
|
||||
def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None):
|
||||
def __init__(self, classes: Optional[Mapping[str, type]] = None):
|
||||
self.serialize_type = {
|
||||
"iso-8601": Serializer.serialize_iso,
|
||||
"rfc-1123": Serializer.serialize_rfc,
|
||||
|
@ -563,7 +556,7 @@ class Serializer(object):
|
|||
"[]": self.serialize_iter,
|
||||
"{}": self.serialize_dict,
|
||||
}
|
||||
self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {}
|
||||
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
|
||||
self.key_transformer = full_restapi_key_transformer
|
||||
self.client_side_validation = True
|
||||
|
||||
|
@ -651,7 +644,7 @@ class Serializer(object):
|
|||
else: # That's a basic type
|
||||
# Integrate namespace if necessary
|
||||
local_node = _create_xml_node(xml_name, xml_prefix, xml_ns)
|
||||
local_node.text = unicode_str(new_attr)
|
||||
local_node.text = str(new_attr)
|
||||
serialized.append(local_node) # type: ignore
|
||||
else: # JSON
|
||||
for k in reversed(keys): # type: ignore
|
||||
|
@ -664,12 +657,13 @@ class Serializer(object):
|
|||
_serialized.update(_new_attr) # type: ignore
|
||||
_new_attr = _new_attr[k] # type: ignore
|
||||
_serialized = _serialized[k]
|
||||
except ValueError:
|
||||
continue
|
||||
except ValueError as err:
|
||||
if isinstance(err, SerializationError):
|
||||
raise
|
||||
|
||||
except (AttributeError, KeyError, TypeError) as err:
|
||||
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
|
||||
raise_with_traceback(SerializationError, msg, err)
|
||||
raise SerializationError(msg) from err
|
||||
else:
|
||||
return serialized
|
||||
|
||||
|
@ -711,7 +705,7 @@ class Serializer(object):
|
|||
]
|
||||
data = deserializer._deserialize(data_type, data)
|
||||
except DeserializationError as err:
|
||||
raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err)
|
||||
raise SerializationError("Unable to build a model: " + str(err)) from err
|
||||
|
||||
return self._serialize(data, data_type, **kwargs)
|
||||
|
||||
|
@ -731,6 +725,7 @@ class Serializer(object):
|
|||
|
||||
if kwargs.get("skip_quote") is True:
|
||||
output = str(output)
|
||||
output = output.replace("{", quote("{")).replace("}", quote("}"))
|
||||
else:
|
||||
output = quote(str(output), safe="")
|
||||
except SerializationError:
|
||||
|
@ -743,7 +738,9 @@ class Serializer(object):
|
|||
|
||||
:param data: The data to be serialized.
|
||||
:param str data_type: The type to be serialized from.
|
||||
:rtype: str
|
||||
:keyword bool skip_quote: Whether to skip quote the serialized result.
|
||||
Defaults to False.
|
||||
:rtype: str, list
|
||||
:raises: TypeError if serialization fails.
|
||||
:raises: ValueError if data is None
|
||||
"""
|
||||
|
@ -751,10 +748,8 @@ class Serializer(object):
|
|||
# Treat the list aside, since we don't want to encode the div separator
|
||||
if data_type.startswith("["):
|
||||
internal_data_type = data_type[1:-1]
|
||||
data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
|
||||
if not kwargs.get("skip_quote", False):
|
||||
data = [quote(str(d), safe="") for d in data]
|
||||
return str(self.serialize_iter(data, internal_data_type, **kwargs))
|
||||
do_quote = not kwargs.get("skip_quote", False)
|
||||
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
|
||||
|
||||
# Not a list, regular serialization
|
||||
output = self.serialize_data(data, data_type, **kwargs)
|
||||
|
@ -805,7 +800,7 @@ class Serializer(object):
|
|||
raise ValueError("No value for given attribute")
|
||||
|
||||
try:
|
||||
if data is AzureCoreNull:
|
||||
if data is CoreNull:
|
||||
return None
|
||||
if data_type in self.basic_types.values():
|
||||
return self.serialize_basic(data, data_type, **kwargs)
|
||||
|
@ -825,7 +820,7 @@ class Serializer(object):
|
|||
|
||||
except (ValueError, TypeError) as err:
|
||||
msg = "Unable to serialize value: {!r} as type: {!r}."
|
||||
raise_with_traceback(SerializationError, msg.format(data, data_type), err)
|
||||
raise SerializationError(msg.format(data, data_type)) from err
|
||||
else:
|
||||
return self._serialize(data, **kwargs)
|
||||
|
||||
|
@ -893,6 +888,8 @@ class Serializer(object):
|
|||
not be None or empty.
|
||||
:param str div: If set, this str will be used to combine the elements
|
||||
in the iterable into a combined string. Default is 'None'.
|
||||
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
|
||||
Defaults to False.
|
||||
:rtype: list, str
|
||||
"""
|
||||
if isinstance(data, str):
|
||||
|
@ -905,9 +902,14 @@ class Serializer(object):
|
|||
for d in data:
|
||||
try:
|
||||
serialized.append(self.serialize_data(d, iter_type, **kwargs))
|
||||
except ValueError:
|
||||
except ValueError as err:
|
||||
if isinstance(err, SerializationError):
|
||||
raise
|
||||
serialized.append(None)
|
||||
|
||||
if kwargs.get("do_quote", False):
|
||||
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
|
||||
|
||||
if div:
|
||||
serialized = ["" if s is None else str(s) for s in serialized]
|
||||
serialized = div.join(serialized)
|
||||
|
@ -952,7 +954,9 @@ class Serializer(object):
|
|||
for key, value in attr.items():
|
||||
try:
|
||||
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
|
||||
except ValueError:
|
||||
except ValueError as err:
|
||||
if isinstance(err, SerializationError):
|
||||
raise
|
||||
serialized[self.serialize_unicode(key)] = None
|
||||
|
||||
if "xml" in serialization_ctxt:
|
||||
|
@ -985,7 +989,7 @@ class Serializer(object):
|
|||
return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs)
|
||||
if obj_type is _long_type:
|
||||
return self.serialize_long(attr)
|
||||
if obj_type is unicode_str:
|
||||
if obj_type is str:
|
||||
return self.serialize_unicode(attr)
|
||||
if obj_type is datetime.datetime:
|
||||
return self.serialize_iso(attr)
|
||||
|
@ -1162,10 +1166,10 @@ class Serializer(object):
|
|||
return date + microseconds + "Z"
|
||||
except (ValueError, OverflowError) as err:
|
||||
msg = "Unable to serialize datetime object."
|
||||
raise_with_traceback(SerializationError, msg, err)
|
||||
raise SerializationError(msg) from err
|
||||
except AttributeError as err:
|
||||
msg = "ISO-8601 object must be valid Datetime object."
|
||||
raise_with_traceback(TypeError, msg, err)
|
||||
raise TypeError(msg) from err
|
||||
|
||||
@staticmethod
|
||||
def serialize_unix(attr, **kwargs):
|
||||
|
@ -1201,7 +1205,6 @@ def rest_key_extractor(attr, attr_desc, data):
|
|||
if working_data is None:
|
||||
# If at any point while following flatten JSON path see None, it means
|
||||
# that all properties under are None as well
|
||||
# https://github.com/Azure/msrest-for-python/issues/197
|
||||
return None
|
||||
key = ".".join(dict_keys[1:])
|
||||
|
||||
|
@ -1222,7 +1225,6 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data):
|
|||
if working_data is None:
|
||||
# If at any point while following flatten JSON path see None, it means
|
||||
# that all properties under are None as well
|
||||
# https://github.com/Azure/msrest-for-python/issues/197
|
||||
return None
|
||||
key = ".".join(dict_keys[1:])
|
||||
|
||||
|
@ -1363,7 +1365,7 @@ class Deserializer(object):
|
|||
|
||||
valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
|
||||
|
||||
def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None):
|
||||
def __init__(self, classes: Optional[Mapping[str, type]] = None):
|
||||
self.deserialize_type = {
|
||||
"iso-8601": Deserializer.deserialize_iso,
|
||||
"rfc-1123": Deserializer.deserialize_rfc,
|
||||
|
@ -1383,7 +1385,7 @@ class Deserializer(object):
|
|||
"duration": (isodate.Duration, datetime.timedelta),
|
||||
"iso-8601": (datetime.datetime),
|
||||
}
|
||||
self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {}
|
||||
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
|
||||
self.key_extractors = [rest_key_extractor, xml_key_extractor]
|
||||
# Additional properties only works if the "rest_key_extractor" is used to
|
||||
# extract the keys. Making it to work whatever the key extractor is too much
|
||||
|
@ -1436,12 +1438,12 @@ class Deserializer(object):
|
|||
|
||||
response, class_name = self._classify_target(target_obj, data)
|
||||
|
||||
if isinstance(response, basestring):
|
||||
if isinstance(response, str):
|
||||
return self.deserialize_data(data, response)
|
||||
elif isinstance(response, type) and issubclass(response, Enum):
|
||||
return self.deserialize_enum(data, response)
|
||||
|
||||
if data is None:
|
||||
if data is None or data is CoreNull:
|
||||
return data
|
||||
try:
|
||||
attributes = response._attribute_map # type: ignore
|
||||
|
@ -1473,7 +1475,7 @@ class Deserializer(object):
|
|||
d_attrs[attr] = value
|
||||
except (AttributeError, TypeError, KeyError) as err:
|
||||
msg = "Unable to deserialize to object: " + class_name # type: ignore
|
||||
raise_with_traceback(DeserializationError, msg, err)
|
||||
raise DeserializationError(msg) from err
|
||||
else:
|
||||
additional_properties = self._build_additional_properties(attributes, data)
|
||||
return self._instantiate_model(response, d_attrs, additional_properties)
|
||||
|
@ -1507,14 +1509,14 @@ class Deserializer(object):
|
|||
if target is None:
|
||||
return None, None
|
||||
|
||||
if isinstance(target, basestring):
|
||||
if isinstance(target, str):
|
||||
try:
|
||||
target = self.dependencies[target]
|
||||
except KeyError:
|
||||
return target, target
|
||||
|
||||
try:
|
||||
target = target._classify(data, self.dependencies)
|
||||
target = target._classify(data, self.dependencies) # type: ignore
|
||||
except AttributeError:
|
||||
pass # Target is not a Model, no classify
|
||||
return target, target.__class__.__name__ # type: ignore
|
||||
|
@ -1570,7 +1572,7 @@ class Deserializer(object):
|
|||
if hasattr(raw_data, "_content_consumed"):
|
||||
return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers)
|
||||
|
||||
if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"):
|
||||
if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"):
|
||||
return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore
|
||||
return raw_data
|
||||
|
||||
|
@ -1644,7 +1646,7 @@ class Deserializer(object):
|
|||
except (ValueError, TypeError, AttributeError) as err:
|
||||
msg = "Unable to deserialize response data."
|
||||
msg += " Data: {}, {}".format(data, data_type)
|
||||
raise_with_traceback(DeserializationError, msg, err)
|
||||
raise DeserializationError(msg) from err
|
||||
else:
|
||||
return self._deserialize(obj_type, data)
|
||||
|
||||
|
@ -1692,7 +1694,7 @@ class Deserializer(object):
|
|||
if isinstance(attr, ET.Element):
|
||||
# Do no recurse on XML, just return the tree as-is
|
||||
return attr
|
||||
if isinstance(attr, basestring):
|
||||
if isinstance(attr, str):
|
||||
return self.deserialize_basic(attr, "str")
|
||||
obj_type = type(attr)
|
||||
if obj_type in self.basic_types:
|
||||
|
@ -1749,7 +1751,7 @@ class Deserializer(object):
|
|||
if data_type == "bool":
|
||||
if attr in [True, False, 1, 0]:
|
||||
return bool(attr)
|
||||
elif isinstance(attr, basestring):
|
||||
elif isinstance(attr, str):
|
||||
if attr.lower() in ["true", "1"]:
|
||||
return True
|
||||
elif attr.lower() in ["false", "0"]:
|
||||
|
@ -1800,7 +1802,6 @@ class Deserializer(object):
|
|||
data = data.value
|
||||
if isinstance(data, int):
|
||||
# Workaround. We might consider remove it in the future.
|
||||
# https://github.com/Azure/azure-rest-api-specs/issues/141
|
||||
try:
|
||||
return list(enum_obj.__members__.values())[data]
|
||||
except IndexError:
|
||||
|
@ -1854,10 +1855,10 @@ class Deserializer(object):
|
|||
if isinstance(attr, ET.Element):
|
||||
attr = attr.text
|
||||
try:
|
||||
return decimal.Decimal(attr) # type: ignore
|
||||
return decimal.Decimal(str(attr)) # type: ignore
|
||||
except decimal.DecimalException as err:
|
||||
msg = "Invalid decimal {}".format(attr)
|
||||
raise_with_traceback(DeserializationError, msg, err)
|
||||
raise DeserializationError(msg) from err
|
||||
|
||||
@staticmethod
|
||||
def deserialize_long(attr):
|
||||
|
@ -1885,7 +1886,7 @@ class Deserializer(object):
|
|||
duration = isodate.parse_duration(attr)
|
||||
except (ValueError, OverflowError, AttributeError) as err:
|
||||
msg = "Cannot deserialize duration object."
|
||||
raise_with_traceback(DeserializationError, msg, err)
|
||||
raise DeserializationError(msg) from err
|
||||
else:
|
||||
return duration
|
||||
|
||||
|
@ -1902,7 +1903,7 @@ class Deserializer(object):
|
|||
if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore
|
||||
raise DeserializationError("Date must have only digits and -. Received: %s" % attr)
|
||||
# This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception.
|
||||
return isodate.parse_date(attr, defaultmonth=None, defaultday=None)
|
||||
return isodate.parse_date(attr, defaultmonth=0, defaultday=0)
|
||||
|
||||
@staticmethod
|
||||
def deserialize_time(attr):
|
||||
|
@ -1937,7 +1938,7 @@ class Deserializer(object):
|
|||
date_obj = date_obj.astimezone(tz=TZ_UTC)
|
||||
except ValueError as err:
|
||||
msg = "Cannot deserialize to rfc datetime object."
|
||||
raise_with_traceback(DeserializationError, msg, err)
|
||||
raise DeserializationError(msg) from err
|
||||
else:
|
||||
return date_obj
|
||||
|
||||
|
@ -1974,7 +1975,7 @@ class Deserializer(object):
|
|||
raise OverflowError("Hit max or min date")
|
||||
except (ValueError, OverflowError, AttributeError) as err:
|
||||
msg = "Cannot deserialize datetime object."
|
||||
raise_with_traceback(DeserializationError, msg, err)
|
||||
raise DeserializationError(msg) from err
|
||||
else:
|
||||
return date_obj
|
||||
|
||||
|
@ -1990,9 +1991,10 @@ class Deserializer(object):
|
|||
if isinstance(attr, ET.Element):
|
||||
attr = int(attr.text) # type: ignore
|
||||
try:
|
||||
attr = int(attr)
|
||||
date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC)
|
||||
except ValueError as err:
|
||||
msg = "Cannot deserialize to unix datetime object."
|
||||
raise_with_traceback(DeserializationError, msg, err)
|
||||
raise DeserializationError(msg) from err
|
||||
else:
|
||||
return date_obj
|
||||
|
|
|
@ -8,21 +8,19 @@
|
|||
from abc import ABC
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from azure.core.pipeline.transport import HttpRequest
|
||||
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core import AsyncPipelineClient
|
||||
from azure.core import PipelineClient
|
||||
|
||||
from ..._serialization import Deserializer, Serializer
|
||||
from ._serialization import Deserializer, Serializer
|
||||
|
||||
|
||||
class DataBoxManagementClientMixinABC(ABC):
|
||||
"""DO NOT use this class. It is for internal typing use only."""
|
||||
|
||||
_client: "AsyncPipelineClient"
|
||||
_client: "PipelineClient"
|
||||
_config: DataBoxManagementClientConfiguration
|
||||
_serialize: "Serializer"
|
||||
_deserialize: "Deserializer"
|
|
@ -1,8 +1,9 @@
|
|||
# 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "2.0.0"
|
||||
VERSION = "3.0.0"
|
||||
|
|
|
@ -7,4 +7,17 @@
|
|||
# --------------------------------------------------------------------------
|
||||
|
||||
from ._data_box_management_client import DataBoxManagementClient
|
||||
__all__ = ['DataBoxManagementClient']
|
||||
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"DataBoxManagementClient",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
||||
|
|
|
@ -1,16 +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
|
||||
from azure.core.pipeline import policies
|
||||
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
|
||||
|
||||
|
@ -20,7 +17,8 @@ if TYPE_CHECKING:
|
|||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
class DataBoxManagementClientConfiguration(Configuration):
|
||||
|
||||
class DataBoxManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
|
||||
"""Configuration for DataBoxManagementClient.
|
||||
|
||||
Note that all parameters used to create this instance are saved as instance
|
||||
|
@ -30,38 +28,38 @@ class DataBoxManagementClientConfiguration(Configuration):
|
|||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2022-12-01". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "AsyncTokenCredential",
|
||||
subscription_id: str,
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
|
||||
api_version: str = kwargs.pop("api_version", "2022-12-01")
|
||||
|
||||
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(DataBoxManagementClientConfiguration, 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-databox/{}'.format(VERSION))
|
||||
self.api_version = api_version
|
||||
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
|
||||
kwargs.setdefault("sdk_moniker", "mgmt-databox/{}".format(VERSION))
|
||||
self.polling_interval = kwargs.get("polling_interval", 30)
|
||||
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')
|
||||
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.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
|
||||
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
|
||||
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
|
||||
self.authentication_policy = kwargs.get("authentication_policy")
|
||||
if self.credential and not self.authentication_policy:
|
||||
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
|
||||
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
||||
|
|
|
@ -1,288 +1,122 @@
|
|||
# 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, Optional, TYPE_CHECKING
|
||||
from copy import deepcopy
|
||||
from typing import Any, Awaitable, TYPE_CHECKING
|
||||
from typing_extensions import Self
|
||||
|
||||
from azure.core.pipeline import policies
|
||||
from azure.core.rest import AsyncHttpResponse, HttpRequest
|
||||
from azure.mgmt.core import AsyncARMPipelineClient
|
||||
from azure.profiles import KnownProfiles, ProfileDefinition
|
||||
from azure.profiles.multiapiclient import MultiApiClientMixin
|
||||
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
|
||||
|
||||
from .. import models as _models
|
||||
from .._serialization import Deserializer, Serializer
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
from ._operations_mixin import DataBoxManagementClientOperationsMixin
|
||||
from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
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 DataBoxManagementClient(DataBoxManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient):
|
||||
class DataBoxManagementClient(
|
||||
DataBoxManagementClientOperationsMixin
|
||||
): # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DataBox 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.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.databox.aio.operations.Operations
|
||||
:ivar jobs: JobsOperations operations
|
||||
:vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations
|
||||
:ivar service: ServiceOperations operations
|
||||
:vartype service: azure.mgmt.databox.aio.operations.ServiceOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
: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
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
: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.
|
||||
:keyword api_version: Api Version. Default value is "2022-12-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.
|
||||
"""
|
||||
|
||||
DEFAULT_API_VERSION = '2022-12-01'
|
||||
_PROFILE_TAG = "azure.mgmt.databox.DataBoxManagementClient"
|
||||
LATEST_PROFILE = ProfileDefinition({
|
||||
_PROFILE_TAG: {
|
||||
None: DEFAULT_API_VERSION,
|
||||
}},
|
||||
_PROFILE_TAG + " latest"
|
||||
)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "AsyncTokenCredential",
|
||||
subscription_id: str,
|
||||
api_version: Optional[str] = None,
|
||||
base_url: str = "https://management.azure.com",
|
||||
profile: KnownProfiles = KnownProfiles.default,
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs)
|
||||
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
|
||||
super(DataBoxManagementClient, self).__init__(
|
||||
api_version=api_version,
|
||||
profile=profile
|
||||
self._config = DataBoxManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
_policies = kwargs.pop("policies", None)
|
||||
if _policies is None:
|
||||
_policies = [
|
||||
policies.RequestIdPolicy(**kwargs),
|
||||
self._config.headers_policy,
|
||||
self._config.user_agent_policy,
|
||||
self._config.proxy_policy,
|
||||
policies.ContentDecodePolicy(**kwargs),
|
||||
AsyncARMAutoResourceProviderRegistrationPolicy(),
|
||||
self._config.redirect_policy,
|
||||
self._config.retry_policy,
|
||||
self._config.authentication_policy,
|
||||
self._config.custom_hook_policy,
|
||||
self._config.logging_policy,
|
||||
policies.DistributedTracingPolicy(**kwargs),
|
||||
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
|
||||
self._config.http_logging_policy,
|
||||
]
|
||||
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def _models_dict(cls, api_version):
|
||||
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}
|
||||
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.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
@classmethod
|
||||
def models(cls, api_version=DEFAULT_API_VERSION):
|
||||
"""Module depends on the API version:
|
||||
def _send_request(
|
||||
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
|
||||
) -> Awaitable[AsyncHttpResponse]:
|
||||
"""Runs the network request through the client's chained policies.
|
||||
|
||||
* 2018-01-01: :mod:`v2018_01_01.models<azure.mgmt.databox.v2018_01_01.models>`
|
||||
* 2019-09-01: :mod:`v2019_09_01.models<azure.mgmt.databox.v2019_09_01.models>`
|
||||
* 2020-04-01: :mod:`v2020_04_01.models<azure.mgmt.databox.v2020_04_01.models>`
|
||||
* 2020-11-01: :mod:`v2020_11_01.models<azure.mgmt.databox.v2020_11_01.models>`
|
||||
* 2021-03-01: :mod:`v2021_03_01.models<azure.mgmt.databox.v2021_03_01.models>`
|
||||
* 2021-05-01: :mod:`v2021_05_01.models<azure.mgmt.databox.v2021_05_01.models>`
|
||||
* 2021-08-01-preview: :mod:`v2021_08_01_preview.models<azure.mgmt.databox.v2021_08_01_preview.models>`
|
||||
* 2021-12-01: :mod:`v2021_12_01.models<azure.mgmt.databox.v2021_12_01.models>`
|
||||
* 2022-02-01: :mod:`v2022_02_01.models<azure.mgmt.databox.v2022_02_01.models>`
|
||||
* 2022-09-01: :mod:`v2022_09_01.models<azure.mgmt.databox.v2022_09_01.models>`
|
||||
* 2022-10-01: :mod:`v2022_10_01.models<azure.mgmt.databox.v2022_10_01.models>`
|
||||
* 2022-12-01: :mod:`v2022_12_01.models<azure.mgmt.databox.v2022_12_01.models>`
|
||||
>>> from azure.core.rest import HttpRequest
|
||||
>>> request = HttpRequest("GET", "https://www.example.org/")
|
||||
<HttpRequest [GET], url: 'https://www.example.org/'>
|
||||
>>> response = await client._send_request(request)
|
||||
<AsyncHttpResponse: 200 OK>
|
||||
|
||||
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
|
||||
|
||||
: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.AsyncHttpResponse
|
||||
"""
|
||||
if api_version == '2018-01-01':
|
||||
from ..v2018_01_01 import models
|
||||
return models
|
||||
elif api_version == '2019-09-01':
|
||||
from ..v2019_09_01 import models
|
||||
return models
|
||||
elif api_version == '2020-04-01':
|
||||
from ..v2020_04_01 import models
|
||||
return models
|
||||
elif api_version == '2020-11-01':
|
||||
from ..v2020_11_01 import models
|
||||
return models
|
||||
elif api_version == '2021-03-01':
|
||||
from ..v2021_03_01 import models
|
||||
return models
|
||||
elif api_version == '2021-05-01':
|
||||
from ..v2021_05_01 import models
|
||||
return models
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from ..v2021_08_01_preview import models
|
||||
return models
|
||||
elif api_version == '2021-12-01':
|
||||
from ..v2021_12_01 import models
|
||||
return models
|
||||
elif api_version == '2022-02-01':
|
||||
from ..v2022_02_01 import models
|
||||
return models
|
||||
elif api_version == '2022-09-01':
|
||||
from ..v2022_09_01 import models
|
||||
return models
|
||||
elif api_version == '2022-10-01':
|
||||
from ..v2022_10_01 import models
|
||||
return models
|
||||
elif api_version == '2022-12-01':
|
||||
from ..v2022_12_01 import models
|
||||
return models
|
||||
raise ValueError("API version {} is not available".format(api_version))
|
||||
|
||||
@property
|
||||
def jobs(self):
|
||||
"""Instance depends on the API version:
|
||||
request_copy = deepcopy(request)
|
||||
request_copy.url = self._client.format_url(request_copy.url)
|
||||
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
|
||||
|
||||
* 2018-01-01: :class:`JobsOperations<azure.mgmt.databox.v2018_01_01.aio.operations.JobsOperations>`
|
||||
* 2019-09-01: :class:`JobsOperations<azure.mgmt.databox.v2019_09_01.aio.operations.JobsOperations>`
|
||||
* 2020-04-01: :class:`JobsOperations<azure.mgmt.databox.v2020_04_01.aio.operations.JobsOperations>`
|
||||
* 2020-11-01: :class:`JobsOperations<azure.mgmt.databox.v2020_11_01.aio.operations.JobsOperations>`
|
||||
* 2021-03-01: :class:`JobsOperations<azure.mgmt.databox.v2021_03_01.aio.operations.JobsOperations>`
|
||||
* 2021-05-01: :class:`JobsOperations<azure.mgmt.databox.v2021_05_01.aio.operations.JobsOperations>`
|
||||
* 2021-08-01-preview: :class:`JobsOperations<azure.mgmt.databox.v2021_08_01_preview.aio.operations.JobsOperations>`
|
||||
* 2021-12-01: :class:`JobsOperations<azure.mgmt.databox.v2021_12_01.aio.operations.JobsOperations>`
|
||||
* 2022-02-01: :class:`JobsOperations<azure.mgmt.databox.v2022_02_01.aio.operations.JobsOperations>`
|
||||
* 2022-09-01: :class:`JobsOperations<azure.mgmt.databox.v2022_09_01.aio.operations.JobsOperations>`
|
||||
* 2022-10-01: :class:`JobsOperations<azure.mgmt.databox.v2022_10_01.aio.operations.JobsOperations>`
|
||||
* 2022-12-01: :class:`JobsOperations<azure.mgmt.databox.v2022_12_01.aio.operations.JobsOperations>`
|
||||
"""
|
||||
api_version = self._get_api_version('jobs')
|
||||
if api_version == '2018-01-01':
|
||||
from ..v2018_01_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2019-09-01':
|
||||
from ..v2019_09_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2020-04-01':
|
||||
from ..v2020_04_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2020-11-01':
|
||||
from ..v2020_11_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2021-03-01':
|
||||
from ..v2021_03_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2021-05-01':
|
||||
from ..v2021_05_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from ..v2021_08_01_preview.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2021-12-01':
|
||||
from ..v2021_12_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2022-02-01':
|
||||
from ..v2022_02_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2022-09-01':
|
||||
from ..v2022_09_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2022-10-01':
|
||||
from ..v2022_10_01.aio.operations import JobsOperations as OperationClass
|
||||
elif api_version == '2022-12-01':
|
||||
from ..v2022_12_01.aio.operations import JobsOperations as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation group 'jobs'".format(api_version))
|
||||
self._config.api_version = 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:
|
||||
|
||||
* 2018-01-01: :class:`Operations<azure.mgmt.databox.v2018_01_01.aio.operations.Operations>`
|
||||
* 2019-09-01: :class:`Operations<azure.mgmt.databox.v2019_09_01.aio.operations.Operations>`
|
||||
* 2020-04-01: :class:`Operations<azure.mgmt.databox.v2020_04_01.aio.operations.Operations>`
|
||||
* 2020-11-01: :class:`Operations<azure.mgmt.databox.v2020_11_01.aio.operations.Operations>`
|
||||
* 2021-03-01: :class:`Operations<azure.mgmt.databox.v2021_03_01.aio.operations.Operations>`
|
||||
* 2021-05-01: :class:`Operations<azure.mgmt.databox.v2021_05_01.aio.operations.Operations>`
|
||||
* 2021-08-01-preview: :class:`Operations<azure.mgmt.databox.v2021_08_01_preview.aio.operations.Operations>`
|
||||
* 2021-12-01: :class:`Operations<azure.mgmt.databox.v2021_12_01.aio.operations.Operations>`
|
||||
* 2022-02-01: :class:`Operations<azure.mgmt.databox.v2022_02_01.aio.operations.Operations>`
|
||||
* 2022-09-01: :class:`Operations<azure.mgmt.databox.v2022_09_01.aio.operations.Operations>`
|
||||
* 2022-10-01: :class:`Operations<azure.mgmt.databox.v2022_10_01.aio.operations.Operations>`
|
||||
* 2022-12-01: :class:`Operations<azure.mgmt.databox.v2022_12_01.aio.operations.Operations>`
|
||||
"""
|
||||
api_version = self._get_api_version('operations')
|
||||
if api_version == '2018-01-01':
|
||||
from ..v2018_01_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2019-09-01':
|
||||
from ..v2019_09_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2020-04-01':
|
||||
from ..v2020_04_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2020-11-01':
|
||||
from ..v2020_11_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2021-03-01':
|
||||
from ..v2021_03_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2021-05-01':
|
||||
from ..v2021_05_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from ..v2021_08_01_preview.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2021-12-01':
|
||||
from ..v2021_12_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2022-02-01':
|
||||
from ..v2022_02_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2022-09-01':
|
||||
from ..v2022_09_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2022-10-01':
|
||||
from ..v2022_10_01.aio.operations import Operations as OperationClass
|
||||
elif api_version == '2022-12-01':
|
||||
from ..v2022_12_01.aio.operations import Operations as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
|
||||
self._config.api_version = api_version
|
||||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
|
||||
|
||||
@property
|
||||
def service(self):
|
||||
"""Instance depends on the API version:
|
||||
|
||||
* 2018-01-01: :class:`ServiceOperations<azure.mgmt.databox.v2018_01_01.aio.operations.ServiceOperations>`
|
||||
* 2019-09-01: :class:`ServiceOperations<azure.mgmt.databox.v2019_09_01.aio.operations.ServiceOperations>`
|
||||
* 2020-04-01: :class:`ServiceOperations<azure.mgmt.databox.v2020_04_01.aio.operations.ServiceOperations>`
|
||||
* 2020-11-01: :class:`ServiceOperations<azure.mgmt.databox.v2020_11_01.aio.operations.ServiceOperations>`
|
||||
* 2021-03-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_03_01.aio.operations.ServiceOperations>`
|
||||
* 2021-05-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_05_01.aio.operations.ServiceOperations>`
|
||||
* 2021-08-01-preview: :class:`ServiceOperations<azure.mgmt.databox.v2021_08_01_preview.aio.operations.ServiceOperations>`
|
||||
* 2021-12-01: :class:`ServiceOperations<azure.mgmt.databox.v2021_12_01.aio.operations.ServiceOperations>`
|
||||
* 2022-02-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_02_01.aio.operations.ServiceOperations>`
|
||||
* 2022-09-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_09_01.aio.operations.ServiceOperations>`
|
||||
* 2022-10-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_10_01.aio.operations.ServiceOperations>`
|
||||
* 2022-12-01: :class:`ServiceOperations<azure.mgmt.databox.v2022_12_01.aio.operations.ServiceOperations>`
|
||||
"""
|
||||
api_version = self._get_api_version('service')
|
||||
if api_version == '2018-01-01':
|
||||
from ..v2018_01_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2019-09-01':
|
||||
from ..v2019_09_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2020-04-01':
|
||||
from ..v2020_04_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2020-11-01':
|
||||
from ..v2020_11_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2021-03-01':
|
||||
from ..v2021_03_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2021-05-01':
|
||||
from ..v2021_05_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from ..v2021_08_01_preview.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2021-12-01':
|
||||
from ..v2021_12_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2022-02-01':
|
||||
from ..v2022_02_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2022-09-01':
|
||||
from ..v2022_09_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2022-10-01':
|
||||
from ..v2022_10_01.aio.operations import ServiceOperations as OperationClass
|
||||
elif api_version == '2022-12-01':
|
||||
from ..v2022_12_01.aio.operations import ServiceOperations as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation group 'service'".format(api_version))
|
||||
self._config.api_version = api_version
|
||||
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
|
||||
|
||||
async def close(self):
|
||||
async def close(self) -> None:
|
||||
await self._client.close()
|
||||
async def __aenter__(self):
|
||||
|
||||
async def __aenter__(self) -> Self:
|
||||
await self._client.__aenter__()
|
||||
return self
|
||||
async def __aexit__(self, *exc_details):
|
||||
|
||||
async def __aexit__(self, *exc_details: Any) -> None:
|
||||
await self._client.__aexit__(*exc_details)
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
# 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 .._serialization import Serializer, Deserializer
|
||||
from typing import Any, IO, Optional, Union
|
||||
|
||||
from .. import models as _models
|
||||
|
||||
|
||||
class DataBoxManagementClientOperationsMixin(object):
|
||||
|
||||
async def mitigate( # pylint: disable=inconsistent-return-statements
|
||||
self,
|
||||
job_name: str,
|
||||
resource_group_name: str,
|
||||
mitigate_job_request: Union[_models.MitigateJobRequest, IO],
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
"""Request to mitigate for a given job.
|
||||
|
||||
:param job_name: The name of the job Resource within the specified resource group. job names
|
||||
must be between 3 and 24 characters in length and use any alphanumeric and underscore only.
|
||||
Required.
|
||||
:type job_name: str
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO
|
||||
type. Required.
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: None or the result of cls(response)
|
||||
:rtype: None
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
api_version = self._get_api_version('mitigate')
|
||||
if api_version == '2021-03-01':
|
||||
from ..v2021_03_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2021-05-01':
|
||||
from ..v2021_05_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2021-08-01-preview':
|
||||
from ..v2021_08_01_preview.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2021-12-01':
|
||||
from ..v2021_12_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2022-02-01':
|
||||
from ..v2022_02_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2022-09-01':
|
||||
from ..v2022_09_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2022-10-01':
|
||||
from ..v2022_10_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
elif api_version == '2022-12-01':
|
||||
from ..v2022_12_01.aio.operations import DataBoxManagementClientOperationsMixin as OperationClass
|
||||
else:
|
||||
raise ValueError("API version {} does not have operation 'mitigate'".format(api_version))
|
||||
mixin_instance = OperationClass()
|
||||
mixin_instance._client = self._client
|
||||
mixin_instance._config = self._config
|
||||
mixin_instance._config.api_version = api_version
|
||||
mixin_instance._serialize = Serializer(self._models_dict(api_version))
|
||||
mixin_instance._serialize.client_side_validation = False
|
||||
mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
|
||||
return await mixin_instance.mitigate(job_name, resource_group_name, mitigate_job_request, **kwargs)
|
|
@ -8,15 +8,13 @@
|
|||
from abc import ABC
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from azure.core.pipeline.transport import HttpRequest
|
||||
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core import AsyncPipelineClient
|
||||
|
||||
from ..._serialization import Deserializer, Serializer
|
||||
from .._serialization import Deserializer, Serializer
|
||||
|
||||
|
||||
class DataBoxManagementClientMixinABC(ABC):
|
|
@ -1,4 +1,4 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# pylint: disable=too-many-lines,too-many-statements
|
||||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
@ -6,7 +6,9 @@
|
|||
# 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, Callable, Dict, IO, Optional, TypeVar, Union, overload
|
||||
from io import IOBase
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
|
||||
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
|
@ -17,22 +19,25 @@ from azure.core.exceptions import (
|
|||
map_error,
|
||||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.rest import AsyncHttpResponse, HttpRequest
|
||||
from azure.core.tracing.decorator_async import distributed_trace_async
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models as _models
|
||||
from ..._vendor import _convert_request
|
||||
from ...operations._data_box_management_client_operations import build_mitigate_request
|
||||
from .._vendor import DataBoxManagementClientMixinABC
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from collections.abc import MutableMapping
|
||||
else:
|
||||
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
||||
class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
||||
|
||||
@overload
|
||||
async def mitigate( # pylint: disable=inconsistent-return-statements
|
||||
self,
|
||||
|
@ -52,11 +57,10 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param mitigate_job_request: Mitigation Request. Required.
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: None or the result of cls(response)
|
||||
:rtype: None
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
|
@ -67,7 +71,7 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
self,
|
||||
job_name: str,
|
||||
resource_group_name: str,
|
||||
mitigate_job_request: IO,
|
||||
mitigate_job_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
|
@ -81,11 +85,10 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param mitigate_job_request: Mitigation Request. Required.
|
||||
:type mitigate_job_request: IO
|
||||
:type mitigate_job_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: None or the result of cls(response)
|
||||
:rtype: None
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
|
@ -96,7 +99,7 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
self,
|
||||
job_name: str,
|
||||
resource_group_name: str,
|
||||
mitigate_job_request: Union[_models.MitigateJobRequest, IO],
|
||||
mitigate_job_request: Union[_models.MitigateJobRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
"""Request to mitigate for a given job.
|
||||
|
@ -107,18 +110,14 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
:type job_name: str
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO
|
||||
type. Required.
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a
|
||||
IO[bytes] type. Required.
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest or IO[bytes]
|
||||
:return: None or the result of cls(response)
|
||||
:rtype: None
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -129,19 +128,19 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[None] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(mitigate_job_request, (IO, bytes)):
|
||||
if isinstance(mitigate_job_request, (IOBase, bytes)):
|
||||
_content = mitigate_job_request
|
||||
else:
|
||||
_json = self._serialize.body(mitigate_job_request, "MitigateJobRequest")
|
||||
|
||||
request = build_mitigate_request(
|
||||
_request = build_mitigate_request(
|
||||
job_name=job_name,
|
||||
resource_group_name=resource_group_name,
|
||||
subscription_id=self._config.subscription_id,
|
||||
|
@ -149,16 +148,14 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.mitigate.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -169,8 +166,4 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, None, {})
|
||||
|
||||
mitigate.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate"
|
||||
}
|
||||
return cls(pipeline_response, None, {}) # type: ignore
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,4 +1,4 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# pylint: disable=too-many-lines,too-many-statements
|
||||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
@ -6,7 +6,8 @@
|
|||
# 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, AsyncIterable, Callable, Dict, Optional, TypeVar
|
||||
import sys
|
||||
from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
|
@ -19,16 +20,18 @@ from azure.core.exceptions import (
|
|||
map_error,
|
||||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.rest import AsyncHttpResponse, HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models as _models
|
||||
from ..._vendor import _convert_request
|
||||
from ...operations._operations import build_list_request
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from collections.abc import MutableMapping
|
||||
else:
|
||||
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
@ -39,7 +42,7 @@ class Operations:
|
|||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2020_04_01.aio.DataBoxManagementClient`'s
|
||||
:class:`~azure.mgmt.databox.aio.DataBoxManagementClient`'s
|
||||
:attr:`operations` attribute.
|
||||
"""
|
||||
|
||||
|
@ -56,19 +59,17 @@ class Operations:
|
|||
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
|
||||
"""This method gets all the operations.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either Operation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.Operation]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.Operation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -79,14 +80,12 @@ class Operations:
|
|||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_request(
|
||||
_request = build_list_request(
|
||||
api_version=api_version,
|
||||
template_url=self.list.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
|
@ -98,13 +97,12 @@ class Operations:
|
|||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
_request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
_request.method = "GET"
|
||||
return _request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("OperationList", pipeline_response)
|
||||
|
@ -114,11 +112,11 @@ class Operations:
|
|||
return deserialized.next_link or None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
_request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
|
@ -130,5 +128,3 @@ class Operations:
|
|||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(get_next, extract_data)
|
||||
|
||||
list.metadata = {"url": "/providers/Microsoft.DataBox/operations"}
|
|
@ -1,4 +1,4 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# pylint: disable=too-many-lines,too-many-statements
|
||||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
@ -6,7 +6,9 @@
|
|||
# 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, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
|
||||
from io import IOBase
|
||||
import sys
|
||||
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
|
@ -19,15 +21,13 @@ from azure.core.exceptions import (
|
|||
map_error,
|
||||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.rest import AsyncHttpResponse, HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.tracing.decorator_async import distributed_trace_async
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models as _models
|
||||
from ..._vendor import _convert_request
|
||||
from ...operations._service_operations import (
|
||||
build_list_available_skus_by_resource_group_request,
|
||||
build_region_configuration_by_resource_group_request,
|
||||
|
@ -37,6 +37,10 @@ from ...operations._service_operations import (
|
|||
build_validate_inputs_request,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from collections.abc import MutableMapping
|
||||
else:
|
||||
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
@ -47,7 +51,7 @@ class ServiceOperations:
|
|||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2020_04_01.aio.DataBoxManagementClient`'s
|
||||
:class:`~azure.mgmt.databox.aio.DataBoxManagementClient`'s
|
||||
:attr:`service` attribute.
|
||||
"""
|
||||
|
||||
|
@ -78,14 +82,12 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2020_04_01.models.AvailableSkuRequest
|
||||
:type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.SkuInformation]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -94,7 +96,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
available_sku_request: IO,
|
||||
available_sku_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
|
@ -107,14 +109,12 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: IO
|
||||
:type available_sku_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.SkuInformation]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -123,7 +123,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
available_sku_request: Union[_models.AvailableSkuRequest, IO],
|
||||
available_sku_request: Union[_models.AvailableSkuRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription, resource group and
|
||||
|
@ -134,25 +134,20 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Is either a
|
||||
AvailableSkuRequest type or a IO type. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2020_04_01.models.AvailableSkuRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
AvailableSkuRequest type or a IO[bytes] type. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest or IO[bytes]
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.SkuInformation]
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -162,7 +157,7 @@ class ServiceOperations:
|
|||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(available_sku_request, (IO, bytes)):
|
||||
if isinstance(available_sku_request, (IOBase, bytes)):
|
||||
_content = available_sku_request
|
||||
else:
|
||||
_json = self._serialize.body(available_sku_request, "AvailableSkuRequest")
|
||||
|
@ -170,7 +165,7 @@ class ServiceOperations:
|
|||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_available_skus_by_resource_group_request(
|
||||
_request = build_list_available_skus_by_resource_group_request(
|
||||
resource_group_name=resource_group_name,
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
|
@ -178,12 +173,10 @@ class ServiceOperations:
|
|||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.list_available_skus_by_resource_group.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
|
@ -195,13 +188,12 @@ class ServiceOperations:
|
|||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
_request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
_request.method = "GET"
|
||||
return _request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("AvailableSkusResult", pipeline_response)
|
||||
|
@ -211,11 +203,11 @@ class ServiceOperations:
|
|||
return deserialized.next_link or None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
_request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
|
@ -228,10 +220,6 @@ class ServiceOperations:
|
|||
|
||||
return AsyncItemPaged(get_next, extract_data)
|
||||
|
||||
list_available_skus_by_resource_group.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"
|
||||
}
|
||||
|
||||
@overload
|
||||
async def validate_address(
|
||||
self,
|
||||
|
@ -247,19 +235,18 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2020_04_01.models.ValidateAddress
|
||||
:type validate_address: ~azure.mgmt.databox.models.ValidateAddress
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput
|
||||
:rtype: ~azure.mgmt.databox.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def validate_address(
|
||||
self, location: str, validate_address: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
self, location: str, validate_address: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer
|
||||
shipping address and provide alternate addresses if any.
|
||||
|
@ -267,19 +254,18 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: IO
|
||||
:type validate_address: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput
|
||||
:rtype: ~azure.mgmt.databox.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def validate_address(
|
||||
self, location: str, validate_address: Union[_models.ValidateAddress, IO], **kwargs: Any
|
||||
self, location: str, validate_address: Union[_models.ValidateAddress, IO[bytes]], **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer
|
||||
shipping address and provide alternate addresses if any.
|
||||
|
@ -287,17 +273,13 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Is either a ValidateAddress type or
|
||||
a IO type. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2020_04_01.models.ValidateAddress or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
a IO[bytes] type. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.models.ValidateAddress or IO[bytes]
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput
|
||||
:rtype: ~azure.mgmt.databox.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -308,35 +290,33 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AddressValidationOutput] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validate_address, (IO, bytes)):
|
||||
if isinstance(validate_address, (IOBase, bytes)):
|
||||
_content = validate_address
|
||||
else:
|
||||
_json = self._serialize.body(validate_address, "ValidateAddress")
|
||||
|
||||
request = build_validate_address_request(
|
||||
_request = build_validate_address_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_address.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -346,16 +326,12 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("AddressValidationOutput", pipeline_response)
|
||||
deserialized = self._deserialize("AddressValidationOutput", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_address.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"
|
||||
}
|
||||
return deserialized # type: ignore
|
||||
|
||||
@overload
|
||||
async def validate_inputs_by_resource_group(
|
||||
|
@ -374,13 +350,12 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest
|
||||
:type validation_request: ~azure.mgmt.databox.models.ValidationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -389,7 +364,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
validation_request: IO,
|
||||
validation_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
|
@ -401,13 +376,12 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: IO
|
||||
:type validation_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -416,7 +390,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
validation_request: Union[_models.ValidationRequest, IO],
|
||||
validation_request: Union[_models.ValidationRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under resource group.
|
||||
|
@ -425,18 +399,14 @@ class ServiceOperations:
|
|||
:type resource_group_name: str
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a IO
|
||||
type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a
|
||||
IO[bytes] type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.models.ValidationRequest or IO[bytes]
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -447,19 +417,19 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validation_request, (IO, bytes)):
|
||||
if isinstance(validation_request, (IOBase, bytes)):
|
||||
_content = validation_request
|
||||
else:
|
||||
_json = self._serialize.body(validation_request, "ValidationRequest")
|
||||
|
||||
request = build_validate_inputs_by_resource_group_request(
|
||||
_request = build_validate_inputs_by_resource_group_request(
|
||||
resource_group_name=resource_group_name,
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
|
@ -467,16 +437,14 @@ class ServiceOperations:
|
|||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_inputs_by_resource_group.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -486,16 +454,12 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response)
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_inputs_by_resource_group.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"
|
||||
}
|
||||
return deserialized # type: ignore
|
||||
|
||||
@overload
|
||||
async def validate_inputs(
|
||||
|
@ -511,55 +475,49 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest
|
||||
:type validation_request: ~azure.mgmt.databox.models.ValidationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def validate_inputs(
|
||||
self, location: str, validation_request: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
self, location: str, validation_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under subscription.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: IO
|
||||
:type validation_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def validate_inputs(
|
||||
self, location: str, validation_request: Union[_models.ValidationRequest, IO], **kwargs: Any
|
||||
self, location: str, validation_request: Union[_models.ValidationRequest, IO[bytes]], **kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under subscription.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a IO
|
||||
type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a
|
||||
IO[bytes] type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.models.ValidationRequest or IO[bytes]
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -570,35 +528,33 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validation_request, (IO, bytes)):
|
||||
if isinstance(validation_request, (IOBase, bytes)):
|
||||
_content = validation_request
|
||||
else:
|
||||
_json = self._serialize.body(validation_request, "ValidationRequest")
|
||||
|
||||
request = build_validate_inputs_request(
|
||||
_request = build_validate_inputs_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_inputs.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -608,16 +564,12 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response)
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_inputs.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"
|
||||
}
|
||||
return deserialized # type: ignore
|
||||
|
||||
@overload
|
||||
async def region_configuration(
|
||||
|
@ -635,20 +587,23 @@ class ServiceOperations:
|
|||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region.
|
||||
Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest
|
||||
:type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def region_configuration(
|
||||
self, location: str, region_configuration_request: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
self,
|
||||
location: str,
|
||||
region_configuration_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.RegionConfigurationResponse:
|
||||
"""This API provides configuration details specific to given region/location at Subscription
|
||||
level.
|
||||
|
@ -657,19 +612,21 @@ class ServiceOperations:
|
|||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region.
|
||||
Required.
|
||||
:type region_configuration_request: IO
|
||||
:type region_configuration_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def region_configuration(
|
||||
self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **kwargs: Any
|
||||
self,
|
||||
location: str,
|
||||
region_configuration_request: Union[_models.RegionConfigurationRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> _models.RegionConfigurationResponse:
|
||||
"""This API provides configuration details specific to given region/location at Subscription
|
||||
level.
|
||||
|
@ -677,18 +634,14 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region. Is
|
||||
either a RegionConfigurationRequest type or a IO type. Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
either a RegionConfigurationRequest type or a IO[bytes] type. Required.
|
||||
:type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or
|
||||
IO[bytes]
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -699,35 +652,33 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(region_configuration_request, (IO, bytes)):
|
||||
if isinstance(region_configuration_request, (IOBase, bytes)):
|
||||
_content = region_configuration_request
|
||||
else:
|
||||
_json = self._serialize.body(region_configuration_request, "RegionConfigurationRequest")
|
||||
|
||||
request = build_region_configuration_request(
|
||||
_request = build_region_configuration_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.region_configuration.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -737,16 +688,12 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response)
|
||||
deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
region_configuration.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"
|
||||
}
|
||||
return deserialized # type: ignore
|
||||
|
||||
@overload
|
||||
async def region_configuration_by_resource_group(
|
||||
|
@ -767,14 +714,12 @@ class ServiceOperations:
|
|||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region at
|
||||
resource group level. Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest
|
||||
:type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -783,7 +728,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
region_configuration_request: IO,
|
||||
region_configuration_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
|
@ -797,13 +742,12 @@ class ServiceOperations:
|
|||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region at
|
||||
resource group level. Required.
|
||||
:type region_configuration_request: IO
|
||||
:type region_configuration_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -812,7 +756,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
region_configuration_request: Union[_models.RegionConfigurationRequest, IO],
|
||||
region_configuration_request: Union[_models.RegionConfigurationRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> _models.RegionConfigurationResponse:
|
||||
"""This API provides configuration details specific to given region/location at Resource group
|
||||
|
@ -823,18 +767,15 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region at
|
||||
resource group level. Is either a RegionConfigurationRequest type or a IO type. Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
resource group level. Is either a RegionConfigurationRequest type or a IO[bytes] type.
|
||||
Required.
|
||||
:type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or
|
||||
IO[bytes]
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -845,19 +786,19 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(region_configuration_request, (IO, bytes)):
|
||||
if isinstance(region_configuration_request, (IOBase, bytes)):
|
||||
_content = region_configuration_request
|
||||
else:
|
||||
_json = self._serialize.body(region_configuration_request, "RegionConfigurationRequest")
|
||||
|
||||
request = build_region_configuration_by_resource_group_request(
|
||||
_request = build_region_configuration_by_resource_group_request(
|
||||
resource_group_name=resource_group_name,
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
|
@ -865,16 +806,14 @@ class ServiceOperations:
|
|||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.region_configuration_by_resource_group.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -884,13 +823,9 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response)
|
||||
deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
region_configuration_by_resource_group.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"
|
||||
}
|
||||
return deserialized # type: ignore
|
|
@ -1,7 +0,0 @@
|
|||
# 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.
|
||||
# --------------------------------------------------------------------------
|
||||
from .v2022_12_01.models import *
|
|
@ -287,7 +287,7 @@ class ReverseShippingDetailsEditStatus(str, Enum, metaclass=CaseInsensitiveEnumM
|
|||
"""Edit is disabled for Reverse shipping details."""
|
||||
NOT_SUPPORTED = "NotSupported"
|
||||
"""Edit is not supported for Reverse shipping details. Either subscription feature is not
|
||||
#: available or SKU doesn't support this feature."""
|
||||
available or SKU doesn't support this feature."""
|
||||
|
||||
|
||||
class ReverseTransportPreferenceEditStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
|
@ -299,7 +299,7 @@ class ReverseTransportPreferenceEditStatus(str, Enum, metaclass=CaseInsensitiveE
|
|||
"""Edit is disabled for Reverse Transport Preferences."""
|
||||
NOT_SUPPORTED = "NotSupported"
|
||||
"""Edit is not supported for Reverse Transport Preferences. Either subscription feature is not
|
||||
#: available or SKU doesn't support this feature."""
|
||||
available or SKU doesn't support this feature."""
|
||||
|
||||
|
||||
class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
|
@ -334,7 +334,7 @@ class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
|||
"""Subscription does not have required offer types for the SKU."""
|
||||
NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo"
|
||||
"""Subscription has not registered to Microsoft.DataBox and Service does not have the subscription
|
||||
#: notification."""
|
||||
notification."""
|
||||
|
||||
|
||||
class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,4 +1,4 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# pylint: disable=too-many-lines,too-many-statements
|
||||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
@ -6,7 +6,9 @@
|
|||
# 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, Callable, Dict, IO, Optional, TypeVar, Union, overload
|
||||
from io import IOBase
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
|
||||
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
|
@ -17,16 +19,19 @@ from azure.core.exceptions import (
|
|||
map_error,
|
||||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.rest import HttpRequest, HttpResponse
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models as _models
|
||||
from ..._serialization import Serializer
|
||||
from .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section
|
||||
from .._serialization import Serializer
|
||||
from .._vendor import DataBoxManagementClientMixinABC
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from collections.abc import MutableMapping
|
||||
else:
|
||||
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
@ -53,7 +58,7 @@ def build_mitigate_request(job_name: str, resource_group_name: str, subscription
|
|||
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
||||
}
|
||||
|
||||
_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
|
||||
_url: str = _url.format(**path_format_arguments) # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
@ -67,6 +72,7 @@ def build_mitigate_request(job_name: str, resource_group_name: str, subscription
|
|||
|
||||
|
||||
class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
||||
|
||||
@overload
|
||||
def mitigate( # pylint: disable=inconsistent-return-statements
|
||||
self,
|
||||
|
@ -86,11 +92,10 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param mitigate_job_request: Mitigation Request. Required.
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: None or the result of cls(response)
|
||||
:rtype: None
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
|
@ -101,7 +106,7 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
self,
|
||||
job_name: str,
|
||||
resource_group_name: str,
|
||||
mitigate_job_request: IO,
|
||||
mitigate_job_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
|
@ -115,11 +120,10 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param mitigate_job_request: Mitigation Request. Required.
|
||||
:type mitigate_job_request: IO
|
||||
:type mitigate_job_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: None or the result of cls(response)
|
||||
:rtype: None
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
|
@ -130,7 +134,7 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
self,
|
||||
job_name: str,
|
||||
resource_group_name: str,
|
||||
mitigate_job_request: Union[_models.MitigateJobRequest, IO],
|
||||
mitigate_job_request: Union[_models.MitigateJobRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
"""Request to mitigate for a given job.
|
||||
|
@ -141,18 +145,14 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
:type job_name: str
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a IO
|
||||
type. Required.
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.v2022_12_01.models.MitigateJobRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:param mitigate_job_request: Mitigation Request. Is either a MitigateJobRequest type or a
|
||||
IO[bytes] type. Required.
|
||||
:type mitigate_job_request: ~azure.mgmt.databox.models.MitigateJobRequest or IO[bytes]
|
||||
:return: None or the result of cls(response)
|
||||
:rtype: None
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -163,19 +163,19 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[None] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(mitigate_job_request, (IO, bytes)):
|
||||
if isinstance(mitigate_job_request, (IOBase, bytes)):
|
||||
_content = mitigate_job_request
|
||||
else:
|
||||
_json = self._serialize.body(mitigate_job_request, "MitigateJobRequest")
|
||||
|
||||
request = build_mitigate_request(
|
||||
_request = build_mitigate_request(
|
||||
job_name=job_name,
|
||||
resource_group_name=resource_group_name,
|
||||
subscription_id=self._config.subscription_id,
|
||||
|
@ -183,16 +183,14 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.mitigate.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -203,8 +201,4 @@ class DataBoxManagementClientOperationsMixin(DataBoxManagementClientMixinABC):
|
|||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, None, {})
|
||||
|
||||
mitigate.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate"
|
||||
}
|
||||
return cls(pipeline_response, None, {}) # type: ignore
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,4 +1,4 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# pylint: disable=too-many-lines,too-many-statements
|
||||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
@ -6,7 +6,8 @@
|
|||
# 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, Callable, Dict, Iterable, Optional, TypeVar
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.exceptions import (
|
||||
|
@ -19,16 +20,18 @@ from azure.core.exceptions import (
|
|||
)
|
||||
from azure.core.paging import ItemPaged
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.rest import HttpRequest, HttpResponse
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models as _models
|
||||
from ..._serialization import Serializer
|
||||
from .._vendor import _convert_request
|
||||
from .._serialization import Serializer
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from collections.abc import MutableMapping
|
||||
else:
|
||||
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
@ -40,7 +43,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01"))
|
||||
accept = _headers.pop("Accept", "application/json")
|
||||
|
||||
# Construct URL
|
||||
|
@ -61,7 +64,7 @@ class Operations:
|
|||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2020_11_01.DataBoxManagementClient`'s
|
||||
:class:`~azure.mgmt.databox.DataBoxManagementClient`'s
|
||||
:attr:`operations` attribute.
|
||||
"""
|
||||
|
||||
|
@ -78,18 +81,17 @@ class Operations:
|
|||
def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
|
||||
"""This method gets all the operations.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either Operation or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.models.Operation]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.Operation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -100,14 +102,12 @@ class Operations:
|
|||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_request(
|
||||
_request = build_list_request(
|
||||
api_version=api_version,
|
||||
template_url=self.list.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
|
@ -119,13 +119,12 @@ class Operations:
|
|||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
_request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
_request.method = "GET"
|
||||
return _request
|
||||
|
||||
def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("OperationList", pipeline_response)
|
||||
|
@ -135,11 +134,11 @@ class Operations:
|
|||
return deserialized.next_link or None, iter(list_of_elem)
|
||||
|
||||
def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
_request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
|
@ -151,5 +150,3 @@ class Operations:
|
|||
return pipeline_response
|
||||
|
||||
return ItemPaged(get_next, extract_data)
|
||||
|
||||
list.metadata = {"url": "/providers/Microsoft.DataBox/operations"}
|
|
@ -1,4 +1,4 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# pylint: disable=too-many-lines,too-many-statements
|
||||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
@ -6,7 +6,9 @@
|
|||
# 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, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
|
||||
from io import IOBase
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.exceptions import (
|
||||
|
@ -19,16 +21,18 @@ from azure.core.exceptions import (
|
|||
)
|
||||
from azure.core.paging import ItemPaged
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.rest import HttpRequest, HttpResponse
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models as _models
|
||||
from ..._serialization import Serializer
|
||||
from .._vendor import DataBoxManagementClientMixinABC, _convert_request, _format_url_section
|
||||
from .._serialization import Serializer
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from collections.abc import MutableMapping
|
||||
else:
|
||||
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
@ -57,7 +61,7 @@ def build_list_available_skus_by_resource_group_request( # pylint: disable=name
|
|||
"location": _SERIALIZER.url("location", location, "str"),
|
||||
}
|
||||
|
||||
_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
|
||||
_url: str = _url.format(**path_format_arguments) # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
@ -88,7 +92,7 @@ def build_validate_address_request(location: str, subscription_id: str, **kwargs
|
|||
"location": _SERIALIZER.url("location", location, "str"),
|
||||
}
|
||||
|
||||
_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
|
||||
_url: str = _url.format(**path_format_arguments) # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
@ -122,7 +126,7 @@ def build_validate_inputs_by_resource_group_request( # pylint: disable=name-too
|
|||
"location": _SERIALIZER.url("location", location, "str"),
|
||||
}
|
||||
|
||||
_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
|
||||
_url: str = _url.format(**path_format_arguments) # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
@ -153,7 +157,7 @@ def build_validate_inputs_request(location: str, subscription_id: str, **kwargs:
|
|||
"location": _SERIALIZER.url("location", location, "str"),
|
||||
}
|
||||
|
||||
_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
|
||||
_url: str = _url.format(**path_format_arguments) # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
@ -184,7 +188,7 @@ def build_region_configuration_request(location: str, subscription_id: str, **kw
|
|||
"location": _SERIALIZER.url("location", location, "str"),
|
||||
}
|
||||
|
||||
_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
|
||||
_url: str = _url.format(**path_format_arguments) # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
@ -218,7 +222,7 @@ def build_region_configuration_by_resource_group_request( # pylint: disable=nam
|
|||
"location": _SERIALIZER.url("location", location, "str"),
|
||||
}
|
||||
|
||||
_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
|
||||
_url: str = _url.format(**path_format_arguments) # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
@ -237,7 +241,7 @@ class ServiceOperations:
|
|||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2022_12_01.DataBoxManagementClient`'s
|
||||
:class:`~azure.mgmt.databox.DataBoxManagementClient`'s
|
||||
:attr:`service` attribute.
|
||||
"""
|
||||
|
||||
|
@ -268,13 +272,12 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2022_12_01.models.AvailableSkuRequest
|
||||
:type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_12_01.models.SkuInformation]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -283,7 +286,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
available_sku_request: IO,
|
||||
available_sku_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
|
@ -296,13 +299,12 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: IO
|
||||
:type available_sku_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_12_01.models.SkuInformation]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -311,7 +313,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
available_sku_request: Union[_models.AvailableSkuRequest, IO],
|
||||
available_sku_request: Union[_models.AvailableSkuRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> Iterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription, resource group and
|
||||
|
@ -322,24 +324,20 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Is either a
|
||||
AvailableSkuRequest type or a IO type. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2022_12_01.models.AvailableSkuRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
AvailableSkuRequest type or a IO[bytes] type. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest or IO[bytes]
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2022_12_01.models.SkuInformation]
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -349,7 +347,7 @@ class ServiceOperations:
|
|||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(available_sku_request, (IO, bytes)):
|
||||
if isinstance(available_sku_request, (IOBase, bytes)):
|
||||
_content = available_sku_request
|
||||
else:
|
||||
_json = self._serialize.body(available_sku_request, "AvailableSkuRequest")
|
||||
|
@ -357,7 +355,7 @@ class ServiceOperations:
|
|||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_available_skus_by_resource_group_request(
|
||||
_request = build_list_available_skus_by_resource_group_request(
|
||||
resource_group_name=resource_group_name,
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
|
@ -365,12 +363,10 @@ class ServiceOperations:
|
|||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.list_available_skus_by_resource_group.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
|
@ -382,13 +378,12 @@ class ServiceOperations:
|
|||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
_request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
_request.method = "GET"
|
||||
return _request
|
||||
|
||||
def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("AvailableSkusResult", pipeline_response)
|
||||
|
@ -398,11 +393,11 @@ class ServiceOperations:
|
|||
return deserialized.next_link or None, iter(list_of_elem)
|
||||
|
||||
def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
_request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
|
@ -415,10 +410,6 @@ class ServiceOperations:
|
|||
|
||||
return ItemPaged(get_next, extract_data)
|
||||
|
||||
list_available_skus_by_resource_group.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"
|
||||
}
|
||||
|
||||
@overload
|
||||
def validate_address(
|
||||
self,
|
||||
|
@ -434,19 +425,18 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2022_12_01.models.ValidateAddress
|
||||
:type validate_address: ~azure.mgmt.databox.models.ValidateAddress
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.AddressValidationOutput
|
||||
:rtype: ~azure.mgmt.databox.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
def validate_address(
|
||||
self, location: str, validate_address: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
self, location: str, validate_address: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer
|
||||
shipping address and provide alternate addresses if any.
|
||||
|
@ -454,19 +444,18 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: IO
|
||||
:type validate_address: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.AddressValidationOutput
|
||||
:rtype: ~azure.mgmt.databox.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace
|
||||
def validate_address(
|
||||
self, location: str, validate_address: Union[_models.ValidateAddress, IO], **kwargs: Any
|
||||
self, location: str, validate_address: Union[_models.ValidateAddress, IO[bytes]], **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""[DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer
|
||||
shipping address and provide alternate addresses if any.
|
||||
|
@ -474,17 +463,13 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Is either a ValidateAddress type or
|
||||
a IO type. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2022_12_01.models.ValidateAddress or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
a IO[bytes] type. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.models.ValidateAddress or IO[bytes]
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.AddressValidationOutput
|
||||
:rtype: ~azure.mgmt.databox.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -495,35 +480,33 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AddressValidationOutput] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validate_address, (IO, bytes)):
|
||||
if isinstance(validate_address, (IOBase, bytes)):
|
||||
_content = validate_address
|
||||
else:
|
||||
_json = self._serialize.body(validate_address, "ValidateAddress")
|
||||
|
||||
request = build_validate_address_request(
|
||||
_request = build_validate_address_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_address.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -533,16 +516,12 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("AddressValidationOutput", pipeline_response)
|
||||
deserialized = self._deserialize("AddressValidationOutput", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_address.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"
|
||||
}
|
||||
return deserialized # type: ignore
|
||||
|
||||
@overload
|
||||
def validate_inputs_by_resource_group(
|
||||
|
@ -561,13 +540,12 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2022_12_01.models.ValidationRequest
|
||||
:type validation_request: ~azure.mgmt.databox.models.ValidationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -576,7 +554,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
validation_request: IO,
|
||||
validation_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
|
@ -588,13 +566,12 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: IO
|
||||
:type validation_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -603,7 +580,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
validation_request: Union[_models.ValidationRequest, IO],
|
||||
validation_request: Union[_models.ValidationRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under resource group.
|
||||
|
@ -612,18 +589,14 @@ class ServiceOperations:
|
|||
:type resource_group_name: str
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a IO
|
||||
type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2022_12_01.models.ValidationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a
|
||||
IO[bytes] type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.models.ValidationRequest or IO[bytes]
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -634,19 +607,19 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validation_request, (IO, bytes)):
|
||||
if isinstance(validation_request, (IOBase, bytes)):
|
||||
_content = validation_request
|
||||
else:
|
||||
_json = self._serialize.body(validation_request, "ValidationRequest")
|
||||
|
||||
request = build_validate_inputs_by_resource_group_request(
|
||||
_request = build_validate_inputs_by_resource_group_request(
|
||||
resource_group_name=resource_group_name,
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
|
@ -654,16 +627,14 @@ class ServiceOperations:
|
|||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_inputs_by_resource_group.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -673,16 +644,12 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response)
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_inputs_by_resource_group.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"
|
||||
}
|
||||
return deserialized # type: ignore
|
||||
|
||||
@overload
|
||||
def validate_inputs(
|
||||
|
@ -698,55 +665,49 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2022_12_01.models.ValidationRequest
|
||||
:type validation_request: ~azure.mgmt.databox.models.ValidationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
def validate_inputs(
|
||||
self, location: str, validation_request: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
self, location: str, validation_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under subscription.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: IO
|
||||
:type validation_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace
|
||||
def validate_inputs(
|
||||
self, location: str, validation_request: Union[_models.ValidationRequest, IO], **kwargs: Any
|
||||
self, location: str, validation_request: Union[_models.ValidationRequest, IO[bytes]], **kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under subscription.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a IO
|
||||
type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2022_12_01.models.ValidationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a
|
||||
IO[bytes] type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.models.ValidationRequest or IO[bytes]
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.ValidationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -757,35 +718,33 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validation_request, (IO, bytes)):
|
||||
if isinstance(validation_request, (IOBase, bytes)):
|
||||
_content = validation_request
|
||||
else:
|
||||
_json = self._serialize.body(validation_request, "ValidationRequest")
|
||||
|
||||
request = build_validate_inputs_request(
|
||||
_request = build_validate_inputs_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_inputs.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -795,16 +754,12 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response)
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_inputs.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"
|
||||
}
|
||||
return deserialized # type: ignore
|
||||
|
||||
@overload
|
||||
def region_configuration(
|
||||
|
@ -822,20 +777,23 @@ class ServiceOperations:
|
|||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region.
|
||||
Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationRequest
|
||||
:type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
def region_configuration(
|
||||
self, location: str, region_configuration_request: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
self,
|
||||
location: str,
|
||||
region_configuration_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.RegionConfigurationResponse:
|
||||
"""This API provides configuration details specific to given region/location at Subscription
|
||||
level.
|
||||
|
@ -844,19 +802,21 @@ class ServiceOperations:
|
|||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region.
|
||||
Required.
|
||||
:type region_configuration_request: IO
|
||||
:type region_configuration_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace
|
||||
def region_configuration(
|
||||
self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **kwargs: Any
|
||||
self,
|
||||
location: str,
|
||||
region_configuration_request: Union[_models.RegionConfigurationRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> _models.RegionConfigurationResponse:
|
||||
"""This API provides configuration details specific to given region/location at Subscription
|
||||
level.
|
||||
|
@ -864,18 +824,14 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region. Is
|
||||
either a RegionConfigurationRequest type or a IO type. Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
either a RegionConfigurationRequest type or a IO[bytes] type. Required.
|
||||
:type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or
|
||||
IO[bytes]
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -886,35 +842,33 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(region_configuration_request, (IO, bytes)):
|
||||
if isinstance(region_configuration_request, (IOBase, bytes)):
|
||||
_content = region_configuration_request
|
||||
else:
|
||||
_json = self._serialize.body(region_configuration_request, "RegionConfigurationRequest")
|
||||
|
||||
request = build_region_configuration_request(
|
||||
_request = build_region_configuration_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.region_configuration.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -924,16 +878,12 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response)
|
||||
deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
region_configuration.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"
|
||||
}
|
||||
return deserialized # type: ignore
|
||||
|
||||
@overload
|
||||
def region_configuration_by_resource_group(
|
||||
|
@ -954,14 +904,12 @@ class ServiceOperations:
|
|||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region at
|
||||
resource group level. Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationRequest
|
||||
:type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -970,7 +918,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
region_configuration_request: IO,
|
||||
region_configuration_request: IO[bytes],
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
|
@ -984,13 +932,12 @@ class ServiceOperations:
|
|||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region at
|
||||
resource group level. Required.
|
||||
:type region_configuration_request: IO
|
||||
:type region_configuration_request: IO[bytes]
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
|
@ -999,7 +946,7 @@ class ServiceOperations:
|
|||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
region_configuration_request: Union[_models.RegionConfigurationRequest, IO],
|
||||
region_configuration_request: Union[_models.RegionConfigurationRequest, IO[bytes]],
|
||||
**kwargs: Any
|
||||
) -> _models.RegionConfigurationResponse:
|
||||
"""This API provides configuration details specific to given region/location at Resource group
|
||||
|
@ -1010,18 +957,15 @@ class ServiceOperations:
|
|||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region at
|
||||
resource group level. Is either a RegionConfigurationRequest type or a IO type. Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
resource group level. Is either a RegionConfigurationRequest type or a IO[bytes] type.
|
||||
Required.
|
||||
:type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest or
|
||||
IO[bytes]
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2022_12_01.models.RegionConfigurationResponse
|
||||
:rtype: ~azure.mgmt.databox.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
|
@ -1032,19 +976,19 @@ class ServiceOperations:
|
|||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01"))
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(region_configuration_request, (IO, bytes)):
|
||||
if isinstance(region_configuration_request, (IOBase, bytes)):
|
||||
_content = region_configuration_request
|
||||
else:
|
||||
_json = self._serialize.body(region_configuration_request, "RegionConfigurationRequest")
|
||||
|
||||
request = build_region_configuration_by_resource_group_request(
|
||||
_request = build_region_configuration_by_resource_group_request(
|
||||
resource_group_name=resource_group_name,
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
|
@ -1052,16 +996,14 @@ class ServiceOperations:
|
|||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.region_configuration_by_resource_group.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
_request.url = self._client.format_url(_request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
_request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
@ -1071,13 +1013,9 @@ class ServiceOperations:
|
|||
error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response)
|
||||
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response)
|
||||
deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response.http_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return cls(pipeline_response, deserialized, {}) # type: ignore
|
||||
|
||||
return deserialized
|
||||
|
||||
region_configuration_by_resource_group.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"
|
||||
}
|
||||
return deserialized # type: ignore
|
|
@ -1,26 +0,0 @@
|
|||
# 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 ._data_box_management_client import DataBoxManagementClient
|
||||
from ._version import VERSION
|
||||
|
||||
__version__ = VERSION
|
||||
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"DataBoxManagementClient",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
|
@ -1,66 +0,0 @@
|
|||
# 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 ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
|
||||
|
||||
from ._version import VERSION
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
|
||||
"""Configuration for DataBoxManagementClient.
|
||||
|
||||
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. Required.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2018-01-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(DataBoxManagementClientConfiguration, self).__init__(**kwargs)
|
||||
api_version: str = kwargs.pop("api_version", "2018-01-01")
|
||||
|
||||
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.")
|
||||
|
||||
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-databox/{}".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.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 = ARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
|
@ -1,97 +0,0 @@
|
|||
# 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 copy import deepcopy
|
||||
from typing import Any, TYPE_CHECKING
|
||||
|
||||
from azure.core.rest import HttpRequest, HttpResponse
|
||||
from azure.mgmt.core import ARMPipelineClient
|
||||
|
||||
from . import models as _models
|
||||
from .._serialization import Deserializer, Serializer
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
from .operations import JobsOperations, Operations, ServiceOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DataBox Client.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.databox.v2018_01_01.operations.Operations
|
||||
:ivar jobs: JobsOperations operations
|
||||
:vartype jobs: azure.mgmt.databox.v2018_01_01.operations.JobsOperations
|
||||
:ivar service: ServiceOperations operations
|
||||
:vartype service: azure.mgmt.databox.v2018_01_01.operations.ServiceOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
:type base_url: str
|
||||
:keyword api_version: Api Version. Default value is "2018-01-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.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "TokenCredential",
|
||||
subscription_id: str,
|
||||
base_url: str = "https://management.azure.com",
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self._config = DataBoxManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
self._client: ARMPipelineClient = ARMPipelineClient(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._serialize.client_side_validation = False
|
||||
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
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/dpcodegen/python/send_request
|
||||
|
||||
: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
|
||||
"""
|
||||
|
||||
request_copy = deepcopy(request)
|
||||
request_copy.url = self._client.format_url(request_copy.url)
|
||||
return self._client.send_request(request_copy, **kwargs)
|
||||
|
||||
def close(self) -> None:
|
||||
self._client.close()
|
||||
|
||||
def __enter__(self) -> "DataBoxManagementClient":
|
||||
self._client.__enter__()
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc_details: Any) -> None:
|
||||
self._client.__exit__(*exc_details)
|
|
@ -1,112 +0,0 @@
|
|||
{
|
||||
"chosen_version": "2018-01-01",
|
||||
"total_api_version_list": ["2018-01-01"],
|
||||
"client": {
|
||||
"name": "DataBoxManagementClient",
|
||||
"filename": "_data_box_management_client",
|
||||
"description": "The DataBox Client.",
|
||||
"host_value": "\"https://management.azure.com\"",
|
||||
"parameterized_host_template": null,
|
||||
"azure_arm": true,
|
||||
"has_lro_operations": true,
|
||||
"client_side_validation": false,
|
||||
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
|
||||
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
|
||||
},
|
||||
"global_parameters": {
|
||||
"sync": {
|
||||
"credential": {
|
||||
"signature": "credential: \"TokenCredential\",",
|
||||
"description": "Credential needed for the client to connect to Azure. Required.",
|
||||
"docstring_type": "~azure.core.credentials.TokenCredential",
|
||||
"required": true,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"subscription_id": {
|
||||
"signature": "subscription_id: str,",
|
||||
"description": "The Subscription Id. Required.",
|
||||
"docstring_type": "str",
|
||||
"required": true,
|
||||
"method_location": "positional"
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"credential": {
|
||||
"signature": "credential: \"AsyncTokenCredential\",",
|
||||
"description": "Credential needed for the client to connect to Azure. Required.",
|
||||
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
|
||||
"required": true
|
||||
},
|
||||
"subscription_id": {
|
||||
"signature": "subscription_id: str,",
|
||||
"description": "The Subscription Id. Required.",
|
||||
"docstring_type": "str",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"constant": {
|
||||
},
|
||||
"call": "credential, subscription_id",
|
||||
"service_client_specific": {
|
||||
"sync": {
|
||||
"api_version": {
|
||||
"signature": "api_version: Optional[str]=None,",
|
||||
"description": "API version to use if no profile is provided, or if missing in profile.",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"base_url": {
|
||||
"signature": "base_url: str = \"https://management.azure.com\",",
|
||||
"description": "Service URL",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"profile": {
|
||||
"signature": "profile: KnownProfiles=KnownProfiles.default,",
|
||||
"description": "A profile definition, from KnownProfiles to dict.",
|
||||
"docstring_type": "azure.profiles.KnownProfiles",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"api_version": {
|
||||
"signature": "api_version: Optional[str] = None,",
|
||||
"description": "API version to use if no profile is provided, or if missing in profile.",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"base_url": {
|
||||
"signature": "base_url: str = \"https://management.azure.com\",",
|
||||
"description": "Service URL",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"profile": {
|
||||
"signature": "profile: KnownProfiles = KnownProfiles.default,",
|
||||
"description": "A profile definition, from KnownProfiles to dict.",
|
||||
"docstring_type": "azure.profiles.KnownProfiles",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"credential": true,
|
||||
"credential_scopes": ["https://management.azure.com/.default"],
|
||||
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
|
||||
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
|
||||
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
|
||||
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
|
||||
},
|
||||
"operation_groups": {
|
||||
"operations": "Operations",
|
||||
"jobs": "JobsOperations",
|
||||
"service": "ServiceOperations"
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
# --------------------------------------------------------------------------
|
||||
# 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 List, cast
|
||||
|
||||
from azure.core.pipeline.transport import HttpRequest
|
||||
|
||||
|
||||
def _convert_request(request, files=None):
|
||||
data = request.content if not files else None
|
||||
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
|
||||
if files:
|
||||
request.set_formdata_body(files)
|
||||
return request
|
||||
|
||||
|
||||
def _format_url_section(template, **kwargs):
|
||||
components = template.split("/")
|
||||
while components:
|
||||
try:
|
||||
return template.format(**kwargs)
|
||||
except KeyError as key:
|
||||
# Need the cast, as for some reasons "split" is typed as list[str | Any]
|
||||
formatted_components = cast(List[str], template.split("/"))
|
||||
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
|
||||
template = "/".join(components)
|
|
@ -1,9 +0,0 @@
|
|||
# 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "2.0.0"
|
|
@ -1,23 +0,0 @@
|
|||
# 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 ._data_box_management_client import DataBoxManagementClient
|
||||
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"DataBoxManagementClient",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
|
@ -1,66 +0,0 @@
|
|||
# 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, AsyncARMChallengeAuthenticationPolicy
|
||||
|
||||
from .._version import VERSION
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
|
||||
"""Configuration for DataBoxManagementClient.
|
||||
|
||||
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. Required.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2018-01-01". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
"""
|
||||
|
||||
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
|
||||
super(DataBoxManagementClientConfiguration, self).__init__(**kwargs)
|
||||
api_version: str = kwargs.pop("api_version", "2018-01-01")
|
||||
|
||||
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.")
|
||||
|
||||
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-databox/{}".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 = AsyncARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
|
@ -1,97 +0,0 @@
|
|||
# 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 copy import deepcopy
|
||||
from typing import Any, Awaitable, TYPE_CHECKING
|
||||
|
||||
from azure.core.rest import AsyncHttpResponse, HttpRequest
|
||||
from azure.mgmt.core import AsyncARMPipelineClient
|
||||
|
||||
from .. import models as _models
|
||||
from ..._serialization import Deserializer, Serializer
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
from .operations import JobsOperations, Operations, ServiceOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DataBox Client.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.databox.v2018_01_01.aio.operations.Operations
|
||||
:ivar jobs: JobsOperations operations
|
||||
:vartype jobs: azure.mgmt.databox.v2018_01_01.aio.operations.JobsOperations
|
||||
:ivar service: ServiceOperations operations
|
||||
:vartype service: azure.mgmt.databox.v2018_01_01.aio.operations.ServiceOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
:type base_url: str
|
||||
:keyword api_version: Api Version. Default value is "2018-01-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.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "AsyncTokenCredential",
|
||||
subscription_id: str,
|
||||
base_url: str = "https://management.azure.com",
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self._config = DataBoxManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
self._client: AsyncARMPipelineClient = 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._serialize.client_side_validation = False
|
||||
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
|
||||
"""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 = await client._send_request(request)
|
||||
<AsyncHttpResponse: 200 OK>
|
||||
|
||||
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
|
||||
|
||||
: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.AsyncHttpResponse
|
||||
"""
|
||||
|
||||
request_copy = deepcopy(request)
|
||||
request_copy.url = self._client.format_url(request_copy.url)
|
||||
return self._client.send_request(request_copy, **kwargs)
|
||||
|
||||
async def close(self) -> None:
|
||||
await self._client.close()
|
||||
|
||||
async def __aenter__(self) -> "DataBoxManagementClient":
|
||||
await self._client.__aenter__()
|
||||
return self
|
||||
|
||||
async def __aexit__(self, *exc_details: Any) -> None:
|
||||
await self._client.__aexit__(*exc_details)
|
|
@ -1,23 +0,0 @@
|
|||
# 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 ._operations import Operations
|
||||
from ._jobs_operations import JobsOperations
|
||||
from ._service_operations import ServiceOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"Operations",
|
||||
"JobsOperations",
|
||||
"ServiceOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,133 +0,0 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# 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, AsyncIterable, Callable, Dict, Optional, TypeVar
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
HttpResponseError,
|
||||
ResourceExistsError,
|
||||
ResourceNotFoundError,
|
||||
ResourceNotModifiedError,
|
||||
map_error,
|
||||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models as _models
|
||||
from ..._vendor import _convert_request
|
||||
from ...operations._operations import build_list_request
|
||||
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
||||
class Operations:
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2018_01_01.aio.DataBoxManagementClient`'s
|
||||
:attr:`operations` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
|
||||
@distributed_trace
|
||||
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
|
||||
"""This method gets all the operations.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either Operation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.Operation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
|
||||
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_request(
|
||||
api_version=api_version,
|
||||
template_url=self.list.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("OperationList", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(get_next, extract_data)
|
||||
|
||||
list.metadata = {"url": "/providers/Microsoft.DataBox/operations"}
|
|
@ -1,325 +0,0 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# 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, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
HttpResponseError,
|
||||
ResourceExistsError,
|
||||
ResourceNotFoundError,
|
||||
ResourceNotModifiedError,
|
||||
map_error,
|
||||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.tracing.decorator_async import distributed_trace_async
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models as _models
|
||||
from ..._vendor import _convert_request
|
||||
from ...operations._service_operations import build_list_available_skus_request, build_validate_address_request
|
||||
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
||||
class ServiceOperations:
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2018_01_01.aio.DataBoxManagementClient`'s
|
||||
:attr:`service` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
|
||||
@overload
|
||||
def list_available_skus(
|
||||
self,
|
||||
location: str,
|
||||
available_sku_request: _models.AvailableSkuRequest,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription and location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2018_01_01.models.AvailableSkuRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
def list_available_skus(
|
||||
self, location: str, available_sku_request: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription and location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace
|
||||
def list_available_skus(
|
||||
self, location: str, available_sku_request: Union[_models.AvailableSkuRequest, IO], **kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription and location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Is either a
|
||||
AvailableSkuRequest type or a IO type. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2018_01_01.models.AvailableSkuRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(available_sku_request, (IO, bytes)):
|
||||
_content = available_sku_request
|
||||
else:
|
||||
_json = self._serialize.body(available_sku_request, "AvailableSkuRequest")
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_available_skus_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.list_available_skus.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("AvailableSkusResult", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(get_next, extract_data)
|
||||
|
||||
list_available_skus.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus"
|
||||
}
|
||||
|
||||
@overload
|
||||
async def validate_address(
|
||||
self,
|
||||
location: str,
|
||||
validate_address: _models.ValidateAddress,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""This method validates the customer shipping address and provide alternate addresses if any.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2018_01_01.models.ValidateAddress
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def validate_address(
|
||||
self, location: str, validate_address: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""This method validates the customer shipping address and provide alternate addresses if any.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def validate_address(
|
||||
self, location: str, validate_address: Union[_models.ValidateAddress, IO], **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""This method validates the customer shipping address and provide alternate addresses if any.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Is either a ValidateAddress type or
|
||||
a IO type. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2018_01_01.models.ValidateAddress or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AddressValidationOutput] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validate_address, (IO, bytes)):
|
||||
_content = validate_address
|
||||
else:
|
||||
_json = self._serialize.body(validate_address, "ValidateAddress")
|
||||
|
||||
request = build_validate_address_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_address.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("AddressValidationOutput", pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_address.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"
|
||||
}
|
|
@ -1,149 +0,0 @@
|
|||
# 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 ._models_py3 import AccountCredentialDetails
|
||||
from ._models_py3 import AddressValidationOutput
|
||||
from ._models_py3 import ApplianceNetworkConfiguration
|
||||
from ._models_py3 import ArmBaseObject
|
||||
from ._models_py3 import AvailableSkuRequest
|
||||
from ._models_py3 import AvailableSkusResult
|
||||
from ._models_py3 import CancellationReason
|
||||
from ._models_py3 import ContactDetails
|
||||
from ._models_py3 import CopyLogDetails
|
||||
from ._models_py3 import CopyProgress
|
||||
from ._models_py3 import DataBoxAccountCopyLogDetails
|
||||
from ._models_py3 import DataBoxDiskCopyLogDetails
|
||||
from ._models_py3 import DataBoxDiskCopyProgress
|
||||
from ._models_py3 import DataBoxDiskJobDetails
|
||||
from ._models_py3 import DataBoxDiskJobSecrets
|
||||
from ._models_py3 import DataBoxHeavyAccountCopyLogDetails
|
||||
from ._models_py3 import DataBoxHeavyJobDetails
|
||||
from ._models_py3 import DataBoxHeavyJobSecrets
|
||||
from ._models_py3 import DataBoxHeavySecret
|
||||
from ._models_py3 import DataBoxJobDetails
|
||||
from ._models_py3 import DataBoxSecret
|
||||
from ._models_py3 import DataboxJobSecrets
|
||||
from ._models_py3 import DestinationAccountDetails
|
||||
from ._models_py3 import DestinationManagedDiskDetails
|
||||
from ._models_py3 import DestinationStorageAccountDetails
|
||||
from ._models_py3 import DestinationToServiceLocationMap
|
||||
from ._models_py3 import DiskSecret
|
||||
from ._models_py3 import Error
|
||||
from ._models_py3 import JobDetails
|
||||
from ._models_py3 import JobErrorDetails
|
||||
from ._models_py3 import JobResource
|
||||
from ._models_py3 import JobResourceList
|
||||
from ._models_py3 import JobResourceUpdateParameter
|
||||
from ._models_py3 import JobSecrets
|
||||
from ._models_py3 import JobStages
|
||||
from ._models_py3 import NotificationPreference
|
||||
from ._models_py3 import Operation
|
||||
from ._models_py3 import OperationDisplay
|
||||
from ._models_py3 import OperationList
|
||||
from ._models_py3 import PackageShippingDetails
|
||||
from ._models_py3 import Preferences
|
||||
from ._models_py3 import Resource
|
||||
from ._models_py3 import ShareCredentialDetails
|
||||
from ._models_py3 import ShipmentPickUpRequest
|
||||
from ._models_py3 import ShipmentPickUpResponse
|
||||
from ._models_py3 import ShippingAddress
|
||||
from ._models_py3 import Sku
|
||||
from ._models_py3 import SkuCapacity
|
||||
from ._models_py3 import SkuCost
|
||||
from ._models_py3 import SkuInformation
|
||||
from ._models_py3 import UnencryptedCredentials
|
||||
from ._models_py3 import UnencryptedCredentialsList
|
||||
from ._models_py3 import UpdateJobDetails
|
||||
from ._models_py3 import ValidateAddress
|
||||
|
||||
from ._data_box_management_client_enums import AccessProtocol
|
||||
from ._data_box_management_client_enums import AddressType
|
||||
from ._data_box_management_client_enums import AddressValidationStatus
|
||||
from ._data_box_management_client_enums import ClassDiscriminator
|
||||
from ._data_box_management_client_enums import CopyStatus
|
||||
from ._data_box_management_client_enums import DataDestinationType
|
||||
from ._data_box_management_client_enums import NotificationStageName
|
||||
from ._data_box_management_client_enums import ShareDestinationFormatType
|
||||
from ._data_box_management_client_enums import SkuDisabledReason
|
||||
from ._data_box_management_client_enums import SkuName
|
||||
from ._data_box_management_client_enums import StageName
|
||||
from ._data_box_management_client_enums import StageStatus
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"AccountCredentialDetails",
|
||||
"AddressValidationOutput",
|
||||
"ApplianceNetworkConfiguration",
|
||||
"ArmBaseObject",
|
||||
"AvailableSkuRequest",
|
||||
"AvailableSkusResult",
|
||||
"CancellationReason",
|
||||
"ContactDetails",
|
||||
"CopyLogDetails",
|
||||
"CopyProgress",
|
||||
"DataBoxAccountCopyLogDetails",
|
||||
"DataBoxDiskCopyLogDetails",
|
||||
"DataBoxDiskCopyProgress",
|
||||
"DataBoxDiskJobDetails",
|
||||
"DataBoxDiskJobSecrets",
|
||||
"DataBoxHeavyAccountCopyLogDetails",
|
||||
"DataBoxHeavyJobDetails",
|
||||
"DataBoxHeavyJobSecrets",
|
||||
"DataBoxHeavySecret",
|
||||
"DataBoxJobDetails",
|
||||
"DataBoxSecret",
|
||||
"DataboxJobSecrets",
|
||||
"DestinationAccountDetails",
|
||||
"DestinationManagedDiskDetails",
|
||||
"DestinationStorageAccountDetails",
|
||||
"DestinationToServiceLocationMap",
|
||||
"DiskSecret",
|
||||
"Error",
|
||||
"JobDetails",
|
||||
"JobErrorDetails",
|
||||
"JobResource",
|
||||
"JobResourceList",
|
||||
"JobResourceUpdateParameter",
|
||||
"JobSecrets",
|
||||
"JobStages",
|
||||
"NotificationPreference",
|
||||
"Operation",
|
||||
"OperationDisplay",
|
||||
"OperationList",
|
||||
"PackageShippingDetails",
|
||||
"Preferences",
|
||||
"Resource",
|
||||
"ShareCredentialDetails",
|
||||
"ShipmentPickUpRequest",
|
||||
"ShipmentPickUpResponse",
|
||||
"ShippingAddress",
|
||||
"Sku",
|
||||
"SkuCapacity",
|
||||
"SkuCost",
|
||||
"SkuInformation",
|
||||
"UnencryptedCredentials",
|
||||
"UnencryptedCredentialsList",
|
||||
"UpdateJobDetails",
|
||||
"ValidateAddress",
|
||||
"AccessProtocol",
|
||||
"AddressType",
|
||||
"AddressValidationStatus",
|
||||
"ClassDiscriminator",
|
||||
"CopyStatus",
|
||||
"DataDestinationType",
|
||||
"NotificationStageName",
|
||||
"ShareDestinationFormatType",
|
||||
"SkuDisabledReason",
|
||||
"SkuName",
|
||||
"StageName",
|
||||
"StageStatus",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
|
@ -1,193 +0,0 @@
|
|||
# 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 enum import Enum
|
||||
from azure.core import CaseInsensitiveEnumMeta
|
||||
|
||||
|
||||
class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""AccessProtocol."""
|
||||
|
||||
SMB = "SMB"
|
||||
"""Server Message Block protocol(SMB)."""
|
||||
NFS = "NFS"
|
||||
"""Network File System protocol(NFS)."""
|
||||
|
||||
|
||||
class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of address."""
|
||||
|
||||
NONE = "None"
|
||||
"""Address type not known."""
|
||||
RESIDENTIAL = "Residential"
|
||||
"""Residential Address."""
|
||||
COMMERCIAL = "Commercial"
|
||||
"""Commercial Address."""
|
||||
|
||||
|
||||
class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The address validation status."""
|
||||
|
||||
VALID = "Valid"
|
||||
"""Address provided is valid."""
|
||||
INVALID = "Invalid"
|
||||
"""Address provided is invalid or not supported."""
|
||||
AMBIGUOUS = "Ambiguous"
|
||||
"""Address provided is ambiguous, please choose one of the alternate addresses returned."""
|
||||
|
||||
|
||||
class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Indicates the type of job details."""
|
||||
|
||||
DATA_BOX = "DataBox"
|
||||
"""DataBox orders."""
|
||||
DATA_BOX_DISK = "DataBoxDisk"
|
||||
"""DataBoxDisk orders."""
|
||||
DATA_BOX_HEAVY = "DataBoxHeavy"
|
||||
"""DataBoxHeavy orders."""
|
||||
|
||||
|
||||
class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The Status of the copy."""
|
||||
|
||||
NOT_STARTED = "NotStarted"
|
||||
"""Data copy hasn't started yet."""
|
||||
IN_PROGRESS = "InProgress"
|
||||
"""Data copy is in progress."""
|
||||
COMPLETED = "Completed"
|
||||
"""Data copy completed."""
|
||||
COMPLETED_WITH_ERRORS = "CompletedWithErrors"
|
||||
"""Data copy completed with errors."""
|
||||
FAILED = "Failed"
|
||||
"""Data copy failed. No data was copied."""
|
||||
NOT_RETURNED = "NotReturned"
|
||||
"""No copy triggered as device was not returned."""
|
||||
|
||||
|
||||
class DataDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Data Destination Type."""
|
||||
|
||||
UNKNOWN_TYPE = "UnknownType"
|
||||
"""Unknown type."""
|
||||
STORAGE_ACCOUNT = "StorageAccount"
|
||||
"""Storage Accounts ."""
|
||||
MANAGED_DISK = "ManagedDisk"
|
||||
"""Azure Managed disk storage."""
|
||||
|
||||
|
||||
class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Name of the stage."""
|
||||
|
||||
DEVICE_PREPARED = "DevicePrepared"
|
||||
"""Notification at device prepared stage."""
|
||||
DISPATCHED = "Dispatched"
|
||||
"""Notification at device dispatched stage."""
|
||||
DELIVERED = "Delivered"
|
||||
"""Notification at device delivered stage."""
|
||||
PICKED_UP = "PickedUp"
|
||||
"""Notification at device picked up from user stage."""
|
||||
AT_AZURE_DC = "AtAzureDC"
|
||||
"""Notification at device received at azure datacenter stage."""
|
||||
DATA_COPY = "DataCopy"
|
||||
"""Notification at data copy started stage."""
|
||||
|
||||
|
||||
class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of the share."""
|
||||
|
||||
UNKNOWN_TYPE = "UnknownType"
|
||||
"""Unknown format."""
|
||||
HCS = "HCS"
|
||||
"""StorSimple data format."""
|
||||
BLOCK_BLOB = "BlockBlob"
|
||||
"""Azure storage block blob format."""
|
||||
PAGE_BLOB = "PageBlob"
|
||||
"""Azure storage page blob format."""
|
||||
AZURE_FILE = "AzureFile"
|
||||
"""Azure storage file format."""
|
||||
MANAGED_DISK = "ManagedDisk"
|
||||
"""Azure Compute Disk."""
|
||||
|
||||
|
||||
class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Reason why the Sku is disabled."""
|
||||
|
||||
NONE = "None"
|
||||
"""SKU is not disabled."""
|
||||
COUNTRY = "Country"
|
||||
"""SKU is not available in the requested country."""
|
||||
REGION = "Region"
|
||||
"""SKU is not available to push data to the requested Azure region."""
|
||||
FEATURE = "Feature"
|
||||
"""Required features are not enabled for the SKU."""
|
||||
OFFER_TYPE = "OfferType"
|
||||
"""Subscription does not have required offer types for the SKU."""
|
||||
NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo"
|
||||
"""Subscription has not registered to Microsoft.DataBox and Service does not have the subscription
|
||||
#: notification."""
|
||||
|
||||
|
||||
class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""SkuName."""
|
||||
|
||||
DATA_BOX = "DataBox"
|
||||
"""DataBox."""
|
||||
DATA_BOX_DISK = "DataBoxDisk"
|
||||
"""DataBoxDisk."""
|
||||
DATA_BOX_HEAVY = "DataBoxHeavy"
|
||||
"""DataBoxHeavy."""
|
||||
|
||||
|
||||
class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Name of the stage which is in progress."""
|
||||
|
||||
DEVICE_ORDERED = "DeviceOrdered"
|
||||
"""An order has been created."""
|
||||
DEVICE_PREPARED = "DevicePrepared"
|
||||
"""A device has been prepared for the order."""
|
||||
DISPATCHED = "Dispatched"
|
||||
"""Device has been dispatched to the user of the order."""
|
||||
DELIVERED = "Delivered"
|
||||
"""Device has been delivered to the user of the order."""
|
||||
PICKED_UP = "PickedUp"
|
||||
"""Device has been picked up from user and in transit to azure datacenter."""
|
||||
AT_AZURE_DC = "AtAzureDC"
|
||||
"""Device has been received at azure datacenter from the user."""
|
||||
DATA_COPY = "DataCopy"
|
||||
"""Data copy from the device at azure datacenter."""
|
||||
COMPLETED = "Completed"
|
||||
"""Order has completed."""
|
||||
COMPLETED_WITH_ERRORS = "CompletedWithErrors"
|
||||
"""Order has completed with errors."""
|
||||
CANCELLED = "Cancelled"
|
||||
"""Order has been cancelled."""
|
||||
FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer"
|
||||
"""Order has failed due to issue reported by user."""
|
||||
FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC"
|
||||
"""Order has failed due to issue detected at azure datacenter."""
|
||||
ABORTED = "Aborted"
|
||||
"""Order has been aborted."""
|
||||
|
||||
|
||||
class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Status of the job stage."""
|
||||
|
||||
NONE = "None"
|
||||
"""No status available yet."""
|
||||
IN_PROGRESS = "InProgress"
|
||||
"""Stage is in progress."""
|
||||
SUCCEEDED = "Succeeded"
|
||||
"""Stage has succeeded."""
|
||||
FAILED = "Failed"
|
||||
"""Stage has failed."""
|
||||
CANCELLED = "Cancelled"
|
||||
"""Stage has been cancelled."""
|
||||
CANCELLING = "Cancelling"
|
||||
"""Stage is cancelling."""
|
||||
SUCCEEDED_WITH_ERRORS = "SucceededWithErrors"
|
||||
"""Stage has succeeded with errors."""
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,23 +0,0 @@
|
|||
# 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 ._operations import Operations
|
||||
from ._jobs_operations import JobsOperations
|
||||
from ._service_operations import ServiceOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"Operations",
|
||||
"JobsOperations",
|
||||
"ServiceOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,154 +0,0 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# 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, Callable, Dict, Iterable, Optional, TypeVar
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
HttpResponseError,
|
||||
ResourceExistsError,
|
||||
ResourceNotFoundError,
|
||||
ResourceNotModifiedError,
|
||||
map_error,
|
||||
)
|
||||
from azure.core.paging import ItemPaged
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models as _models
|
||||
from ..._serialization import Serializer
|
||||
from .._vendor import _convert_request
|
||||
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
_SERIALIZER = Serializer()
|
||||
_SERIALIZER.client_side_validation = False
|
||||
|
||||
|
||||
def build_list_request(**kwargs: Any) -> HttpRequest:
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
|
||||
accept = _headers.pop("Accept", "application/json")
|
||||
|
||||
# Construct URL
|
||||
_url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations")
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
||||
# Construct headers
|
||||
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
||||
|
||||
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
||||
|
||||
|
||||
class Operations:
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2018_01_01.DataBoxManagementClient`'s
|
||||
:attr:`operations` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
|
||||
@distributed_trace
|
||||
def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
|
||||
"""This method gets all the operations.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either Operation or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.Operation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
|
||||
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_request(
|
||||
api_version=api_version,
|
||||
template_url=self.list.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("OperationList", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, iter(list_of_elem)
|
||||
|
||||
def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return ItemPaged(get_next, extract_data)
|
||||
|
||||
list.metadata = {"url": "/providers/Microsoft.DataBox/operations"}
|
|
@ -1,385 +0,0 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# 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, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
HttpResponseError,
|
||||
ResourceExistsError,
|
||||
ResourceNotFoundError,
|
||||
ResourceNotModifiedError,
|
||||
map_error,
|
||||
)
|
||||
from azure.core.paging import ItemPaged
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models as _models
|
||||
from ..._serialization import Serializer
|
||||
from .._vendor import _convert_request, _format_url_section
|
||||
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
_SERIALIZER = Serializer()
|
||||
_SERIALIZER.client_side_validation = False
|
||||
|
||||
|
||||
def build_list_available_skus_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
accept = _headers.pop("Accept", "application/json")
|
||||
|
||||
# Construct URL
|
||||
_url = kwargs.pop(
|
||||
"template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus"
|
||||
) # pylint: disable=line-too-long
|
||||
path_format_arguments = {
|
||||
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
||||
"location": _SERIALIZER.url("location", location, "str"),
|
||||
}
|
||||
|
||||
_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
||||
# Construct headers
|
||||
if content_type is not None:
|
||||
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
|
||||
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
||||
|
||||
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
|
||||
|
||||
|
||||
def build_validate_address_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
accept = _headers.pop("Accept", "application/json")
|
||||
|
||||
# Construct URL
|
||||
_url = kwargs.pop(
|
||||
"template_url",
|
||||
"/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress",
|
||||
) # pylint: disable=line-too-long
|
||||
path_format_arguments = {
|
||||
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
||||
"location": _SERIALIZER.url("location", location, "str"),
|
||||
}
|
||||
|
||||
_url: str = _format_url_section(_url, **path_format_arguments) # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
||||
# Construct headers
|
||||
if content_type is not None:
|
||||
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
|
||||
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
||||
|
||||
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
|
||||
|
||||
|
||||
class ServiceOperations:
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2018_01_01.DataBoxManagementClient`'s
|
||||
:attr:`service` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
|
||||
@overload
|
||||
def list_available_skus(
|
||||
self,
|
||||
location: str,
|
||||
available_sku_request: _models.AvailableSkuRequest,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> Iterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription and location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2018_01_01.models.AvailableSkuRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
def list_available_skus(
|
||||
self, location: str, available_sku_request: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> Iterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription and location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace
|
||||
def list_available_skus(
|
||||
self, location: str, available_sku_request: Union[_models.AvailableSkuRequest, IO], **kwargs: Any
|
||||
) -> Iterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription and location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Is either a
|
||||
AvailableSkuRequest type or a IO type. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2018_01_01.models.AvailableSkuRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(available_sku_request, (IO, bytes)):
|
||||
_content = available_sku_request
|
||||
else:
|
||||
_json = self._serialize.body(available_sku_request, "AvailableSkuRequest")
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_available_skus_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.list_available_skus.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("AvailableSkusResult", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, iter(list_of_elem)
|
||||
|
||||
def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return ItemPaged(get_next, extract_data)
|
||||
|
||||
list_available_skus.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus"
|
||||
}
|
||||
|
||||
@overload
|
||||
def validate_address(
|
||||
self,
|
||||
location: str,
|
||||
validate_address: _models.ValidateAddress,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""This method validates the customer shipping address and provide alternate addresses if any.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2018_01_01.models.ValidateAddress
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
def validate_address(
|
||||
self, location: str, validate_address: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""This method validates the customer shipping address and provide alternate addresses if any.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace
|
||||
def validate_address(
|
||||
self, location: str, validate_address: Union[_models.ValidateAddress, IO], **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""This method validates the customer shipping address and provide alternate addresses if any.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Is either a ValidateAddress type or
|
||||
a IO type. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2018_01_01.models.ValidateAddress or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AddressValidationOutput] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validate_address, (IO, bytes)):
|
||||
_content = validate_address
|
||||
else:
|
||||
_json = self._serialize.body(validate_address, "ValidateAddress")
|
||||
|
||||
request = build_validate_address_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_address.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("AddressValidationOutput", pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_address.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
# Marker file for PEP 561.
|
|
@ -1,26 +0,0 @@
|
|||
# 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 ._data_box_management_client import DataBoxManagementClient
|
||||
from ._version import VERSION
|
||||
|
||||
__version__ = VERSION
|
||||
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"DataBoxManagementClient",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
|
@ -1,66 +0,0 @@
|
|||
# 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 ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
|
||||
|
||||
from ._version import VERSION
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
|
||||
"""Configuration for DataBoxManagementClient.
|
||||
|
||||
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. Required.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2019-09-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(DataBoxManagementClientConfiguration, self).__init__(**kwargs)
|
||||
api_version: str = kwargs.pop("api_version", "2019-09-01")
|
||||
|
||||
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.")
|
||||
|
||||
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-databox/{}".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.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 = ARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
|
@ -1,97 +0,0 @@
|
|||
# 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 copy import deepcopy
|
||||
from typing import Any, TYPE_CHECKING
|
||||
|
||||
from azure.core.rest import HttpRequest, HttpResponse
|
||||
from azure.mgmt.core import ARMPipelineClient
|
||||
|
||||
from . import models as _models
|
||||
from .._serialization import Deserializer, Serializer
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
from .operations import JobsOperations, Operations, ServiceOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DataBox Client.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.databox.v2019_09_01.operations.Operations
|
||||
:ivar jobs: JobsOperations operations
|
||||
:vartype jobs: azure.mgmt.databox.v2019_09_01.operations.JobsOperations
|
||||
:ivar service: ServiceOperations operations
|
||||
:vartype service: azure.mgmt.databox.v2019_09_01.operations.ServiceOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
:type base_url: str
|
||||
:keyword api_version: Api Version. Default value is "2019-09-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.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "TokenCredential",
|
||||
subscription_id: str,
|
||||
base_url: str = "https://management.azure.com",
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self._config = DataBoxManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
self._client: ARMPipelineClient = ARMPipelineClient(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._serialize.client_side_validation = False
|
||||
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
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/dpcodegen/python/send_request
|
||||
|
||||
: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
|
||||
"""
|
||||
|
||||
request_copy = deepcopy(request)
|
||||
request_copy.url = self._client.format_url(request_copy.url)
|
||||
return self._client.send_request(request_copy, **kwargs)
|
||||
|
||||
def close(self) -> None:
|
||||
self._client.close()
|
||||
|
||||
def __enter__(self) -> "DataBoxManagementClient":
|
||||
self._client.__enter__()
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc_details: Any) -> None:
|
||||
self._client.__exit__(*exc_details)
|
|
@ -1,112 +0,0 @@
|
|||
{
|
||||
"chosen_version": "2019-09-01",
|
||||
"total_api_version_list": ["2019-09-01"],
|
||||
"client": {
|
||||
"name": "DataBoxManagementClient",
|
||||
"filename": "_data_box_management_client",
|
||||
"description": "The DataBox Client.",
|
||||
"host_value": "\"https://management.azure.com\"",
|
||||
"parameterized_host_template": null,
|
||||
"azure_arm": true,
|
||||
"has_lro_operations": true,
|
||||
"client_side_validation": false,
|
||||
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
|
||||
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
|
||||
},
|
||||
"global_parameters": {
|
||||
"sync": {
|
||||
"credential": {
|
||||
"signature": "credential: \"TokenCredential\",",
|
||||
"description": "Credential needed for the client to connect to Azure. Required.",
|
||||
"docstring_type": "~azure.core.credentials.TokenCredential",
|
||||
"required": true,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"subscription_id": {
|
||||
"signature": "subscription_id: str,",
|
||||
"description": "The Subscription Id. Required.",
|
||||
"docstring_type": "str",
|
||||
"required": true,
|
||||
"method_location": "positional"
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"credential": {
|
||||
"signature": "credential: \"AsyncTokenCredential\",",
|
||||
"description": "Credential needed for the client to connect to Azure. Required.",
|
||||
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
|
||||
"required": true
|
||||
},
|
||||
"subscription_id": {
|
||||
"signature": "subscription_id: str,",
|
||||
"description": "The Subscription Id. Required.",
|
||||
"docstring_type": "str",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"constant": {
|
||||
},
|
||||
"call": "credential, subscription_id",
|
||||
"service_client_specific": {
|
||||
"sync": {
|
||||
"api_version": {
|
||||
"signature": "api_version: Optional[str]=None,",
|
||||
"description": "API version to use if no profile is provided, or if missing in profile.",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"base_url": {
|
||||
"signature": "base_url: str = \"https://management.azure.com\",",
|
||||
"description": "Service URL",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"profile": {
|
||||
"signature": "profile: KnownProfiles=KnownProfiles.default,",
|
||||
"description": "A profile definition, from KnownProfiles to dict.",
|
||||
"docstring_type": "azure.profiles.KnownProfiles",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"api_version": {
|
||||
"signature": "api_version: Optional[str] = None,",
|
||||
"description": "API version to use if no profile is provided, or if missing in profile.",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"base_url": {
|
||||
"signature": "base_url: str = \"https://management.azure.com\",",
|
||||
"description": "Service URL",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"profile": {
|
||||
"signature": "profile: KnownProfiles = KnownProfiles.default,",
|
||||
"description": "A profile definition, from KnownProfiles to dict.",
|
||||
"docstring_type": "azure.profiles.KnownProfiles",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"credential": true,
|
||||
"credential_scopes": ["https://management.azure.com/.default"],
|
||||
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
|
||||
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
|
||||
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
|
||||
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
|
||||
},
|
||||
"operation_groups": {
|
||||
"operations": "Operations",
|
||||
"jobs": "JobsOperations",
|
||||
"service": "ServiceOperations"
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
|
@ -1,30 +0,0 @@
|
|||
# --------------------------------------------------------------------------
|
||||
# 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 List, cast
|
||||
|
||||
from azure.core.pipeline.transport import HttpRequest
|
||||
|
||||
|
||||
def _convert_request(request, files=None):
|
||||
data = request.content if not files else None
|
||||
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
|
||||
if files:
|
||||
request.set_formdata_body(files)
|
||||
return request
|
||||
|
||||
|
||||
def _format_url_section(template, **kwargs):
|
||||
components = template.split("/")
|
||||
while components:
|
||||
try:
|
||||
return template.format(**kwargs)
|
||||
except KeyError as key:
|
||||
# Need the cast, as for some reasons "split" is typed as list[str | Any]
|
||||
formatted_components = cast(List[str], template.split("/"))
|
||||
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
|
||||
template = "/".join(components)
|
|
@ -1,9 +0,0 @@
|
|||
# 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "2.0.0"
|
|
@ -1,23 +0,0 @@
|
|||
# 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 ._data_box_management_client import DataBoxManagementClient
|
||||
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"DataBoxManagementClient",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
|
@ -1,66 +0,0 @@
|
|||
# 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, AsyncARMChallengeAuthenticationPolicy
|
||||
|
||||
from .._version import VERSION
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
|
||||
"""Configuration for DataBoxManagementClient.
|
||||
|
||||
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. Required.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2019-09-01". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
"""
|
||||
|
||||
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
|
||||
super(DataBoxManagementClientConfiguration, self).__init__(**kwargs)
|
||||
api_version: str = kwargs.pop("api_version", "2019-09-01")
|
||||
|
||||
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.")
|
||||
|
||||
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-databox/{}".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 = AsyncARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
|
@ -1,97 +0,0 @@
|
|||
# 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 copy import deepcopy
|
||||
from typing import Any, Awaitable, TYPE_CHECKING
|
||||
|
||||
from azure.core.rest import AsyncHttpResponse, HttpRequest
|
||||
from azure.mgmt.core import AsyncARMPipelineClient
|
||||
|
||||
from .. import models as _models
|
||||
from ..._serialization import Deserializer, Serializer
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
from .operations import JobsOperations, Operations, ServiceOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DataBox Client.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.databox.v2019_09_01.aio.operations.Operations
|
||||
:ivar jobs: JobsOperations operations
|
||||
:vartype jobs: azure.mgmt.databox.v2019_09_01.aio.operations.JobsOperations
|
||||
:ivar service: ServiceOperations operations
|
||||
:vartype service: azure.mgmt.databox.v2019_09_01.aio.operations.ServiceOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
:type base_url: str
|
||||
:keyword api_version: Api Version. Default value is "2019-09-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.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "AsyncTokenCredential",
|
||||
subscription_id: str,
|
||||
base_url: str = "https://management.azure.com",
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self._config = DataBoxManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
self._client: AsyncARMPipelineClient = 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._serialize.client_side_validation = False
|
||||
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
|
||||
"""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 = await client._send_request(request)
|
||||
<AsyncHttpResponse: 200 OK>
|
||||
|
||||
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
|
||||
|
||||
: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.AsyncHttpResponse
|
||||
"""
|
||||
|
||||
request_copy = deepcopy(request)
|
||||
request_copy.url = self._client.format_url(request_copy.url)
|
||||
return self._client.send_request(request_copy, **kwargs)
|
||||
|
||||
async def close(self) -> None:
|
||||
await self._client.close()
|
||||
|
||||
async def __aenter__(self) -> "DataBoxManagementClient":
|
||||
await self._client.__aenter__()
|
||||
return self
|
||||
|
||||
async def __aexit__(self, *exc_details: Any) -> None:
|
||||
await self._client.__aexit__(*exc_details)
|
|
@ -1,20 +0,0 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
|
@ -1,23 +0,0 @@
|
|||
# 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 ._operations import Operations
|
||||
from ._jobs_operations import JobsOperations
|
||||
from ._service_operations import ServiceOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"Operations",
|
||||
"JobsOperations",
|
||||
"ServiceOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,133 +0,0 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# 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, AsyncIterable, Callable, Dict, Optional, TypeVar
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
HttpResponseError,
|
||||
ResourceExistsError,
|
||||
ResourceNotFoundError,
|
||||
ResourceNotModifiedError,
|
||||
map_error,
|
||||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models as _models
|
||||
from ..._vendor import _convert_request
|
||||
from ...operations._operations import build_list_request
|
||||
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
||||
class Operations:
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2019_09_01.aio.DataBoxManagementClient`'s
|
||||
:attr:`operations` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
|
||||
@distributed_trace
|
||||
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
|
||||
"""This method gets all the operations.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either Operation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.Operation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01"))
|
||||
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_request(
|
||||
api_version=api_version,
|
||||
template_url=self.list.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("OperationList", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(get_next, extract_data)
|
||||
|
||||
list.metadata = {"url": "/providers/Microsoft.DataBox/operations"}
|
|
@ -1,20 +0,0 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
|
@ -1,891 +0,0 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# 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, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
HttpResponseError,
|
||||
ResourceExistsError,
|
||||
ResourceNotFoundError,
|
||||
ResourceNotModifiedError,
|
||||
map_error,
|
||||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.tracing.decorator_async import distributed_trace_async
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models as _models
|
||||
from ..._vendor import _convert_request
|
||||
from ...operations._service_operations import (
|
||||
build_list_available_skus_by_resource_group_request,
|
||||
build_list_available_skus_request,
|
||||
build_region_configuration_request,
|
||||
build_validate_address_request,
|
||||
build_validate_inputs_by_resource_group_request,
|
||||
build_validate_inputs_request,
|
||||
)
|
||||
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
||||
class ServiceOperations:
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2019_09_01.aio.DataBoxManagementClient`'s
|
||||
:attr:`service` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
|
||||
@overload
|
||||
def list_available_skus(
|
||||
self,
|
||||
location: str,
|
||||
available_sku_request: _models.AvailableSkuRequest,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription and location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
def list_available_skus(
|
||||
self, location: str, available_sku_request: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription and location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace
|
||||
def list_available_skus(
|
||||
self, location: str, available_sku_request: Union[_models.AvailableSkuRequest, IO], **kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription and location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Is either a
|
||||
AvailableSkuRequest type or a IO type. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(available_sku_request, (IO, bytes)):
|
||||
_content = available_sku_request
|
||||
else:
|
||||
_json = self._serialize.body(available_sku_request, "AvailableSkuRequest")
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_available_skus_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.list_available_skus.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("AvailableSkusResult", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(get_next, extract_data)
|
||||
|
||||
list_available_skus.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus"
|
||||
}
|
||||
|
||||
@overload
|
||||
def list_available_skus_by_resource_group(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
available_sku_request: _models.AvailableSkuRequest,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription, resource group and
|
||||
location.
|
||||
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
def list_available_skus_by_resource_group(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
available_sku_request: IO,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription, resource group and
|
||||
location.
|
||||
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Required.
|
||||
:type available_sku_request: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace
|
||||
def list_available_skus_by_resource_group(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
available_sku_request: Union[_models.AvailableSkuRequest, IO],
|
||||
**kwargs: Any
|
||||
) -> AsyncIterable["_models.SkuInformation"]:
|
||||
"""This method provides the list of available skus for the given subscription, resource group and
|
||||
location.
|
||||
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param available_sku_request: Filters for showing the available skus. Is either a
|
||||
AvailableSkuRequest type or a IO type. Required.
|
||||
:type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either SkuInformation or the result of cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.SkuInformation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AvailableSkusResult] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(available_sku_request, (IO, bytes)):
|
||||
_content = available_sku_request
|
||||
else:
|
||||
_json = self._serialize.body(available_sku_request, "AvailableSkuRequest")
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_available_skus_by_resource_group_request(
|
||||
resource_group_name=resource_group_name,
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.list_available_skus_by_resource_group.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("AvailableSkusResult", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(get_next, extract_data)
|
||||
|
||||
list_available_skus_by_resource_group.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"
|
||||
}
|
||||
|
||||
@overload
|
||||
async def validate_address(
|
||||
self,
|
||||
location: str,
|
||||
validate_address: _models.ValidateAddress,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""[DEPRECATED NOTICE: This operation will soon be removed] This method validates the customer
|
||||
shipping address and provide alternate addresses if any.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2019_09_01.models.ValidateAddress
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def validate_address(
|
||||
self, location: str, validate_address: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""[DEPRECATED NOTICE: This operation will soon be removed] This method validates the customer
|
||||
shipping address and provide alternate addresses if any.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Required.
|
||||
:type validate_address: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def validate_address(
|
||||
self, location: str, validate_address: Union[_models.ValidateAddress, IO], **kwargs: Any
|
||||
) -> _models.AddressValidationOutput:
|
||||
"""[DEPRECATED NOTICE: This operation will soon be removed] This method validates the customer
|
||||
shipping address and provide alternate addresses if any.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validate_address: Shipping address of the customer. Is either a ValidateAddress type or
|
||||
a IO type. Required.
|
||||
:type validate_address: ~azure.mgmt.databox.v2019_09_01.models.ValidateAddress or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: AddressValidationOutput or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.AddressValidationOutput] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validate_address, (IO, bytes)):
|
||||
_content = validate_address
|
||||
else:
|
||||
_json = self._serialize.body(validate_address, "ValidateAddress")
|
||||
|
||||
request = build_validate_address_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_address.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("AddressValidationOutput", pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_address.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"
|
||||
}
|
||||
|
||||
@overload
|
||||
async def validate_inputs_by_resource_group(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
validation_request: _models.ValidationRequest,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under resource group.
|
||||
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def validate_inputs_by_resource_group(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
validation_request: IO,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under resource group.
|
||||
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def validate_inputs_by_resource_group(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
location: str,
|
||||
validation_request: Union[_models.ValidationRequest, IO],
|
||||
**kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under resource group.
|
||||
|
||||
:param resource_group_name: The Resource Group Name. Required.
|
||||
:type resource_group_name: str
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a IO
|
||||
type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validation_request, (IO, bytes)):
|
||||
_content = validation_request
|
||||
else:
|
||||
_json = self._serialize.body(validation_request, "ValidationRequest")
|
||||
|
||||
request = build_validate_inputs_by_resource_group_request(
|
||||
resource_group_name=resource_group_name,
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_inputs_by_resource_group.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_inputs_by_resource_group.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"
|
||||
}
|
||||
|
||||
@overload
|
||||
async def validate_inputs(
|
||||
self,
|
||||
location: str,
|
||||
validation_request: _models.ValidationRequest,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under subscription.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def validate_inputs(
|
||||
self, location: str, validation_request: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under subscription.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Required.
|
||||
:type validation_request: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def validate_inputs(
|
||||
self, location: str, validation_request: Union[_models.ValidationRequest, IO], **kwargs: Any
|
||||
) -> _models.ValidationResponse:
|
||||
"""This method does all necessary pre-job creation validation under subscription.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param validation_request: Inputs of the customer. Is either a ValidationRequest type or a IO
|
||||
type. Required.
|
||||
:type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ValidationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.ValidationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(validation_request, (IO, bytes)):
|
||||
_content = validation_request
|
||||
else:
|
||||
_json = self._serialize.body(validation_request, "ValidationRequest")
|
||||
|
||||
request = build_validate_inputs_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.validate_inputs.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("ValidationResponse", pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
|
||||
validate_inputs.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"
|
||||
}
|
||||
|
||||
@overload
|
||||
async def region_configuration(
|
||||
self,
|
||||
location: str,
|
||||
region_configuration_request: _models.RegionConfigurationRequest,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.RegionConfigurationResponse:
|
||||
"""This API provides configuration details specific to given region/location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region.
|
||||
Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationRequest
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def region_configuration(
|
||||
self, location: str, region_configuration_request: IO, *, content_type: str = "application/json", **kwargs: Any
|
||||
) -> _models.RegionConfigurationResponse:
|
||||
"""This API provides configuration details specific to given region/location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region.
|
||||
Required.
|
||||
:type region_configuration_request: IO
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def region_configuration(
|
||||
self, location: str, region_configuration_request: Union[_models.RegionConfigurationRequest, IO], **kwargs: Any
|
||||
) -> _models.RegionConfigurationResponse:
|
||||
"""This API provides configuration details specific to given region/location.
|
||||
|
||||
:param location: The location of the resource. Required.
|
||||
:type location: str
|
||||
:param region_configuration_request: Request body to get the configuration for the region. Is
|
||||
either a RegionConfigurationRequest type or a IO type. Required.
|
||||
:type region_configuration_request:
|
||||
~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationRequest or IO
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: RegionConfigurationResponse or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01"))
|
||||
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
||||
cls: ClsType[_models.RegionConfigurationResponse] = kwargs.pop("cls", None)
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(region_configuration_request, (IO, bytes)):
|
||||
_content = region_configuration_request
|
||||
else:
|
||||
_json = self._serialize.body(region_configuration_request, "RegionConfigurationRequest")
|
||||
|
||||
request = build_region_configuration_request(
|
||||
location=location,
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.region_configuration.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize("RegionConfigurationResponse", pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
|
||||
region_configuration.metadata = {
|
||||
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"
|
||||
}
|
|
@ -1,219 +0,0 @@
|
|||
# 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 ._models_py3 import AccountCredentialDetails
|
||||
from ._models_py3 import AddressValidationOutput
|
||||
from ._models_py3 import AddressValidationProperties
|
||||
from ._models_py3 import ApplianceNetworkConfiguration
|
||||
from ._models_py3 import ArmBaseObject
|
||||
from ._models_py3 import AvailableSkuRequest
|
||||
from ._models_py3 import AvailableSkusResult
|
||||
from ._models_py3 import CancellationReason
|
||||
from ._models_py3 import CloudError
|
||||
from ._models_py3 import ContactDetails
|
||||
from ._models_py3 import CopyLogDetails
|
||||
from ._models_py3 import CopyProgress
|
||||
from ._models_py3 import CreateJobValidations
|
||||
from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest
|
||||
from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties
|
||||
from ._models_py3 import DataBoxAccountCopyLogDetails
|
||||
from ._models_py3 import DataBoxDiskCopyLogDetails
|
||||
from ._models_py3 import DataBoxDiskCopyProgress
|
||||
from ._models_py3 import DataBoxDiskJobDetails
|
||||
from ._models_py3 import DataBoxDiskJobSecrets
|
||||
from ._models_py3 import DataBoxHeavyAccountCopyLogDetails
|
||||
from ._models_py3 import DataBoxHeavyJobDetails
|
||||
from ._models_py3 import DataBoxHeavyJobSecrets
|
||||
from ._models_py3 import DataBoxHeavySecret
|
||||
from ._models_py3 import DataBoxJobDetails
|
||||
from ._models_py3 import DataBoxScheduleAvailabilityRequest
|
||||
from ._models_py3 import DataBoxSecret
|
||||
from ._models_py3 import DataDestinationDetailsValidationRequest
|
||||
from ._models_py3 import DataDestinationDetailsValidationResponseProperties
|
||||
from ._models_py3 import DataboxJobSecrets
|
||||
from ._models_py3 import DcAccessSecurityCode
|
||||
from ._models_py3 import DestinationAccountDetails
|
||||
from ._models_py3 import DestinationManagedDiskDetails
|
||||
from ._models_py3 import DestinationStorageAccountDetails
|
||||
from ._models_py3 import DestinationToServiceLocationMap
|
||||
from ._models_py3 import DiskScheduleAvailabilityRequest
|
||||
from ._models_py3 import DiskSecret
|
||||
from ._models_py3 import Error
|
||||
from ._models_py3 import HeavyScheduleAvailabilityRequest
|
||||
from ._models_py3 import JobDeliveryInfo
|
||||
from ._models_py3 import JobDetails
|
||||
from ._models_py3 import JobErrorDetails
|
||||
from ._models_py3 import JobResource
|
||||
from ._models_py3 import JobResourceList
|
||||
from ._models_py3 import JobResourceUpdateParameter
|
||||
from ._models_py3 import JobSecrets
|
||||
from ._models_py3 import JobStages
|
||||
from ._models_py3 import NotificationPreference
|
||||
from ._models_py3 import Operation
|
||||
from ._models_py3 import OperationDisplay
|
||||
from ._models_py3 import OperationList
|
||||
from ._models_py3 import PackageShippingDetails
|
||||
from ._models_py3 import Preferences
|
||||
from ._models_py3 import PreferencesValidationRequest
|
||||
from ._models_py3 import PreferencesValidationResponseProperties
|
||||
from ._models_py3 import RegionConfigurationRequest
|
||||
from ._models_py3 import RegionConfigurationResponse
|
||||
from ._models_py3 import Resource
|
||||
from ._models_py3 import ScheduleAvailabilityRequest
|
||||
from ._models_py3 import ScheduleAvailabilityResponse
|
||||
from ._models_py3 import ShareCredentialDetails
|
||||
from ._models_py3 import ShipmentPickUpRequest
|
||||
from ._models_py3 import ShipmentPickUpResponse
|
||||
from ._models_py3 import ShippingAddress
|
||||
from ._models_py3 import Sku
|
||||
from ._models_py3 import SkuAvailabilityValidationRequest
|
||||
from ._models_py3 import SkuAvailabilityValidationResponseProperties
|
||||
from ._models_py3 import SkuCapacity
|
||||
from ._models_py3 import SkuCost
|
||||
from ._models_py3 import SkuInformation
|
||||
from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest
|
||||
from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties
|
||||
from ._models_py3 import TransportAvailabilityDetails
|
||||
from ._models_py3 import TransportAvailabilityRequest
|
||||
from ._models_py3 import TransportAvailabilityResponse
|
||||
from ._models_py3 import TransportPreferences
|
||||
from ._models_py3 import UnencryptedCredentials
|
||||
from ._models_py3 import UnencryptedCredentialsList
|
||||
from ._models_py3 import UpdateJobDetails
|
||||
from ._models_py3 import ValidateAddress
|
||||
from ._models_py3 import ValidationInputRequest
|
||||
from ._models_py3 import ValidationInputResponse
|
||||
from ._models_py3 import ValidationRequest
|
||||
from ._models_py3 import ValidationResponse
|
||||
|
||||
from ._data_box_management_client_enums import AccessProtocol
|
||||
from ._data_box_management_client_enums import AddressType
|
||||
from ._data_box_management_client_enums import AddressValidationStatus
|
||||
from ._data_box_management_client_enums import ClassDiscriminator
|
||||
from ._data_box_management_client_enums import CopyStatus
|
||||
from ._data_box_management_client_enums import DataDestinationType
|
||||
from ._data_box_management_client_enums import JobDeliveryType
|
||||
from ._data_box_management_client_enums import NotificationStageName
|
||||
from ._data_box_management_client_enums import OverallValidationStatus
|
||||
from ._data_box_management_client_enums import ShareDestinationFormatType
|
||||
from ._data_box_management_client_enums import SkuDisabledReason
|
||||
from ._data_box_management_client_enums import SkuName
|
||||
from ._data_box_management_client_enums import StageName
|
||||
from ._data_box_management_client_enums import StageStatus
|
||||
from ._data_box_management_client_enums import TransportShipmentTypes
|
||||
from ._data_box_management_client_enums import ValidationInputDiscriminator
|
||||
from ._data_box_management_client_enums import ValidationStatus
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"AccountCredentialDetails",
|
||||
"AddressValidationOutput",
|
||||
"AddressValidationProperties",
|
||||
"ApplianceNetworkConfiguration",
|
||||
"ArmBaseObject",
|
||||
"AvailableSkuRequest",
|
||||
"AvailableSkusResult",
|
||||
"CancellationReason",
|
||||
"CloudError",
|
||||
"ContactDetails",
|
||||
"CopyLogDetails",
|
||||
"CopyProgress",
|
||||
"CreateJobValidations",
|
||||
"CreateOrderLimitForSubscriptionValidationRequest",
|
||||
"CreateOrderLimitForSubscriptionValidationResponseProperties",
|
||||
"DataBoxAccountCopyLogDetails",
|
||||
"DataBoxDiskCopyLogDetails",
|
||||
"DataBoxDiskCopyProgress",
|
||||
"DataBoxDiskJobDetails",
|
||||
"DataBoxDiskJobSecrets",
|
||||
"DataBoxHeavyAccountCopyLogDetails",
|
||||
"DataBoxHeavyJobDetails",
|
||||
"DataBoxHeavyJobSecrets",
|
||||
"DataBoxHeavySecret",
|
||||
"DataBoxJobDetails",
|
||||
"DataBoxScheduleAvailabilityRequest",
|
||||
"DataBoxSecret",
|
||||
"DataDestinationDetailsValidationRequest",
|
||||
"DataDestinationDetailsValidationResponseProperties",
|
||||
"DataboxJobSecrets",
|
||||
"DcAccessSecurityCode",
|
||||
"DestinationAccountDetails",
|
||||
"DestinationManagedDiskDetails",
|
||||
"DestinationStorageAccountDetails",
|
||||
"DestinationToServiceLocationMap",
|
||||
"DiskScheduleAvailabilityRequest",
|
||||
"DiskSecret",
|
||||
"Error",
|
||||
"HeavyScheduleAvailabilityRequest",
|
||||
"JobDeliveryInfo",
|
||||
"JobDetails",
|
||||
"JobErrorDetails",
|
||||
"JobResource",
|
||||
"JobResourceList",
|
||||
"JobResourceUpdateParameter",
|
||||
"JobSecrets",
|
||||
"JobStages",
|
||||
"NotificationPreference",
|
||||
"Operation",
|
||||
"OperationDisplay",
|
||||
"OperationList",
|
||||
"PackageShippingDetails",
|
||||
"Preferences",
|
||||
"PreferencesValidationRequest",
|
||||
"PreferencesValidationResponseProperties",
|
||||
"RegionConfigurationRequest",
|
||||
"RegionConfigurationResponse",
|
||||
"Resource",
|
||||
"ScheduleAvailabilityRequest",
|
||||
"ScheduleAvailabilityResponse",
|
||||
"ShareCredentialDetails",
|
||||
"ShipmentPickUpRequest",
|
||||
"ShipmentPickUpResponse",
|
||||
"ShippingAddress",
|
||||
"Sku",
|
||||
"SkuAvailabilityValidationRequest",
|
||||
"SkuAvailabilityValidationResponseProperties",
|
||||
"SkuCapacity",
|
||||
"SkuCost",
|
||||
"SkuInformation",
|
||||
"SubscriptionIsAllowedToCreateJobValidationRequest",
|
||||
"SubscriptionIsAllowedToCreateJobValidationResponseProperties",
|
||||
"TransportAvailabilityDetails",
|
||||
"TransportAvailabilityRequest",
|
||||
"TransportAvailabilityResponse",
|
||||
"TransportPreferences",
|
||||
"UnencryptedCredentials",
|
||||
"UnencryptedCredentialsList",
|
||||
"UpdateJobDetails",
|
||||
"ValidateAddress",
|
||||
"ValidationInputRequest",
|
||||
"ValidationInputResponse",
|
||||
"ValidationRequest",
|
||||
"ValidationResponse",
|
||||
"AccessProtocol",
|
||||
"AddressType",
|
||||
"AddressValidationStatus",
|
||||
"ClassDiscriminator",
|
||||
"CopyStatus",
|
||||
"DataDestinationType",
|
||||
"JobDeliveryType",
|
||||
"NotificationStageName",
|
||||
"OverallValidationStatus",
|
||||
"ShareDestinationFormatType",
|
||||
"SkuDisabledReason",
|
||||
"SkuName",
|
||||
"StageName",
|
||||
"StageStatus",
|
||||
"TransportShipmentTypes",
|
||||
"ValidationInputDiscriminator",
|
||||
"ValidationStatus",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
|
@ -1,264 +0,0 @@
|
|||
# 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 enum import Enum
|
||||
from azure.core import CaseInsensitiveEnumMeta
|
||||
|
||||
|
||||
class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""AccessProtocol."""
|
||||
|
||||
SMB = "SMB"
|
||||
"""Server Message Block protocol(SMB)."""
|
||||
NFS = "NFS"
|
||||
"""Network File System protocol(NFS)."""
|
||||
|
||||
|
||||
class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of address."""
|
||||
|
||||
NONE = "None"
|
||||
"""Address type not known."""
|
||||
RESIDENTIAL = "Residential"
|
||||
"""Residential Address."""
|
||||
COMMERCIAL = "Commercial"
|
||||
"""Commercial Address."""
|
||||
|
||||
|
||||
class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The address validation status."""
|
||||
|
||||
VALID = "Valid"
|
||||
"""Address provided is valid."""
|
||||
INVALID = "Invalid"
|
||||
"""Address provided is invalid or not supported."""
|
||||
AMBIGUOUS = "Ambiguous"
|
||||
"""Address provided is ambiguous, please choose one of the alternate addresses returned."""
|
||||
|
||||
|
||||
class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Indicates the type of job details."""
|
||||
|
||||
DATA_BOX = "DataBox"
|
||||
"""Databox orders."""
|
||||
DATA_BOX_DISK = "DataBoxDisk"
|
||||
"""DataboxDisk orders."""
|
||||
DATA_BOX_HEAVY = "DataBoxHeavy"
|
||||
"""DataboxHeavy orders."""
|
||||
|
||||
|
||||
class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The Status of the copy."""
|
||||
|
||||
NOT_STARTED = "NotStarted"
|
||||
"""Data copy hasn't started yet."""
|
||||
IN_PROGRESS = "InProgress"
|
||||
"""Data copy is in progress."""
|
||||
COMPLETED = "Completed"
|
||||
"""Data copy completed."""
|
||||
COMPLETED_WITH_ERRORS = "CompletedWithErrors"
|
||||
"""Data copy completed with errors."""
|
||||
FAILED = "Failed"
|
||||
"""Data copy failed. No data was copied."""
|
||||
NOT_RETURNED = "NotReturned"
|
||||
"""No copy triggered as device was not returned."""
|
||||
HARDWARE_ERROR = "HardwareError"
|
||||
"""The Device has hit hardware issues."""
|
||||
DEVICE_FORMATTED = "DeviceFormatted"
|
||||
"""Data copy failed. The Device was formatted by user."""
|
||||
DEVICE_METADATA_MODIFIED = "DeviceMetadataModified"
|
||||
"""Data copy failed. Device metadata was modified by user."""
|
||||
STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible"
|
||||
"""Data copy failed. Storage Account was not accessible during copy."""
|
||||
UNSUPPORTED_DATA = "UnsupportedData"
|
||||
"""Data copy failed. The Device data content is not supported."""
|
||||
|
||||
|
||||
class DataDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Data Destination Type."""
|
||||
|
||||
STORAGE_ACCOUNT = "StorageAccount"
|
||||
"""Storage Accounts ."""
|
||||
MANAGED_DISK = "ManagedDisk"
|
||||
"""Azure Managed disk storage."""
|
||||
|
||||
|
||||
class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Delivery type of Job."""
|
||||
|
||||
NON_SCHEDULED = "NonScheduled"
|
||||
"""Non Scheduled job."""
|
||||
SCHEDULED = "Scheduled"
|
||||
"""Scheduled job."""
|
||||
|
||||
|
||||
class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Name of the stage."""
|
||||
|
||||
DEVICE_PREPARED = "DevicePrepared"
|
||||
"""Notification at device prepared stage."""
|
||||
DISPATCHED = "Dispatched"
|
||||
"""Notification at device dispatched stage."""
|
||||
DELIVERED = "Delivered"
|
||||
"""Notification at device delivered stage."""
|
||||
PICKED_UP = "PickedUp"
|
||||
"""Notification at device picked up from user stage."""
|
||||
AT_AZURE_DC = "AtAzureDC"
|
||||
"""Notification at device received at azure datacenter stage."""
|
||||
DATA_COPY = "DataCopy"
|
||||
"""Notification at data copy started stage."""
|
||||
|
||||
|
||||
class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Overall validation status."""
|
||||
|
||||
ALL_VALID_TO_PROCEED = "AllValidToProceed"
|
||||
"""Every input request is valid."""
|
||||
INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired"
|
||||
"""Some input requests are not valid."""
|
||||
CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped"
|
||||
"""Certain input validations skipped."""
|
||||
|
||||
|
||||
class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of the share."""
|
||||
|
||||
UNKNOWN_TYPE = "UnknownType"
|
||||
"""Unknown format."""
|
||||
HCS = "HCS"
|
||||
"""Storsimple data format."""
|
||||
BLOCK_BLOB = "BlockBlob"
|
||||
"""Azure storage block blob format."""
|
||||
PAGE_BLOB = "PageBlob"
|
||||
"""Azure storage page blob format."""
|
||||
AZURE_FILE = "AzureFile"
|
||||
"""Azure storage file format."""
|
||||
MANAGED_DISK = "ManagedDisk"
|
||||
"""Azure Compute Disk."""
|
||||
|
||||
|
||||
class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Reason why the Sku is disabled."""
|
||||
|
||||
NONE = "None"
|
||||
"""SKU is not disabled."""
|
||||
COUNTRY = "Country"
|
||||
"""SKU is not available in the requested country."""
|
||||
REGION = "Region"
|
||||
"""SKU is not available to push data to the requested Azure region."""
|
||||
FEATURE = "Feature"
|
||||
"""Required features are not enabled for the SKU."""
|
||||
OFFER_TYPE = "OfferType"
|
||||
"""Subscription does not have required offer types for the SKU."""
|
||||
NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo"
|
||||
"""Subscription has not registered to Microsoft.DataBox and Service does not have the subscription
|
||||
#: notification."""
|
||||
|
||||
|
||||
class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""SkuName."""
|
||||
|
||||
DATA_BOX = "DataBox"
|
||||
"""Databox."""
|
||||
DATA_BOX_DISK = "DataBoxDisk"
|
||||
"""DataboxDisk."""
|
||||
DATA_BOX_HEAVY = "DataBoxHeavy"
|
||||
"""DataboxHeavy."""
|
||||
|
||||
|
||||
class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Name of the stage which is in progress."""
|
||||
|
||||
DEVICE_ORDERED = "DeviceOrdered"
|
||||
"""An order has been created."""
|
||||
DEVICE_PREPARED = "DevicePrepared"
|
||||
"""A device has been prepared for the order."""
|
||||
DISPATCHED = "Dispatched"
|
||||
"""Device has been dispatched to the user of the order."""
|
||||
DELIVERED = "Delivered"
|
||||
"""Device has been delivered to the user of the order."""
|
||||
PICKED_UP = "PickedUp"
|
||||
"""Device has been picked up from user and in transit to azure datacenter."""
|
||||
AT_AZURE_DC = "AtAzureDC"
|
||||
"""Device has been received at azure datacenter from the user."""
|
||||
DATA_COPY = "DataCopy"
|
||||
"""Data copy from the device at azure datacenter."""
|
||||
COMPLETED = "Completed"
|
||||
"""Order has completed."""
|
||||
COMPLETED_WITH_ERRORS = "CompletedWithErrors"
|
||||
"""Order has completed with errors."""
|
||||
CANCELLED = "Cancelled"
|
||||
"""Order has been cancelled."""
|
||||
FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer"
|
||||
"""Order has failed due to issue reported by user."""
|
||||
FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC"
|
||||
"""Order has failed due to issue detected at azure datacenter."""
|
||||
ABORTED = "Aborted"
|
||||
"""Order has been aborted."""
|
||||
COMPLETED_WITH_WARNINGS = "CompletedWithWarnings"
|
||||
"""Order has completed with warnings."""
|
||||
READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC"
|
||||
"""Device is ready to be handed to customer from Azure DC."""
|
||||
READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC"
|
||||
"""Device can be dropped off at Azure DC."""
|
||||
|
||||
|
||||
class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Status of the job stage."""
|
||||
|
||||
NONE = "None"
|
||||
"""No status available yet."""
|
||||
IN_PROGRESS = "InProgress"
|
||||
"""Stage is in progress."""
|
||||
SUCCEEDED = "Succeeded"
|
||||
"""Stage has succeeded."""
|
||||
FAILED = "Failed"
|
||||
"""Stage has failed."""
|
||||
CANCELLED = "Cancelled"
|
||||
"""Stage has been cancelled."""
|
||||
CANCELLING = "Cancelling"
|
||||
"""Stage is cancelling."""
|
||||
SUCCEEDED_WITH_ERRORS = "SucceededWithErrors"
|
||||
"""Stage has succeeded with errors."""
|
||||
|
||||
|
||||
class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Transport Shipment Type supported for given region."""
|
||||
|
||||
CUSTOMER_MANAGED = "CustomerManaged"
|
||||
"""Shipment Logistics is handled by the customer."""
|
||||
MICROSOFT_MANAGED = "MicrosoftManaged"
|
||||
"""Shipment Logistics is handled by Microsoft."""
|
||||
|
||||
|
||||
class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Identifies the type of validation request."""
|
||||
|
||||
VALIDATE_ADDRESS = "ValidateAddress"
|
||||
"""Identify request and response of address validation."""
|
||||
VALIDATE_DATA_DESTINATION_DETAILS = "ValidateDataDestinationDetails"
|
||||
"""Identify request and response of data destination details validation."""
|
||||
VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob"
|
||||
"""Identify request and response for validation of subscription permission to create job."""
|
||||
VALIDATE_PREFERENCES = "ValidatePreferences"
|
||||
"""Identify request and response of preference validation."""
|
||||
VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit"
|
||||
"""Identify request and response of create order limit for subscription validation."""
|
||||
VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability"
|
||||
"""Identify request and response of active job limit for sku availability."""
|
||||
|
||||
|
||||
class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Create order limit validation status."""
|
||||
|
||||
VALID = "Valid"
|
||||
"""Validation is successful"""
|
||||
INVALID = "Invalid"
|
||||
"""Validation is not successful"""
|
||||
SKIPPED = "Skipped"
|
||||
"""Validation is skipped"""
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,20 +0,0 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
|
@ -1,23 +0,0 @@
|
|||
# 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 ._operations import Operations
|
||||
from ._jobs_operations import JobsOperations
|
||||
from ._service_operations import ServiceOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"Operations",
|
||||
"JobsOperations",
|
||||
"ServiceOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,154 +0,0 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# 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, Callable, Dict, Iterable, Optional, TypeVar
|
||||
import urllib.parse
|
||||
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
HttpResponseError,
|
||||
ResourceExistsError,
|
||||
ResourceNotFoundError,
|
||||
ResourceNotModifiedError,
|
||||
map_error,
|
||||
)
|
||||
from azure.core.paging import ItemPaged
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models as _models
|
||||
from ..._serialization import Serializer
|
||||
from .._vendor import _convert_request
|
||||
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
_SERIALIZER = Serializer()
|
||||
_SERIALIZER.client_side_validation = False
|
||||
|
||||
|
||||
def build_list_request(**kwargs: Any) -> HttpRequest:
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01"))
|
||||
accept = _headers.pop("Accept", "application/json")
|
||||
|
||||
# Construct URL
|
||||
_url = kwargs.pop("template_url", "/providers/Microsoft.DataBox/operations")
|
||||
|
||||
# Construct parameters
|
||||
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
||||
|
||||
# Construct headers
|
||||
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
||||
|
||||
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
||||
|
||||
|
||||
class Operations:
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.databox.v2019_09_01.DataBoxManagementClient`'s
|
||||
:attr:`operations` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
|
||||
@distributed_trace
|
||||
def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
|
||||
"""This method gets all the operations.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either Operation or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.Operation]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01"))
|
||||
cls: ClsType[_models.OperationList] = kwargs.pop("cls", None)
|
||||
|
||||
error_map = {
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
request = build_list_request(
|
||||
api_version=api_version,
|
||||
template_url=self.list.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
|
||||
else:
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urllib.parse.urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(
|
||||
{
|
||||
key: [urllib.parse.quote(v) for v in value]
|
||||
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
||||
}
|
||||
)
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest(
|
||||
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize("OperationList", pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem) # type: ignore
|
||||
return deserialized.next_link or None, iter(list_of_elem)
|
||||
|
||||
def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
_stream = False
|
||||
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
||||
request, stream=_stream, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return ItemPaged(get_next, extract_data)
|
||||
|
||||
list.metadata = {"url": "/providers/Microsoft.DataBox/operations"}
|
|
@ -1,20 +0,0 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1 +0,0 @@
|
|||
# Marker file for PEP 561.
|
|
@ -1,26 +0,0 @@
|
|||
# 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 ._data_box_management_client import DataBoxManagementClient
|
||||
from ._version import VERSION
|
||||
|
||||
__version__ = VERSION
|
||||
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"DataBoxManagementClient",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
|
@ -1,66 +0,0 @@
|
|||
# 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 ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
|
||||
|
||||
from ._version import VERSION
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
|
||||
"""Configuration for DataBoxManagementClient.
|
||||
|
||||
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. Required.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2020-04-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(DataBoxManagementClientConfiguration, self).__init__(**kwargs)
|
||||
api_version: str = kwargs.pop("api_version", "2020-04-01")
|
||||
|
||||
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.")
|
||||
|
||||
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-databox/{}".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.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 = ARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
|
@ -1,97 +0,0 @@
|
|||
# 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 copy import deepcopy
|
||||
from typing import Any, TYPE_CHECKING
|
||||
|
||||
from azure.core.rest import HttpRequest, HttpResponse
|
||||
from azure.mgmt.core import ARMPipelineClient
|
||||
|
||||
from . import models as _models
|
||||
from .._serialization import Deserializer, Serializer
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
from .operations import JobsOperations, Operations, ServiceOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DataBox Client.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.databox.v2020_04_01.operations.Operations
|
||||
:ivar jobs: JobsOperations operations
|
||||
:vartype jobs: azure.mgmt.databox.v2020_04_01.operations.JobsOperations
|
||||
:ivar service: ServiceOperations operations
|
||||
:vartype service: azure.mgmt.databox.v2020_04_01.operations.ServiceOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
:type base_url: str
|
||||
:keyword api_version: Api Version. Default value is "2020-04-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.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "TokenCredential",
|
||||
subscription_id: str,
|
||||
base_url: str = "https://management.azure.com",
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self._config = DataBoxManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
self._client: ARMPipelineClient = ARMPipelineClient(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._serialize.client_side_validation = False
|
||||
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
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/dpcodegen/python/send_request
|
||||
|
||||
: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
|
||||
"""
|
||||
|
||||
request_copy = deepcopy(request)
|
||||
request_copy.url = self._client.format_url(request_copy.url)
|
||||
return self._client.send_request(request_copy, **kwargs)
|
||||
|
||||
def close(self) -> None:
|
||||
self._client.close()
|
||||
|
||||
def __enter__(self) -> "DataBoxManagementClient":
|
||||
self._client.__enter__()
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc_details: Any) -> None:
|
||||
self._client.__exit__(*exc_details)
|
|
@ -1,112 +0,0 @@
|
|||
{
|
||||
"chosen_version": "2020-04-01",
|
||||
"total_api_version_list": ["2020-04-01"],
|
||||
"client": {
|
||||
"name": "DataBoxManagementClient",
|
||||
"filename": "_data_box_management_client",
|
||||
"description": "The DataBox Client.",
|
||||
"host_value": "\"https://management.azure.com\"",
|
||||
"parameterized_host_template": null,
|
||||
"azure_arm": true,
|
||||
"has_lro_operations": true,
|
||||
"client_side_validation": false,
|
||||
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
|
||||
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
|
||||
},
|
||||
"global_parameters": {
|
||||
"sync": {
|
||||
"credential": {
|
||||
"signature": "credential: \"TokenCredential\",",
|
||||
"description": "Credential needed for the client to connect to Azure. Required.",
|
||||
"docstring_type": "~azure.core.credentials.TokenCredential",
|
||||
"required": true,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"subscription_id": {
|
||||
"signature": "subscription_id: str,",
|
||||
"description": "The Subscription Id. Required.",
|
||||
"docstring_type": "str",
|
||||
"required": true,
|
||||
"method_location": "positional"
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"credential": {
|
||||
"signature": "credential: \"AsyncTokenCredential\",",
|
||||
"description": "Credential needed for the client to connect to Azure. Required.",
|
||||
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
|
||||
"required": true
|
||||
},
|
||||
"subscription_id": {
|
||||
"signature": "subscription_id: str,",
|
||||
"description": "The Subscription Id. Required.",
|
||||
"docstring_type": "str",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"constant": {
|
||||
},
|
||||
"call": "credential, subscription_id",
|
||||
"service_client_specific": {
|
||||
"sync": {
|
||||
"api_version": {
|
||||
"signature": "api_version: Optional[str]=None,",
|
||||
"description": "API version to use if no profile is provided, or if missing in profile.",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"base_url": {
|
||||
"signature": "base_url: str = \"https://management.azure.com\",",
|
||||
"description": "Service URL",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"profile": {
|
||||
"signature": "profile: KnownProfiles=KnownProfiles.default,",
|
||||
"description": "A profile definition, from KnownProfiles to dict.",
|
||||
"docstring_type": "azure.profiles.KnownProfiles",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"api_version": {
|
||||
"signature": "api_version: Optional[str] = None,",
|
||||
"description": "API version to use if no profile is provided, or if missing in profile.",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"base_url": {
|
||||
"signature": "base_url: str = \"https://management.azure.com\",",
|
||||
"description": "Service URL",
|
||||
"docstring_type": "str",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
},
|
||||
"profile": {
|
||||
"signature": "profile: KnownProfiles = KnownProfiles.default,",
|
||||
"description": "A profile definition, from KnownProfiles to dict.",
|
||||
"docstring_type": "azure.profiles.KnownProfiles",
|
||||
"required": false,
|
||||
"method_location": "positional"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"credential": true,
|
||||
"credential_scopes": ["https://management.azure.com/.default"],
|
||||
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
|
||||
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
|
||||
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
|
||||
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
|
||||
},
|
||||
"operation_groups": {
|
||||
"operations": "Operations",
|
||||
"jobs": "JobsOperations",
|
||||
"service": "ServiceOperations"
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
|
@ -1,30 +0,0 @@
|
|||
# --------------------------------------------------------------------------
|
||||
# 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 List, cast
|
||||
|
||||
from azure.core.pipeline.transport import HttpRequest
|
||||
|
||||
|
||||
def _convert_request(request, files=None):
|
||||
data = request.content if not files else None
|
||||
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
|
||||
if files:
|
||||
request.set_formdata_body(files)
|
||||
return request
|
||||
|
||||
|
||||
def _format_url_section(template, **kwargs):
|
||||
components = template.split("/")
|
||||
while components:
|
||||
try:
|
||||
return template.format(**kwargs)
|
||||
except KeyError as key:
|
||||
# Need the cast, as for some reasons "split" is typed as list[str | Any]
|
||||
formatted_components = cast(List[str], template.split("/"))
|
||||
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
|
||||
template = "/".join(components)
|
|
@ -1,9 +0,0 @@
|
|||
# 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.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "2.0.0"
|
|
@ -1,23 +0,0 @@
|
|||
# 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 ._data_box_management_client import DataBoxManagementClient
|
||||
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"DataBoxManagementClient",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
|
@ -1,66 +0,0 @@
|
|||
# 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, AsyncARMChallengeAuthenticationPolicy
|
||||
|
||||
from .._version import VERSION
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
|
||||
"""Configuration for DataBoxManagementClient.
|
||||
|
||||
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. Required.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2020-04-01". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
"""
|
||||
|
||||
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
|
||||
super(DataBoxManagementClientConfiguration, self).__init__(**kwargs)
|
||||
api_version: str = kwargs.pop("api_version", "2020-04-01")
|
||||
|
||||
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.")
|
||||
|
||||
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-databox/{}".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 = AsyncARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
|
@ -1,97 +0,0 @@
|
|||
# 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 copy import deepcopy
|
||||
from typing import Any, Awaitable, TYPE_CHECKING
|
||||
|
||||
from azure.core.rest import AsyncHttpResponse, HttpRequest
|
||||
from azure.mgmt.core import AsyncARMPipelineClient
|
||||
|
||||
from .. import models as _models
|
||||
from ..._serialization import Deserializer, Serializer
|
||||
from ._configuration import DataBoxManagementClientConfiguration
|
||||
from .operations import JobsOperations, Operations, ServiceOperations
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
|
||||
class DataBoxManagementClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DataBox Client.
|
||||
|
||||
:ivar operations: Operations operations
|
||||
:vartype operations: azure.mgmt.databox.v2020_04_01.aio.operations.Operations
|
||||
:ivar jobs: JobsOperations operations
|
||||
:vartype jobs: azure.mgmt.databox.v2020_04_01.aio.operations.JobsOperations
|
||||
:ivar service: ServiceOperations operations
|
||||
:vartype service: azure.mgmt.databox.v2020_04_01.aio.operations.ServiceOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription Id. Required.
|
||||
:type subscription_id: str
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
:type base_url: str
|
||||
:keyword api_version: Api Version. Default value is "2020-04-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.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "AsyncTokenCredential",
|
||||
subscription_id: str,
|
||||
base_url: str = "https://management.azure.com",
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self._config = DataBoxManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
self._client: AsyncARMPipelineClient = 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._serialize.client_side_validation = False
|
||||
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
|
||||
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
|
||||
"""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 = await client._send_request(request)
|
||||
<AsyncHttpResponse: 200 OK>
|
||||
|
||||
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
|
||||
|
||||
: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.AsyncHttpResponse
|
||||
"""
|
||||
|
||||
request_copy = deepcopy(request)
|
||||
request_copy.url = self._client.format_url(request_copy.url)
|
||||
return self._client.send_request(request_copy, **kwargs)
|
||||
|
||||
async def close(self) -> None:
|
||||
await self._client.close()
|
||||
|
||||
async def __aenter__(self) -> "DataBoxManagementClient":
|
||||
await self._client.__aenter__()
|
||||
return self
|
||||
|
||||
async def __aexit__(self, *exc_details: Any) -> None:
|
||||
await self._client.__aexit__(*exc_details)
|
|
@ -1,20 +0,0 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
|
@ -1,23 +0,0 @@
|
|||
# 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 ._operations import Operations
|
||||
from ._jobs_operations import JobsOperations
|
||||
from ._service_operations import ServiceOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"Operations",
|
||||
"JobsOperations",
|
||||
"ServiceOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,20 +0,0 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
|
@ -1,257 +0,0 @@
|
|||
# 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 ._models_py3 import AccountCredentialDetails
|
||||
from ._models_py3 import AdditionalErrorInfo
|
||||
from ._models_py3 import AddressValidationOutput
|
||||
from ._models_py3 import AddressValidationProperties
|
||||
from ._models_py3 import ApiError
|
||||
from ._models_py3 import ApplianceNetworkConfiguration
|
||||
from ._models_py3 import ArmBaseObject
|
||||
from ._models_py3 import AvailableSkuRequest
|
||||
from ._models_py3 import AvailableSkusResult
|
||||
from ._models_py3 import AzureFileFilterDetails
|
||||
from ._models_py3 import BlobFilterDetails
|
||||
from ._models_py3 import CancellationReason
|
||||
from ._models_py3 import CloudError
|
||||
from ._models_py3 import ContactDetails
|
||||
from ._models_py3 import CopyLogDetails
|
||||
from ._models_py3 import CopyProgress
|
||||
from ._models_py3 import CreateJobValidations
|
||||
from ._models_py3 import CreateOrderLimitForSubscriptionValidationRequest
|
||||
from ._models_py3 import CreateOrderLimitForSubscriptionValidationResponseProperties
|
||||
from ._models_py3 import DataAccountDetails
|
||||
from ._models_py3 import DataBoxAccountCopyLogDetails
|
||||
from ._models_py3 import DataBoxDiskCopyLogDetails
|
||||
from ._models_py3 import DataBoxDiskCopyProgress
|
||||
from ._models_py3 import DataBoxDiskJobDetails
|
||||
from ._models_py3 import DataBoxDiskJobSecrets
|
||||
from ._models_py3 import DataBoxHeavyAccountCopyLogDetails
|
||||
from ._models_py3 import DataBoxHeavyJobDetails
|
||||
from ._models_py3 import DataBoxHeavyJobSecrets
|
||||
from ._models_py3 import DataBoxHeavySecret
|
||||
from ._models_py3 import DataBoxJobDetails
|
||||
from ._models_py3 import DataBoxScheduleAvailabilityRequest
|
||||
from ._models_py3 import DataBoxSecret
|
||||
from ._models_py3 import DataExportDetails
|
||||
from ._models_py3 import DataImportDetails
|
||||
from ._models_py3 import DataLocationToServiceLocationMap
|
||||
from ._models_py3 import DataTransferDetailsValidationRequest
|
||||
from ._models_py3 import DataTransferDetailsValidationResponseProperties
|
||||
from ._models_py3 import DataboxJobSecrets
|
||||
from ._models_py3 import DcAccessSecurityCode
|
||||
from ._models_py3 import Details
|
||||
from ._models_py3 import DiskScheduleAvailabilityRequest
|
||||
from ._models_py3 import DiskSecret
|
||||
from ._models_py3 import ErrorDetail
|
||||
from ._models_py3 import FilterFileDetails
|
||||
from ._models_py3 import HeavyScheduleAvailabilityRequest
|
||||
from ._models_py3 import JobDeliveryInfo
|
||||
from ._models_py3 import JobDetails
|
||||
from ._models_py3 import JobResource
|
||||
from ._models_py3 import JobResourceList
|
||||
from ._models_py3 import JobResourceUpdateParameter
|
||||
from ._models_py3 import JobSecrets
|
||||
from ._models_py3 import JobStages
|
||||
from ._models_py3 import KeyEncryptionKey
|
||||
from ._models_py3 import ManagedDiskDetails
|
||||
from ._models_py3 import NotificationPreference
|
||||
from ._models_py3 import Operation
|
||||
from ._models_py3 import OperationDisplay
|
||||
from ._models_py3 import OperationList
|
||||
from ._models_py3 import PackageShippingDetails
|
||||
from ._models_py3 import Preferences
|
||||
from ._models_py3 import PreferencesValidationRequest
|
||||
from ._models_py3 import PreferencesValidationResponseProperties
|
||||
from ._models_py3 import RegionConfigurationRequest
|
||||
from ._models_py3 import RegionConfigurationResponse
|
||||
from ._models_py3 import Resource
|
||||
from ._models_py3 import ResourceIdentity
|
||||
from ._models_py3 import ScheduleAvailabilityRequest
|
||||
from ._models_py3 import ScheduleAvailabilityResponse
|
||||
from ._models_py3 import ShareCredentialDetails
|
||||
from ._models_py3 import ShipmentPickUpRequest
|
||||
from ._models_py3 import ShipmentPickUpResponse
|
||||
from ._models_py3 import ShippingAddress
|
||||
from ._models_py3 import Sku
|
||||
from ._models_py3 import SkuAvailabilityValidationRequest
|
||||
from ._models_py3 import SkuAvailabilityValidationResponseProperties
|
||||
from ._models_py3 import SkuCapacity
|
||||
from ._models_py3 import SkuCost
|
||||
from ._models_py3 import SkuInformation
|
||||
from ._models_py3 import StorageAccountDetails
|
||||
from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationRequest
|
||||
from ._models_py3 import SubscriptionIsAllowedToCreateJobValidationResponseProperties
|
||||
from ._models_py3 import TransferAllDetails
|
||||
from ._models_py3 import TransferConfiguration
|
||||
from ._models_py3 import TransferConfigurationTransferAllDetails
|
||||
from ._models_py3 import TransferConfigurationTransferFilterDetails
|
||||
from ._models_py3 import TransferFilterDetails
|
||||
from ._models_py3 import TransportAvailabilityDetails
|
||||
from ._models_py3 import TransportAvailabilityRequest
|
||||
from ._models_py3 import TransportAvailabilityResponse
|
||||
from ._models_py3 import TransportPreferences
|
||||
from ._models_py3 import UnencryptedCredentials
|
||||
from ._models_py3 import UnencryptedCredentialsList
|
||||
from ._models_py3 import UpdateJobDetails
|
||||
from ._models_py3 import ValidateAddress
|
||||
from ._models_py3 import ValidationInputRequest
|
||||
from ._models_py3 import ValidationInputResponse
|
||||
from ._models_py3 import ValidationRequest
|
||||
from ._models_py3 import ValidationResponse
|
||||
|
||||
from ._data_box_management_client_enums import AccessProtocol
|
||||
from ._data_box_management_client_enums import AddressType
|
||||
from ._data_box_management_client_enums import AddressValidationStatus
|
||||
from ._data_box_management_client_enums import ClassDiscriminator
|
||||
from ._data_box_management_client_enums import CopyStatus
|
||||
from ._data_box_management_client_enums import DataAccountType
|
||||
from ._data_box_management_client_enums import FilterFileType
|
||||
from ._data_box_management_client_enums import JobDeliveryType
|
||||
from ._data_box_management_client_enums import KekType
|
||||
from ._data_box_management_client_enums import LogCollectionLevel
|
||||
from ._data_box_management_client_enums import NotificationStageName
|
||||
from ._data_box_management_client_enums import OverallValidationStatus
|
||||
from ._data_box_management_client_enums import ShareDestinationFormatType
|
||||
from ._data_box_management_client_enums import SkuDisabledReason
|
||||
from ._data_box_management_client_enums import SkuName
|
||||
from ._data_box_management_client_enums import StageName
|
||||
from ._data_box_management_client_enums import StageStatus
|
||||
from ._data_box_management_client_enums import TransferConfigurationType
|
||||
from ._data_box_management_client_enums import TransferType
|
||||
from ._data_box_management_client_enums import TransportShipmentTypes
|
||||
from ._data_box_management_client_enums import ValidationInputDiscriminator
|
||||
from ._data_box_management_client_enums import ValidationStatus
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"AccountCredentialDetails",
|
||||
"AdditionalErrorInfo",
|
||||
"AddressValidationOutput",
|
||||
"AddressValidationProperties",
|
||||
"ApiError",
|
||||
"ApplianceNetworkConfiguration",
|
||||
"ArmBaseObject",
|
||||
"AvailableSkuRequest",
|
||||
"AvailableSkusResult",
|
||||
"AzureFileFilterDetails",
|
||||
"BlobFilterDetails",
|
||||
"CancellationReason",
|
||||
"CloudError",
|
||||
"ContactDetails",
|
||||
"CopyLogDetails",
|
||||
"CopyProgress",
|
||||
"CreateJobValidations",
|
||||
"CreateOrderLimitForSubscriptionValidationRequest",
|
||||
"CreateOrderLimitForSubscriptionValidationResponseProperties",
|
||||
"DataAccountDetails",
|
||||
"DataBoxAccountCopyLogDetails",
|
||||
"DataBoxDiskCopyLogDetails",
|
||||
"DataBoxDiskCopyProgress",
|
||||
"DataBoxDiskJobDetails",
|
||||
"DataBoxDiskJobSecrets",
|
||||
"DataBoxHeavyAccountCopyLogDetails",
|
||||
"DataBoxHeavyJobDetails",
|
||||
"DataBoxHeavyJobSecrets",
|
||||
"DataBoxHeavySecret",
|
||||
"DataBoxJobDetails",
|
||||
"DataBoxScheduleAvailabilityRequest",
|
||||
"DataBoxSecret",
|
||||
"DataExportDetails",
|
||||
"DataImportDetails",
|
||||
"DataLocationToServiceLocationMap",
|
||||
"DataTransferDetailsValidationRequest",
|
||||
"DataTransferDetailsValidationResponseProperties",
|
||||
"DataboxJobSecrets",
|
||||
"DcAccessSecurityCode",
|
||||
"Details",
|
||||
"DiskScheduleAvailabilityRequest",
|
||||
"DiskSecret",
|
||||
"ErrorDetail",
|
||||
"FilterFileDetails",
|
||||
"HeavyScheduleAvailabilityRequest",
|
||||
"JobDeliveryInfo",
|
||||
"JobDetails",
|
||||
"JobResource",
|
||||
"JobResourceList",
|
||||
"JobResourceUpdateParameter",
|
||||
"JobSecrets",
|
||||
"JobStages",
|
||||
"KeyEncryptionKey",
|
||||
"ManagedDiskDetails",
|
||||
"NotificationPreference",
|
||||
"Operation",
|
||||
"OperationDisplay",
|
||||
"OperationList",
|
||||
"PackageShippingDetails",
|
||||
"Preferences",
|
||||
"PreferencesValidationRequest",
|
||||
"PreferencesValidationResponseProperties",
|
||||
"RegionConfigurationRequest",
|
||||
"RegionConfigurationResponse",
|
||||
"Resource",
|
||||
"ResourceIdentity",
|
||||
"ScheduleAvailabilityRequest",
|
||||
"ScheduleAvailabilityResponse",
|
||||
"ShareCredentialDetails",
|
||||
"ShipmentPickUpRequest",
|
||||
"ShipmentPickUpResponse",
|
||||
"ShippingAddress",
|
||||
"Sku",
|
||||
"SkuAvailabilityValidationRequest",
|
||||
"SkuAvailabilityValidationResponseProperties",
|
||||
"SkuCapacity",
|
||||
"SkuCost",
|
||||
"SkuInformation",
|
||||
"StorageAccountDetails",
|
||||
"SubscriptionIsAllowedToCreateJobValidationRequest",
|
||||
"SubscriptionIsAllowedToCreateJobValidationResponseProperties",
|
||||
"TransferAllDetails",
|
||||
"TransferConfiguration",
|
||||
"TransferConfigurationTransferAllDetails",
|
||||
"TransferConfigurationTransferFilterDetails",
|
||||
"TransferFilterDetails",
|
||||
"TransportAvailabilityDetails",
|
||||
"TransportAvailabilityRequest",
|
||||
"TransportAvailabilityResponse",
|
||||
"TransportPreferences",
|
||||
"UnencryptedCredentials",
|
||||
"UnencryptedCredentialsList",
|
||||
"UpdateJobDetails",
|
||||
"ValidateAddress",
|
||||
"ValidationInputRequest",
|
||||
"ValidationInputResponse",
|
||||
"ValidationRequest",
|
||||
"ValidationResponse",
|
||||
"AccessProtocol",
|
||||
"AddressType",
|
||||
"AddressValidationStatus",
|
||||
"ClassDiscriminator",
|
||||
"CopyStatus",
|
||||
"DataAccountType",
|
||||
"FilterFileType",
|
||||
"JobDeliveryType",
|
||||
"KekType",
|
||||
"LogCollectionLevel",
|
||||
"NotificationStageName",
|
||||
"OverallValidationStatus",
|
||||
"ShareDestinationFormatType",
|
||||
"SkuDisabledReason",
|
||||
"SkuName",
|
||||
"StageName",
|
||||
"StageStatus",
|
||||
"TransferConfigurationType",
|
||||
"TransferType",
|
||||
"TransportShipmentTypes",
|
||||
"ValidationInputDiscriminator",
|
||||
"ValidationStatus",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
|
@ -1,313 +0,0 @@
|
|||
# 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 enum import Enum
|
||||
from azure.core import CaseInsensitiveEnumMeta
|
||||
|
||||
|
||||
class AccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""AccessProtocol."""
|
||||
|
||||
SMB = "SMB"
|
||||
"""Server Message Block protocol(SMB)."""
|
||||
NFS = "NFS"
|
||||
"""Network File System protocol(NFS)."""
|
||||
|
||||
|
||||
class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of address."""
|
||||
|
||||
NONE = "None"
|
||||
"""Address type not known."""
|
||||
RESIDENTIAL = "Residential"
|
||||
"""Residential Address."""
|
||||
COMMERCIAL = "Commercial"
|
||||
"""Commercial Address."""
|
||||
|
||||
|
||||
class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The address validation status."""
|
||||
|
||||
VALID = "Valid"
|
||||
"""Address provided is valid."""
|
||||
INVALID = "Invalid"
|
||||
"""Address provided is invalid or not supported."""
|
||||
AMBIGUOUS = "Ambiguous"
|
||||
"""Address provided is ambiguous, please choose one of the alternate addresses returned."""
|
||||
|
||||
|
||||
class ClassDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Indicates the type of job details."""
|
||||
|
||||
DATA_BOX = "DataBox"
|
||||
"""Data Box orders."""
|
||||
DATA_BOX_DISK = "DataBoxDisk"
|
||||
"""Data Box Disk orders."""
|
||||
DATA_BOX_HEAVY = "DataBoxHeavy"
|
||||
"""Data Box Heavy orders."""
|
||||
|
||||
|
||||
class CopyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The Status of the copy."""
|
||||
|
||||
NOT_STARTED = "NotStarted"
|
||||
"""Data copy hasn't started yet."""
|
||||
IN_PROGRESS = "InProgress"
|
||||
"""Data copy is in progress."""
|
||||
COMPLETED = "Completed"
|
||||
"""Data copy completed."""
|
||||
COMPLETED_WITH_ERRORS = "CompletedWithErrors"
|
||||
"""Data copy completed with errors."""
|
||||
FAILED = "Failed"
|
||||
"""Data copy failed. No data was copied."""
|
||||
NOT_RETURNED = "NotReturned"
|
||||
"""No copy triggered as device was not returned."""
|
||||
HARDWARE_ERROR = "HardwareError"
|
||||
"""The Device has hit hardware issues."""
|
||||
DEVICE_FORMATTED = "DeviceFormatted"
|
||||
"""Data copy failed. The Device was formatted by user."""
|
||||
DEVICE_METADATA_MODIFIED = "DeviceMetadataModified"
|
||||
"""Data copy failed. Device metadata was modified by user."""
|
||||
STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible"
|
||||
"""Data copy failed. Storage Account was not accessible during copy."""
|
||||
UNSUPPORTED_DATA = "UnsupportedData"
|
||||
"""Data copy failed. The Device data content is not supported."""
|
||||
|
||||
|
||||
class DataAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of the account."""
|
||||
|
||||
STORAGE_ACCOUNT = "StorageAccount"
|
||||
"""Storage Accounts ."""
|
||||
MANAGED_DISK = "ManagedDisk"
|
||||
"""Azure Managed disk storage."""
|
||||
|
||||
|
||||
class FilterFileType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of the filter file."""
|
||||
|
||||
AZURE_BLOB = "AzureBlob"
|
||||
"""Filter file is of the type AzureBlob."""
|
||||
AZURE_FILE = "AzureFile"
|
||||
"""Filter file is of the type AzureFiles."""
|
||||
|
||||
|
||||
class JobDeliveryType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Delivery type of Job."""
|
||||
|
||||
NON_SCHEDULED = "NonScheduled"
|
||||
"""Non Scheduled job."""
|
||||
SCHEDULED = "Scheduled"
|
||||
"""Scheduled job."""
|
||||
|
||||
|
||||
class KekType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of encryption key used for key encryption."""
|
||||
|
||||
MICROSOFT_MANAGED = "MicrosoftManaged"
|
||||
"""Key encryption key is managed by Microsoft."""
|
||||
CUSTOMER_MANAGED = "CustomerManaged"
|
||||
"""Key encryption key is managed by the Customer."""
|
||||
|
||||
|
||||
class LogCollectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Level of the logs to be collected."""
|
||||
|
||||
ERROR = "Error"
|
||||
"""Only Errors will be collected in the logs."""
|
||||
VERBOSE = "Verbose"
|
||||
"""Verbose logging (includes Errors, CRC, size information and others)."""
|
||||
|
||||
|
||||
class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Name of the stage."""
|
||||
|
||||
DEVICE_PREPARED = "DevicePrepared"
|
||||
"""Notification at device prepared stage."""
|
||||
DISPATCHED = "Dispatched"
|
||||
"""Notification at device dispatched stage."""
|
||||
DELIVERED = "Delivered"
|
||||
"""Notification at device delivered stage."""
|
||||
PICKED_UP = "PickedUp"
|
||||
"""Notification at device picked up from user stage."""
|
||||
AT_AZURE_DC = "AtAzureDC"
|
||||
"""Notification at device received at Azure datacenter stage."""
|
||||
DATA_COPY = "DataCopy"
|
||||
"""Notification at data copy started stage."""
|
||||
|
||||
|
||||
class OverallValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Overall validation status."""
|
||||
|
||||
ALL_VALID_TO_PROCEED = "AllValidToProceed"
|
||||
"""Every input request is valid."""
|
||||
INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired"
|
||||
"""Some input requests are not valid."""
|
||||
CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped"
|
||||
"""Certain input validations skipped."""
|
||||
|
||||
|
||||
class ShareDestinationFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of the share."""
|
||||
|
||||
UNKNOWN_TYPE = "UnknownType"
|
||||
"""Unknown format."""
|
||||
HCS = "HCS"
|
||||
"""Storsimple data format."""
|
||||
BLOCK_BLOB = "BlockBlob"
|
||||
"""Azure storage block blob format."""
|
||||
PAGE_BLOB = "PageBlob"
|
||||
"""Azure storage page blob format."""
|
||||
AZURE_FILE = "AzureFile"
|
||||
"""Azure storage file format."""
|
||||
MANAGED_DISK = "ManagedDisk"
|
||||
"""Azure Compute Disk."""
|
||||
|
||||
|
||||
class SkuDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Reason why the Sku is disabled."""
|
||||
|
||||
NONE = "None"
|
||||
"""SKU is not disabled."""
|
||||
COUNTRY = "Country"
|
||||
"""SKU is not available in the requested country."""
|
||||
REGION = "Region"
|
||||
"""SKU is not available to push data to the requested Azure region."""
|
||||
FEATURE = "Feature"
|
||||
"""Required features are not enabled for the SKU."""
|
||||
OFFER_TYPE = "OfferType"
|
||||
"""Subscription does not have required offer types for the SKU."""
|
||||
NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo"
|
||||
"""Subscription has not registered to Microsoft.DataBox and Service does not have the subscription
|
||||
#: notification."""
|
||||
|
||||
|
||||
class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""SkuName."""
|
||||
|
||||
DATA_BOX = "DataBox"
|
||||
"""Data Box."""
|
||||
DATA_BOX_DISK = "DataBoxDisk"
|
||||
"""Data Box Disk."""
|
||||
DATA_BOX_HEAVY = "DataBoxHeavy"
|
||||
"""Data Box Heavy."""
|
||||
|
||||
|
||||
class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Name of the stage which is in progress."""
|
||||
|
||||
DEVICE_ORDERED = "DeviceOrdered"
|
||||
"""An order has been created."""
|
||||
DEVICE_PREPARED = "DevicePrepared"
|
||||
"""A device has been prepared for the order."""
|
||||
DISPATCHED = "Dispatched"
|
||||
"""Device has been dispatched to the user of the order."""
|
||||
DELIVERED = "Delivered"
|
||||
"""Device has been delivered to the user of the order."""
|
||||
PICKED_UP = "PickedUp"
|
||||
"""Device has been picked up from user and in transit to Azure datacenter."""
|
||||
AT_AZURE_DC = "AtAzureDC"
|
||||
"""Device has been received at Azure datacenter from the user."""
|
||||
DATA_COPY = "DataCopy"
|
||||
"""Data copy from the device at Azure datacenter."""
|
||||
COMPLETED = "Completed"
|
||||
"""Order has completed."""
|
||||
COMPLETED_WITH_ERRORS = "CompletedWithErrors"
|
||||
"""Order has completed with errors."""
|
||||
CANCELLED = "Cancelled"
|
||||
"""Order has been cancelled."""
|
||||
FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer"
|
||||
"""Order has failed due to issue reported by user."""
|
||||
FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC"
|
||||
"""Order has failed due to issue detected at Azure datacenter."""
|
||||
ABORTED = "Aborted"
|
||||
"""Order has been aborted."""
|
||||
COMPLETED_WITH_WARNINGS = "CompletedWithWarnings"
|
||||
"""Order has completed with warnings."""
|
||||
READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC"
|
||||
"""Device is ready to be handed to customer from Azure DC."""
|
||||
READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC"
|
||||
"""Device can be dropped off at Azure DC."""
|
||||
|
||||
|
||||
class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Status of the job stage."""
|
||||
|
||||
NONE = "None"
|
||||
"""No status available yet."""
|
||||
IN_PROGRESS = "InProgress"
|
||||
"""Stage is in progress."""
|
||||
SUCCEEDED = "Succeeded"
|
||||
"""Stage has succeeded."""
|
||||
FAILED = "Failed"
|
||||
"""Stage has failed."""
|
||||
CANCELLED = "Cancelled"
|
||||
"""Stage has been cancelled."""
|
||||
CANCELLING = "Cancelling"
|
||||
"""Stage is cancelling."""
|
||||
SUCCEEDED_WITH_ERRORS = "SucceededWithErrors"
|
||||
"""Stage has succeeded with errors."""
|
||||
WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction"
|
||||
"""Stage is stuck until customer takes some action."""
|
||||
SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings"
|
||||
"""Stage has succeeded with warnings."""
|
||||
|
||||
|
||||
class TransferConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of the configuration for transfer."""
|
||||
|
||||
TRANSFER_ALL = "TransferAll"
|
||||
"""Transfer all the data."""
|
||||
TRANSFER_USING_FILTER = "TransferUsingFilter"
|
||||
"""Transfer using filter."""
|
||||
|
||||
|
||||
class TransferType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Type of the transfer."""
|
||||
|
||||
IMPORT_TO_AZURE = "ImportToAzure"
|
||||
"""Import data to azure."""
|
||||
EXPORT_FROM_AZURE = "ExportFromAzure"
|
||||
"""Export data from azure."""
|
||||
|
||||
|
||||
class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Transport Shipment Type supported for given region."""
|
||||
|
||||
CUSTOMER_MANAGED = "CustomerManaged"
|
||||
"""Shipment Logistics is handled by the customer."""
|
||||
MICROSOFT_MANAGED = "MicrosoftManaged"
|
||||
"""Shipment Logistics is handled by Microsoft."""
|
||||
|
||||
|
||||
class ValidationInputDiscriminator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Identifies the type of validation request."""
|
||||
|
||||
VALIDATE_ADDRESS = "ValidateAddress"
|
||||
"""Identify request and response of address validation."""
|
||||
VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob"
|
||||
"""Identify request and response for validation of subscription permission to create job."""
|
||||
VALIDATE_PREFERENCES = "ValidatePreferences"
|
||||
"""Identify request and response of preference validation."""
|
||||
VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit"
|
||||
"""Identify request and response of create order limit for subscription validation."""
|
||||
VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability"
|
||||
"""Identify request and response of active job limit for sku availability."""
|
||||
VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails"
|
||||
"""Identify request and response of data transfer details validation."""
|
||||
|
||||
|
||||
class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Create order limit validation status."""
|
||||
|
||||
VALID = "Valid"
|
||||
"""Validation is successful"""
|
||||
INVALID = "Invalid"
|
||||
"""Validation is not successful"""
|
||||
SKIPPED = "Skipped"
|
||||
"""Validation is skipped"""
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,20 +0,0 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
|
@ -1,23 +0,0 @@
|
|||
# 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 ._operations import Operations
|
||||
from ._jobs_operations import JobsOperations
|
||||
from ._service_operations import ServiceOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
"Operations",
|
||||
"JobsOperations",
|
||||
"ServiceOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче