diff --git a/sdk/databox/azure-mgmt-databox/_meta.json b/sdk/databox/azure-mgmt-databox/_meta.json new file mode 100644 index 000000000000..f829b9032e92 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.7.2", + "use": [ + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" + ], + "commit": "1659cfde425308fc46b5f2cd962c3be40ba04ace", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/databox/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "readme": "specification/databox/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py index 5b8f07cf262d..f357b4d693b5 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_configuration.py @@ -8,14 +8,19 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from typing import Any +from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential class DataBoxManagementClientConfiguration(Configuration): """Configuration for DataBoxManagementClient. @@ -63,4 +68,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py index 7706fb0d1a02..e4762c5cd90f 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_data_box_management_client.py @@ -9,12 +9,21 @@ # regenerated. # -------------------------------------------------------------------------- -from azure.mgmt.core import ARMPipelineClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING +from azure.mgmt.core import ARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin +from msrest import Deserializer, Serializer + from ._configuration import DataBoxManagementClientConfiguration +from ._operations_mixin import DataBoxManagementClientOperationsMixin + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -23,7 +32,7 @@ def __init__(self, *args, **kwargs): """ pass -class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): """The DataBox Client. This ready contains multiple API versions, to help you deal with all of the Azure clouds @@ -38,15 +47,16 @@ class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str api_version: API version to use if no profile is provided, or if - missing in profile. - :param str base_url: Service URL + :param api_version: API version to use if no profile is provided, or if missing in profile. + :type api_version: str + :param base_url: Service URL + :type base_url: str :param profile: A profile definition, from KnownProfiles to dict. :type profile: azure.profiles.KnownProfiles :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2020-11-01' + DEFAULT_API_VERSION = '2021-05-01' _PROFILE_TAG = "azure.mgmt.databox.DataBoxManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -59,13 +69,11 @@ def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str - api_version=None, - base_url=None, - profile=KnownProfiles.default, + api_version=None, # type: Optional[str] + base_url="https://management.azure.com", # type: str + profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): - if not base_url: - base_url = 'https://management.azure.com' self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(DataBoxManagementClient, self).__init__( @@ -85,6 +93,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-09-01: :mod:`v2019_09_01.models` * 2020-04-01: :mod:`v2020_04_01.models` * 2020-11-01: :mod:`v2020_11_01.models` + * 2021-03-01: :mod:`v2021_03_01.models` + * 2021-05-01: :mod:`v2021_05_01.models` + * 2021-08-01-preview: :mod:`v2021_08_01_preview.models` """ if api_version == '2018-01-01': from .v2018_01_01 import models @@ -98,6 +109,15 @@ def models(cls, api_version=DEFAULT_API_VERSION): 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 raise ValueError("API version {} is not available".format(api_version)) @property @@ -108,6 +128,9 @@ def jobs(self): * 2019-09-01: :class:`JobsOperations` * 2020-04-01: :class:`JobsOperations` * 2020-11-01: :class:`JobsOperations` + * 2021-03-01: :class:`JobsOperations` + * 2021-05-01: :class:`JobsOperations` + * 2021-08-01-preview: :class:`JobsOperations` """ api_version = self._get_api_version('jobs') if api_version == '2018-01-01': @@ -118,6 +141,12 @@ def jobs(self): 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 else: raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -130,6 +159,9 @@ def operations(self): * 2019-09-01: :class:`Operations` * 2020-04-01: :class:`Operations` * 2020-11-01: :class:`Operations` + * 2021-03-01: :class:`Operations` + * 2021-05-01: :class:`Operations` + * 2021-08-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-01-01': @@ -140,6 +172,12 @@ def operations(self): 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 else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -152,6 +190,9 @@ def service(self): * 2019-09-01: :class:`ServiceOperations` * 2020-04-01: :class:`ServiceOperations` * 2020-11-01: :class:`ServiceOperations` + * 2021-03-01: :class:`ServiceOperations` + * 2021-05-01: :class:`ServiceOperations` + * 2021-08-01-preview: :class:`ServiceOperations` """ api_version = self._get_api_version('service') if api_version == '2018-01-01': @@ -162,6 +203,12 @@ def service(self): 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 else: raise ValueError("API version {} does not have operation group 'service'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_operations_mixin.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_operations_mixin.py new file mode 100644 index 000000000000..4cb8eb5b62be --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/_operations_mixin.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + +class DataBoxManagementClientOperationsMixin(object): + + def mitigate( + self, + job_name, # type: str + resource_group_name, # type: str + mitigate_job_request, # type: "_models.MitigateJobRequest" + **kwargs # type: Any + ): + # type: (...) -> 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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. + :type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest + :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 + 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._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) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_configuration.py index 71fd4699f32f..7338545dc65b 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_configuration.py @@ -8,14 +8,17 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from typing import Any +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from 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): """Configuration for DataBoxManagementClient. @@ -31,8 +34,8 @@ class DataBoxManagementClientConfiguration(Configuration): def __init__( self, - credential, # type: "AsyncTokenCredential" - subscription_id, # type: str + credential: "AsyncTokenCredential", + subscription_id: str, **kwargs # type: Any ) -> None: if credential is None: @@ -61,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_data_box_management_client.py index 3d3baff15744..49234df19c24 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_data_box_management_client.py @@ -9,12 +9,20 @@ # regenerated. # -------------------------------------------------------------------------- -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Serializer, Deserializer +from typing import Any, Optional, TYPE_CHECKING +from azure.mgmt.core import AsyncARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin +from msrest import Deserializer, Serializer + from ._configuration import DataBoxManagementClientConfiguration +from ._operations_mixin import DataBoxManagementClientOperationsMixin + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + from azure.core.credentials_async import AsyncTokenCredential class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -23,7 +31,7 @@ def __init__(self, *args, **kwargs): """ pass -class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): """The DataBox Client. This ready contains multiple API versions, to help you deal with all of the Azure clouds @@ -38,15 +46,16 @@ class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str api_version: API version to use if no profile is provided, or if - missing in profile. - :param str base_url: Service URL + :param api_version: API version to use if no profile is provided, or if missing in profile. + :type api_version: str + :param base_url: Service URL + :type base_url: str :param profile: A profile definition, from KnownProfiles to dict. :type profile: azure.profiles.KnownProfiles :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2020-11-01' + DEFAULT_API_VERSION = '2021-05-01' _PROFILE_TAG = "azure.mgmt.databox.DataBoxManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -57,15 +66,13 @@ class DataBoxManagementClient(MultiApiClientMixin, _SDKClient): def __init__( self, - credential, # type: "AsyncTokenCredential" - subscription_id, # type: str - api_version=None, - base_url=None, - profile=KnownProfiles.default, + credential: "AsyncTokenCredential", + subscription_id: str, + api_version: Optional[str] = None, + base_url: str = "https://management.azure.com", + profile: KnownProfiles = KnownProfiles.default, **kwargs # type: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(DataBoxManagementClient, self).__init__( @@ -85,6 +92,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-09-01: :mod:`v2019_09_01.models` * 2020-04-01: :mod:`v2020_04_01.models` * 2020-11-01: :mod:`v2020_11_01.models` + * 2021-03-01: :mod:`v2021_03_01.models` + * 2021-05-01: :mod:`v2021_05_01.models` + * 2021-08-01-preview: :mod:`v2021_08_01_preview.models` """ if api_version == '2018-01-01': from ..v2018_01_01 import models @@ -98,6 +108,15 @@ def models(cls, api_version=DEFAULT_API_VERSION): 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 raise ValueError("API version {} is not available".format(api_version)) @property @@ -108,6 +127,9 @@ def jobs(self): * 2019-09-01: :class:`JobsOperations` * 2020-04-01: :class:`JobsOperations` * 2020-11-01: :class:`JobsOperations` + * 2021-03-01: :class:`JobsOperations` + * 2021-05-01: :class:`JobsOperations` + * 2021-08-01-preview: :class:`JobsOperations` """ api_version = self._get_api_version('jobs') if api_version == '2018-01-01': @@ -118,6 +140,12 @@ def jobs(self): 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 else: raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -130,6 +158,9 @@ def operations(self): * 2019-09-01: :class:`Operations` * 2020-04-01: :class:`Operations` * 2020-11-01: :class:`Operations` + * 2021-03-01: :class:`Operations` + * 2021-05-01: :class:`Operations` + * 2021-08-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-01-01': @@ -140,6 +171,12 @@ def operations(self): 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 else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -152,6 +189,9 @@ def service(self): * 2019-09-01: :class:`ServiceOperations` * 2020-04-01: :class:`ServiceOperations` * 2020-11-01: :class:`ServiceOperations` + * 2021-03-01: :class:`ServiceOperations` + * 2021-05-01: :class:`ServiceOperations` + * 2021-08-01-preview: :class:`ServiceOperations` """ api_version = self._get_api_version('service') if api_version == '2018-01-01': @@ -162,6 +202,12 @@ def service(self): 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 else: raise ValueError("API version {} does not have operation group 'service'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_operations_mixin.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_operations_mixin.py new file mode 100644 index 000000000000..e6377a9935fb --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/aio/_operations_mixin.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrest import Serializer, Deserializer +from typing import Any, Optional + + +class DataBoxManagementClientOperationsMixin(object): + + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: "_models.MitigateJobRequest", + **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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. + :type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest + :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 + 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._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) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py index 3194fab613a3..ce393b27bae3 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/models.py @@ -4,4 +4,4 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2020_11_01.models import * +from .v2021_05_01.models import * diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/__init__.py index ae972ed54f84..72afe00aa0a1 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['DataBoxManagementClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_configuration.py index 0f732507656b..d708e6e0beac 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_configuration.py @@ -6,18 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential @@ -35,16 +33,15 @@ class DataBoxManagementClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) 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 @@ -68,4 +65,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_data_box_management_client.py index e696cb06a780..482c21f2e647 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_data_box_management_client.py @@ -6,65 +6,84 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import JobsOperations, Operations, ServiceOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from . import models - - -class DataBoxManagementClient(object): +class DataBoxManagementClient: """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations + :vartype operations: azure.mgmt.databox.v2018_01_01.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2018_01_01.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations + :vartype service: azure.mgmt.databox.v2018_01_01.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + 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(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._serialize.client_side_validation = False 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, # type: 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/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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 + """ - 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) + 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): # type: () -> None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_metadata.json index 2f491dd3621f..538a7616da27 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_metadata.json +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_metadata.json @@ -5,11 +5,13 @@ "name": "DataBoxManagementClient", "filename": "_data_box_management_client", "description": "The DataBox Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The Subscription Id.", "docstring_type": "str", "required": true @@ -42,22 +44,61 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "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" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_version.py index eae7c95b6fbd..e5754a47ce68 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_version.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0b1" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/__init__.py index bb6b75a72db8..c57c5574bdd0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._data_box_management_client import DataBoxManagementClient __all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_configuration.py index 9eb0b463e8f5..a05401d01b0b 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -37,11 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) 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 @@ -64,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_data_box_management_client.py index b192ff7cd771..39e133355c2f 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_data_box_management_client.py @@ -6,62 +6,84 @@ # 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, Optional, TYPE_CHECKING +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +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 -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from .. import models - - -class DataBoxManagementClient(object): +class DataBoxManagementClient: """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.aio.operations.Operations + :vartype operations: azure.mgmt.databox.v2018_01_01.aio.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2018_01_01.aio.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.aio.operations.ServiceOperations + :vartype service: azure.mgmt.databox.v2018_01_01.aio.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataBoxManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False 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/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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 + """ - 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) + 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() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_jobs_operations.py index 0a54ebde341c..d224119a2fff 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_jobs_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._jobs_operations import build_book_shipment_pick_up_request, build_cancel_request, build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_credentials_request, build_list_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -28,7 +33,7 @@ class JobsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2018_01_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -43,10 +48,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResourceList"]: """Lists all the jobs available under the subscription. @@ -55,7 +61,8 @@ def list( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -63,36 +70,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,16 +112,18 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResourceList"]: """Lists all the jobs available under the given resource group. @@ -130,7 +134,8 @@ def list_by_resource_group( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -138,37 +143,33 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,17 +187,19 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, job_name: str, expand: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.JobResource": """Gets information about the specified job. @@ -210,7 +213,7 @@ async def get( :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource + :rtype: ~azure.mgmt.databox.v2018_01_01.models.JobResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] @@ -218,29 +221,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,46 +246,38 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + async def _create_initial( self, resource_group_name: str, job_name: str, job_resource: "_models.JobResource", - **kwargs + **kwargs: Any ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -309,14 +293,17 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, resource_group_name: str, job_name: str, job_resource: "_models.JobResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.JobResource"]: """Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. @@ -327,18 +314,22 @@ async def begin_create( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource: Job details from request body. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :type job_resource: ~azure.mgmt.databox.v2018_01_01.models.JobResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2018_01_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -350,27 +341,21 @@ async def begin_create( resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -382,38 +367,31 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore async def _delete_initial( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -426,11 +404,13 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a job. @@ -441,15 +421,17 @@ async def begin_delete( :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -463,21 +445,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -489,6 +464,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore async def _update_initial( @@ -497,41 +473,30 @@ async def _update_initial( job_name: str, job_resource_update_parameter: "_models.JobResourceUpdateParameter", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -547,15 +512,18 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, resource_group_name: str, job_name: str, job_resource_update_parameter: "_models.JobResourceUpdateParameter", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.JobResource"]: """Updates the properties of an existing job. @@ -565,21 +533,26 @@ async def begin_update( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2018_01_01.models.JobResourceUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2018_01_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -592,27 +565,21 @@ async def begin_update( job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -624,14 +591,16 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + @distributed_trace_async async def book_shipment_pick_up( self, resource_group_name: str, job_name: str, shipment_pick_up_request: "_models.ShipmentPickUpRequest", - **kwargs + **kwargs: Any ) -> "_models.ShipmentPickUpResponse": """Book shipment pick up. @@ -641,10 +610,10 @@ async def book_shipment_pick_up( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :type shipment_pick_up_request: ~azure.mgmt.databox.v2018_01_01.models.ShipmentPickUpRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.v2018_01_01.models.ShipmentPickUpResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] @@ -652,32 +621,22 @@ async def book_shipment_pick_up( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -691,14 +650,17 @@ async def book_shipment_pick_up( return cls(pipeline_response, deserialized, {}) return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + @distributed_trace_async async def cancel( self, resource_group_name: str, job_name: str, cancellation_reason: "_models.CancellationReason", - **kwargs + **kwargs: Any ) -> None: """CancelJob. @@ -708,7 +670,7 @@ async def cancel( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :type cancellation_reason: ~azure.mgmt.databox.v2018_01_01.models.CancellationReason :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 @@ -719,30 +681,22 @@ async def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -755,11 +709,13 @@ async def cancel( cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + @distributed_trace def list_credentials( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: """This method gets the unencrypted secrets related to the job. @@ -769,8 +725,10 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.UnencryptedCredentialsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] @@ -778,36 +736,33 @@ def list_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -825,6 +780,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_operations.py index f0dde5272cb2..6d2d396b3f41 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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]] @@ -26,7 +31,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2018_01_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,15 +46,17 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationList"]: """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 OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.OperationList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + 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) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_service_operations.py index 10e5b276c56f..75f1fad29910 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_service_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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]] @@ -26,7 +31,7 @@ class ServiceOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2018_01_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,65 +46,63 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_available_skus( self, location: str, available_sku_request: "_models.AvailableSkuRequest", - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription and location. :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2018_01_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2018_01_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,26 +120,28 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + @distributed_trace_async async def validate_address( self, location: str, validate_address: "_models.ValidateAddress", - **kwargs + **kwargs: Any ) -> "_models.AddressValidationOutput": """This method validates the customer shipping address and provide alternate addresses if any. :param location: The location of the resource. :type location: str :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :type validate_address: ~azure.mgmt.databox.v2018_01_01.models.ValidateAddress :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.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] @@ -144,31 +149,21 @@ async def validate_address( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -182,4 +177,6 @@ async def validate_address( return cls(pipeline_response, deserialized, {}) return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/__init__.py index b69af98fbdea..329f0873a572 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/__init__.py @@ -6,116 +6,61 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - 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 -except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails # type: ignore - from ._models import AddressValidationOutput # type: ignore - from ._models import ApplianceNetworkConfiguration # type: ignore - from ._models import ArmBaseObject # type: ignore - from ._models import AvailableSkuRequest # type: ignore - from ._models import AvailableSkusResult # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CopyLogDetails # type: ignore - from ._models import CopyProgress # type: ignore - from ._models import DataBoxAccountCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyProgress # type: ignore - from ._models import DataBoxDiskJobDetails # type: ignore - from ._models import DataBoxDiskJobSecrets # type: ignore - from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore - from ._models import DataBoxHeavyJobDetails # type: ignore - from ._models import DataBoxHeavyJobSecrets # type: ignore - from ._models import DataBoxHeavySecret # type: ignore - from ._models import DataBoxJobDetails # type: ignore - from ._models import DataBoxSecret # type: ignore - from ._models import DataboxJobSecrets # type: ignore - from ._models import DestinationAccountDetails # type: ignore - from ._models import DestinationManagedDiskDetails # type: ignore - from ._models import DestinationStorageAccountDetails # type: ignore - from ._models import DestinationToServiceLocationMap # type: ignore - from ._models import DiskSecret # type: ignore - from ._models import Error # type: ignore - from ._models import JobDetails # type: ignore - from ._models import JobErrorDetails # type: ignore - from ._models import JobResource # type: ignore - from ._models import JobResourceList # type: ignore - from ._models import JobResourceUpdateParameter # type: ignore - from ._models import JobSecrets # type: ignore - from ._models import JobStages # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import PackageShippingDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import Resource # type: ignore - from ._models import ShareCredentialDetails # type: ignore - from ._models import ShipmentPickUpRequest # type: ignore - from ._models import ShipmentPickUpResponse # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuCost # type: ignore - from ._models import SkuInformation # type: ignore - from ._models import UnencryptedCredentials # type: ignore - from ._models import UnencryptedCredentialsList # type: ignore - from ._models import UpdateJobDetails # type: ignore - from ._models import ValidateAddress # type: ignore +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, diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_data_box_management_client_enums.py index d7085516d562..9be4699a990a 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_data_box_management_client_enums.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_data_box_management_client_enums.py @@ -6,139 +6,186 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) +class AccessProtocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" -class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - SMB = "SMB" #: Server Message Block protocol(SMB). - NFS = "NFS" #: Network File System protocol(NFS). - -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AddressType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of address. """ - NONE = "None" #: Address type not known. - RESIDENTIAL = "Residential" #: Residential Address. - COMMERCIAL = "Commercial" #: Commercial Address. + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" -class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AddressValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" -class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ClassDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Indicates the type of job details. """ - DATA_BOX = "DataBox" #: DataBox orders. - DATA_BOX_DISK = "DataBoxDisk" #: DataBoxDisk orders. - DATA_BOX_HEAVY = "DataBoxHeavy" #: DataBoxHeavy orders. + #: DataBox orders. + DATA_BOX = "DataBox" + #: DataBoxDisk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: DataBoxHeavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" -class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CopyStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + +class DataDestinationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Data Destination Type. """ - UNKNOWN_TYPE = "UnknownType" #: Unknown type. - STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . - MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. + #: Unknown type. + UNKNOWN_TYPE = "UnknownType" + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NotificationStageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + +class ShareDestinationFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: StorSimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + +class SkuDisabledReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - DATA_BOX = "DataBox" #: DataBox. - DATA_BOX_DISK = "DataBoxDisk" #: DataBoxDisk. - DATA_BOX_HEAVY = "DataBoxHeavy" #: DataBoxHeavy. - -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: DataBox. + DATA_BOX = "DataBox" + #: DataBoxDisk. + DATA_BOX_DISK = "DataBoxDisk" + #: DataBoxHeavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + +class StageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + +class StageStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models.py deleted file mode 100644 index 08c25212fb89..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models.py +++ /dev/null @@ -1,2212 +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. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class AccountCredentialDetails(msrest.serialization.Model): - """Credential details of the account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar account_name: Name of the account. - :vartype account_name: str - :ivar account_connection_string: Connection string of the account endpoint to use the account - as a storage endpoint on the device. - :vartype account_connection_string: str - :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] - """ - - _validation = { - 'account_name': {'readonly': True}, - 'account_connection_string': {'readonly': True}, - 'share_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'account_connection_string': {'key': 'accountConnectionString', 'type': 'str'}, - 'share_credential_details': {'key': 'shareCredentialDetails', 'type': '[ShareCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(AccountCredentialDetails, self).__init__(**kwargs) - self.account_name = None - self.account_connection_string = None - self.share_credential_details = None - - -class AddressValidationOutput(msrest.serialization.Model): - """Output of the address validation api. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, - } - - _attribute_map = { - 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressValidationOutput, self).__init__(**kwargs) - self.validation_status = None - self.alternate_addresses = None - - -class ApplianceNetworkConfiguration(msrest.serialization.Model): - """The Network Adapter configuration of a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the network. - :vartype name: str - :ivar mac_address: Mac Address. - :vartype mac_address: str - """ - - _validation = { - 'name': {'readonly': True}, - 'mac_address': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) - self.name = None - self.mac_address = None - - -class ArmBaseObject(msrest.serialization.Model): - """Base class for all objects under resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str - """ - - _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ArmBaseObject, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - - -class AvailableSkuRequest(msrest.serialization.Model): - """The filters for showing the available skus. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] - """ - - _validation = { - 'transfer_type': {'required': True, 'constant': True}, - 'country': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'transfer_type': {'key': 'transferType', 'type': 'str'}, - 'country': {'key': 'country', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku_names': {'key': 'skuNames', 'type': '[str]'}, - } - - transfer_type = "ImportToAzure" - - def __init__( - self, - **kwargs - ): - super(AvailableSkuRequest, self).__init__(**kwargs) - self.country = kwargs['country'] - self.location = kwargs['location'] - self.sku_names = kwargs.get('sku_names', None) - - -class AvailableSkusResult(msrest.serialization.Model): - """The available skus operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class CancellationReason(msrest.serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :param reason: Required. Reason for cancellation. - :type reason: str - """ - - _validation = { - 'reason': {'required': True}, - } - - _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs['reason'] - - -class ContactDetails(msrest.serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] - """ - - _validation = { - 'contact_name': {'required': True}, - 'phone': {'required': True}, - 'email_list': {'required': True}, - } - - _attribute_map = { - 'contact_name': {'key': 'contactName', 'type': 'str'}, - 'phone': {'key': 'phone', 'type': 'str'}, - 'phone_extension': {'key': 'phoneExtension', 'type': 'str'}, - 'mobile': {'key': 'mobile', 'type': 'str'}, - 'email_list': {'key': 'emailList', 'type': '[str]'}, - 'notification_preference': {'key': 'notificationPreference', 'type': '[NotificationPreference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs['contact_name'] - self.phone = kwargs['phone'] - self.phone_extension = kwargs.get('phone_extension', None) - self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs['email_list'] - self.notification_preference = kwargs.get('notification_preference', None) - - -class CopyLogDetails(msrest.serialization.Model): - """Details for log generated during copy. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - 'copy_log_details_type': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - } - - _subtype_map = { - 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} - } - - def __init__( - self, - **kwargs - ): - super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None # type: Optional[str] - - -class CopyProgress(msrest.serialization.Model): - """Copy progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar storage_account_name: Name of the storage account where the data needs to be uploaded. - :vartype storage_account_name: str - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. - :vartype bytes_sent_to_cloud: long - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed by the job as of now. - :vartype files_processed: long - :ivar total_files_to_process: Total number of files to be processed by the job. - :vartype total_files_to_process: long - """ - - _validation = { - 'storage_account_name': {'readonly': True}, - 'account_id': {'readonly': True}, - 'bytes_sent_to_cloud': {'readonly': True}, - 'total_bytes_to_process': {'readonly': True}, - 'files_processed': {'readonly': True}, - 'total_files_to_process': {'readonly': True}, - } - - _attribute_map = { - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'bytes_sent_to_cloud': {'key': 'bytesSentToCloud', 'type': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyProgress, self).__init__(**kwargs) - self.storage_account_name = None - self.account_id = None - self.bytes_sent_to_cloud = None - self.total_bytes_to_process = None - self.files_processed = None - self.total_files_to_process = None - - -class DataBoxAccountCopyLogDetails(CopyLogDetails): - """Copy log details for a storage account of a DataBox job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar account_name: Destination account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'readonly': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'copy_log_link': {'key': 'copyLogLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str - self.account_name = None - self.copy_log_link = None - - -class DataBoxDiskCopyLogDetails(CopyLogDetails): - """Copy Log Details for a disk. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar disk_serial_number: Disk Serial Number. - :vartype disk_serial_number: str - :ivar error_log_link: Link for copy error logs. - :vartype error_log_link: str - :ivar verbose_log_link: Link for copy verbose logs. - :vartype verbose_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'readonly': True}, - 'disk_serial_number': {'readonly': True}, - 'error_log_link': {'readonly': True}, - 'verbose_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'disk_serial_number': {'key': 'diskSerialNumber', 'type': 'str'}, - 'error_log_link': {'key': 'errorLogLink', 'type': 'str'}, - 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str - self.disk_serial_number = None - self.error_log_link = None - self.verbose_log_link = None - - -class DataBoxDiskCopyProgress(msrest.serialization.Model): - """DataBox Disk Copy Progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar serial_number: The serial number of the disk. - :vartype serial_number: str - :ivar bytes_copied: Bytes copied during the copy of disk. - :vartype bytes_copied: long - :ivar percent_complete: Indicates the percentage completed for the copy of the disk. - :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus - """ - - _validation = { - 'serial_number': {'readonly': True}, - 'bytes_copied': {'readonly': True}, - 'percent_complete': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'serial_number': {'key': 'serialNumber', 'type': 'str'}, - 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(msrest.serialization.Model): - """Job details. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, - 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, - 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - } - - _subtype_map = { - 'job_details_type': {'DataBox': 'DataBoxJobDetails', 'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails'} - } - - def __init__( - self, - **kwargs - ): - super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_tera_bytes = kwargs.get('expected_data_size_in_tera_bytes', None) - self.job_stages = None - self.contact_details = kwargs['contact_details'] - self.shipping_address = kwargs['shipping_address'] - self.delivery_package = None - self.return_package = None - self.destination_account_details = kwargs['destination_account_details'] - self.error_details = None - self.job_details_type = None # type: Optional[str] - self.preferences = kwargs.get('preferences', None) - self.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - - -class DataBoxDiskJobDetails(JobDetails): - """DataBox Disk Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :param preferred_disks: User preference on what size disks are needed for the job. The map is - from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but - will be checked against an int. - :type preferred_disks: dict[str, int] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - 'disks_and_size_details': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, - 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, - 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, - 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, - 'passkey': {'key': 'passkey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxDisk' # type: str - self.preferred_disks = kwargs.get('preferred_disks', None) - self.copy_progress = None - self.disks_and_size_details = None - self.passkey = kwargs.get('passkey', None) - - -class JobSecrets(msrest.serialization.Model): - """The base class for the secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - 'job_secrets_type': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - } - - _subtype_map = { - 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} - } - - def __init__( - self, - **kwargs - ): - super(JobSecrets, self).__init__(**kwargs) - self.job_secrets_type = None # type: Optional[str] - - -class DataBoxDiskJobSecrets(JobSecrets): - """The secrets related to disk job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] - :ivar pass_key: PassKey for the disk Job. - :vartype pass_key: str - :ivar is_passkey_user_defined: Whether passkey was provided by user. - :vartype is_passkey_user_defined: bool - """ - - _validation = { - 'job_secrets_type': {'readonly': True}, - 'disk_secrets': {'readonly': True}, - 'pass_key': {'readonly': True}, - 'is_passkey_user_defined': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, - 'pass_key': {'key': 'passKey', 'type': 'str'}, - 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str - self.disk_secrets = None - self.pass_key = None - self.is_passkey_user_defined = None - - -class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): - """Copy log details for a storage account for DataBoxHeavy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar account_name: Destination account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: list[str] - """ - - _validation = { - 'copy_log_details_type': {'readonly': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'copy_log_link': {'key': 'copyLogLink', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str - self.account_name = None - self.copy_log_link = None - - -class DataBoxHeavyJobDetails(JobDetails): - """DataBoxHeavy Device Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, - 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, - 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxHeavy' # type: str - self.copy_progress = None - - -class DataBoxHeavyJobSecrets(JobSecrets): - """The secrets related to a DataBoxHeavy job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar cabinet_pod_secrets: Contains the list of secret objects for a DataBoxHeavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] - """ - - _validation = { - 'job_secrets_type': {'readonly': True}, - 'cabinet_pod_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'cabinet_pod_secrets': {'key': 'cabinetPodSecrets', 'type': '[DataBoxHeavySecret]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str - self.cabinet_pod_secrets = None - - -class DataBoxHeavySecret(msrest.serialization.Model): - """The secrets related to a DataBoxHeavy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DataBoxJobDetails(JobDetails): - """DataBox Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, - 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, - 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBox' # type: str - self.copy_progress = None - - -class DataboxJobSecrets(JobSecrets): - """The secrets related to a DataBox job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] - """ - - _validation = { - 'job_secrets_type': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBox' # type: str - self.pod_secrets = kwargs.get('pod_secrets', None) - - -class DataBoxSecret(msrest.serialization.Model): - """The secrets related to a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxSecret, self).__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DestinationAccountDetails(msrest.serialization.Model): - """Details of the destination of the data. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DestinationManagedDiskDetails, DestinationStorageAccountDetails. - - All required parameters must be populated in order to send to Azure. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - """ - - _validation = { - 'data_destination_type': {'required': True}, - } - - _attribute_map = { - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'account_id': {'key': 'accountId', 'type': 'str'}, - } - - _subtype_map = { - 'data_destination_type': {'ManagedDisk': 'DestinationManagedDiskDetails', 'StorageAccount': 'DestinationStorageAccountDetails'} - } - - def __init__( - self, - **kwargs - ): - super(DestinationAccountDetails, self).__init__(**kwargs) - self.data_destination_type = None # type: Optional[str] - self.account_id = kwargs.get('account_id', None) - - -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. - - All required parameters must be populated in order to send to Azure. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param resource_group_id: Required. Destination Resource Group Id where the Compute disks - should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account that can be used to - copy the vhd for staging. - :type staging_storage_account_id: str - """ - - _validation = { - 'data_destination_type': {'required': True}, - 'resource_group_id': {'required': True}, - 'staging_storage_account_id': {'required': True}, - } - - _attribute_map = { - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, - 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DestinationManagedDiskDetails, self).__init__(**kwargs) - self.data_destination_type = 'ManagedDisk' # type: str - self.resource_group_id = kwargs['resource_group_id'] - self.staging_storage_account_id = kwargs['staging_storage_account_id'] - - -class DestinationStorageAccountDetails(DestinationAccountDetails): - """Details for the destination storage account. - - All required parameters must be populated in order to send to Azure. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str - """ - - _validation = { - 'data_destination_type': {'required': True}, - 'storage_account_id': {'required': True}, - } - - _attribute_map = { - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DestinationStorageAccountDetails, self).__init__(**kwargs) - self.data_destination_type = 'StorageAccount' # type: str - self.storage_account_id = kwargs['storage_account_id'] - - -class DestinationToServiceLocationMap(msrest.serialization.Model): - """Map of destination location to service location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar destination_location: Location of the destination. - :vartype destination_location: str - :ivar service_location: Location of the service. - :vartype service_location: str - """ - - _validation = { - 'destination_location': {'readonly': True}, - 'service_location': {'readonly': True}, - } - - _attribute_map = { - 'destination_location': {'key': 'destinationLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DestinationToServiceLocationMap, self).__init__(**kwargs) - self.destination_location = None - self.service_location = None - - -class DiskSecret(msrest.serialization.Model): - """Contains all the secrets of a Disk. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar disk_serial_number: Serial number of the assigned disk. - :vartype disk_serial_number: str - :ivar bit_locker_key: Bit Locker key of the disk which can be used to unlock the disk to copy - data. - :vartype bit_locker_key: str - """ - - _validation = { - 'disk_serial_number': {'readonly': True}, - 'bit_locker_key': {'readonly': True}, - } - - _attribute_map = { - 'disk_serial_number': {'key': 'diskSerialNumber', 'type': 'str'}, - 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskSecret, self).__init__(**kwargs) - self.disk_serial_number = None - self.bit_locker_key = None - - -class Error(msrest.serialization.Model): - """Top level error for the job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code that can be used to programmatically identify the error. - :vartype code: str - :ivar message: Describes the error in detail and provides debugging information. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Error, self).__init__(**kwargs) - self.code = None - self.message = None - - -class JobErrorDetails(msrest.serialization.Model): - """Job Error Details for providing the information and recommended action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_message: Message for the error. - :vartype error_message: str - :ivar error_code: Code for the error. - :vartype error_code: int - :ivar recommended_action: Recommended action for the error. - :vartype recommended_action: str - :ivar exception_message: Contains the non localized exception message. - :vartype exception_message: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'exception_message': {'readonly': True}, - } - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'exception_message': {'key': 'exceptionMessage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobErrorDetails, self).__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None - - -class Resource(msrest.serialization.Model): - """Model of the Resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - """ - - _validation = { - 'location': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs['sku'] - - -class JobResource(Resource): - """Job Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str - :ivar is_cancellable: Describes whether the job is cancellable or not. - :vartype is_cancellable: bool - :ivar is_deletable: Describes whether the job is deletable or not. - :vartype is_deletable: bool - :ivar is_shipping_address_editable: Describes whether the shipping address is editable or not. - :vartype is_shipping_address_editable: bool - :ivar status: Name of the stage which is in progress. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted". - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar start_time: Time at which the job was started in UTC ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.Error - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails - :ivar cancellation_reason: Reason for cancellation. - :vartype cancellation_reason: str - """ - - _validation = { - 'location': {'required': True}, - 'sku': {'required': True}, - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'is_cancellable': {'readonly': True}, - 'is_deletable': {'readonly': True}, - 'is_shipping_address_editable': {'readonly': True}, - 'status': {'readonly': True}, - 'start_time': {'readonly': True}, - 'error': {'readonly': True}, - 'cancellation_reason': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, - 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, - 'is_shipping_address_editable': {'key': 'properties.isShippingAddressEditable', 'type': 'bool'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'error': {'key': 'properties.error', 'type': 'Error'}, - 'details': {'key': 'properties.details', 'type': 'JobDetails'}, - 'cancellation_reason': {'key': 'properties.cancellationReason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResource, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - self.is_cancellable = None - self.is_deletable = None - self.is_shipping_address_editable = None - self.status = None - self.start_time = None - self.error = None - self.details = kwargs.get('details', None) - self.cancellation_reason = None - - -class JobResourceList(msrest.serialization.Model): - """Job Resource Collection. - - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[JobResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class JobResourceUpdateParameter(msrest.serialization.Model): - """The JobResourceUpdateParameter. - - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - 'destination_account_details': {'key': 'properties.destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.details = kwargs.get('details', None) - self.destination_account_details = kwargs.get('destination_account_details', None) - - -class JobStages(msrest.serialization.Model): - """Job stages. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar stage_name: Name of the job stage. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName - :ivar display_name: Display name of the job stage. - :vartype display_name: str - :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", - "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus - :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: ~datetime.datetime - :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object - :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - """ - - _validation = { - 'stage_name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'stage_status': {'readonly': True}, - 'stage_time': {'readonly': True}, - 'job_stage_details': {'readonly': True}, - 'error_details': {'readonly': True}, - } - - _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'stage_status': {'key': 'stageStatus', 'type': 'str'}, - 'stage_time': {'key': 'stageTime', 'type': 'iso-8601'}, - 'job_stage_details': {'key': 'jobStageDetails', 'type': 'object'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(JobStages, self).__init__(**kwargs) - self.stage_name = None - self.display_name = None - self.stage_status = None - self.stage_time = None - self.job_stage_details = None - self.error_details = None - - -class NotificationPreference(msrest.serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool - """ - - _validation = { - 'stage_name': {'required': True}, - 'send_notification': {'required': True}, - } - - _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs['stage_name'] - self.send_notification = kwargs['send_notification'] - - -class Operation(msrest.serialization.Model): - """Operation entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. - :vartype name: str - :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay - :ivar properties: Operation properties. - :vartype properties: object - :ivar origin: Origin of the operation. Can be : user|system|user,system. - :vartype origin: str - """ - - _validation = { - 'name': {'readonly': True}, - 'display': {'readonly': True}, - 'properties': {'readonly': True}, - 'origin': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'origin': {'key': 'origin', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None - self.properties = None - self.origin = None - - -class OperationDisplay(msrest.serialization.Model): - """Operation display. - - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class OperationList(msrest.serialization.Model): - """Operation Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class PackageShippingDetails(msrest.serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - :ivar tracking_url: Url where shipment can be tracked. - :vartype tracking_url: str - """ - - _validation = { - 'carrier_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, - } - - _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PackageShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = None - - -class Preferences(msrest.serialization.Model): - """Preferences related to the order. - - :param preferred_data_center_region: - :type preferred_data_center_region: list[str] - """ - - _attribute_map = { - 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) - self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) - - -class ShareCredentialDetails(msrest.serialization.Model): - """Credential details of the shares in account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar share_name: Name of the share. - :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType - :ivar user_name: User name for the share. - :vartype user_name: str - :ivar password: Password for the share. - :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] - """ - - _validation = { - 'share_name': {'readonly': True}, - 'share_type': {'readonly': True}, - 'user_name': {'readonly': True}, - 'password': {'readonly': True}, - 'supported_access_protocols': {'readonly': True}, - } - - _attribute_map = { - 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ShareCredentialDetails, self).__init__(**kwargs) - self.share_name = None - self.share_type = None - self.user_name = None - self.password = None - self.supported_access_protocols = None - - -class ShipmentPickUpRequest(msrest.serialization.Model): - """Shipment pick up request details. - - All required parameters must be populated in order to send to Azure. - - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str - """ - - _validation = { - 'start_time': {'required': True}, - 'end_time': {'required': True}, - 'shipment_location': {'required': True}, - } - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'shipment_location': {'key': 'shipmentLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs['start_time'] - self.end_time = kwargs['end_time'] - self.shipment_location = kwargs['shipment_location'] - - -class ShipmentPickUpResponse(msrest.serialization.Model): - """Shipment pick up response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar confirmation_number: Confirmation number for the pick up request. - :vartype confirmation_number: str - :ivar ready_by_time: Time by which shipment should be ready for pick up, this is in local time - of pick up area. - :vartype ready_by_time: ~datetime.datetime - """ - - _validation = { - 'confirmation_number': {'readonly': True}, - 'ready_by_time': {'readonly': True}, - } - - _attribute_map = { - 'confirmation_number': {'key': 'confirmationNumber', 'type': 'str'}, - 'ready_by_time': {'key': 'readyByTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) - self.confirmation_number = None - self.ready_by_time = None - - -class ShippingAddress(msrest.serialization.Model): - """Shipping address where customer wishes to receive the device. - - All required parameters must be populated in order to send to Azure. - - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType - """ - - _validation = { - 'street_address1': {'required': True}, - 'country': {'required': True}, - 'postal_code': {'required': True}, - } - - _attribute_map = { - 'street_address1': {'key': 'streetAddress1', 'type': 'str'}, - 'street_address2': {'key': 'streetAddress2', 'type': 'str'}, - 'street_address3': {'key': 'streetAddress3', 'type': 'str'}, - 'city': {'key': 'city', 'type': 'str'}, - 'state_or_province': {'key': 'stateOrProvince', 'type': 'str'}, - 'country': {'key': 'country', 'type': 'str'}, - 'postal_code': {'key': 'postalCode', 'type': 'str'}, - 'zip_extended_code': {'key': 'zipExtendedCode', 'type': 'str'}, - 'company_name': {'key': 'companyName', 'type': 'str'}, - 'address_type': {'key': 'addressType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs['street_address1'] - self.street_address2 = kwargs.get('street_address2', None) - self.street_address3 = kwargs.get('street_address3', None) - self.city = kwargs.get('city', None) - self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs['country'] - self.postal_code = kwargs['postal_code'] - self.zip_extended_code = kwargs.get('zip_extended_code', None) - self.company_name = kwargs.get('company_name', None) - self.address_type = kwargs.get('address_type', None) - - -class Sku(msrest.serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.display_name = kwargs.get('display_name', None) - self.family = kwargs.get('family', None) - - -class SkuCapacity(msrest.serialization.Model): - """Capacity of the sku. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar usable: Usable capacity in TB. - :vartype usable: str - :ivar maximum: Maximum capacity in TB. - :vartype maximum: str - """ - - _validation = { - 'usable': {'readonly': True}, - 'maximum': {'readonly': True}, - } - - _attribute_map = { - 'usable': {'key': 'usable', 'type': 'str'}, - 'maximum': {'key': 'maximum', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuCapacity, self).__init__(**kwargs) - self.usable = None - self.maximum = None - - -class SkuCost(msrest.serialization.Model): - """Describes metadata for retrieving price info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar meter_id: Meter id of the Sku. - :vartype meter_id: str - :ivar meter_type: The type of the meter. - :vartype meter_type: str - """ - - _validation = { - 'meter_id': {'readonly': True}, - 'meter_type': {'readonly': True}, - } - - _attribute_map = { - 'meter_id': {'key': 'meterId', 'type': 'str'}, - 'meter_type': {'key': 'meterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuCost, self).__init__(**kwargs) - self.meter_id = None - self.meter_type = None - - -class SkuInformation(msrest.serialization.Model): - """Information of the sku. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku - :ivar enabled: The sku is enabled or not. - :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] - :ivar api_versions: Api versions that support this Sku. - :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason - :ivar disabled_reason_message: Message for why the Sku is disabled. - :vartype disabled_reason_message: str - :ivar required_feature: Required feature to access the sku. - :vartype required_feature: str - """ - - _validation = { - 'sku': {'readonly': True}, - 'enabled': {'readonly': True}, - 'destination_to_service_location_map': {'readonly': True}, - 'capacity': {'readonly': True}, - 'costs': {'readonly': True}, - 'api_versions': {'readonly': True}, - 'disabled_reason': {'readonly': True}, - 'disabled_reason_message': {'readonly': True}, - 'required_feature': {'readonly': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'destination_to_service_location_map': {'key': 'properties.destinationToServiceLocationMap', 'type': '[DestinationToServiceLocationMap]'}, - 'capacity': {'key': 'properties.capacity', 'type': 'SkuCapacity'}, - 'costs': {'key': 'properties.costs', 'type': '[SkuCost]'}, - 'api_versions': {'key': 'properties.apiVersions', 'type': '[str]'}, - 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'str'}, - 'disabled_reason_message': {'key': 'properties.disabledReasonMessage', 'type': 'str'}, - 'required_feature': {'key': 'properties.requiredFeature', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuInformation, self).__init__(**kwargs) - self.sku = None - self.enabled = None - self.destination_to_service_location_map = None - self.capacity = None - self.costs = None - self.api_versions = None - self.disabled_reason = None - self.disabled_reason_message = None - self.required_feature = None - - -class UnencryptedCredentials(msrest.serialization.Model): - """Unencrypted credentials for accessing device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_name: Name of the job. - :vartype job_name: str - :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets - """ - - _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) - self.job_name = None - self.job_secrets = None - - -class UnencryptedCredentialsList(msrest.serialization.Model): - """List of unencrypted credentials for accessing device. - - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class UpdateJobDetails(msrest.serialization.Model): - """Job details for update. - - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - """ - - _attribute_map = { - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = kwargs.get('contact_details', None) - self.shipping_address = kwargs.get('shipping_address', None) - - -class ValidateAddress(msrest.serialization.Model): - """The requirements to validate customer address where the device needs to be shipped. - - All required parameters must be populated in order to send to Azure. - - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - """ - - _validation = { - 'shipping_address': {'required': True}, - 'device_type': {'required': True}, - } - - _attribute_map = { - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'device_type': {'key': 'deviceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateAddress, self).__init__(**kwargs) - self.shipping_address = kwargs['shipping_address'] - self.device_type = kwargs['device_type'] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models_py3.py index 250d9d2dfe7d..32d53d11da84 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models_py3.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/models/_models_py3.py @@ -25,7 +25,8 @@ class AccountCredentialDetails(msrest.serialization.Model): as a storage endpoint on the device. :vartype account_connection_string: str :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] + :vartype share_credential_details: + list[~azure.mgmt.databox.v2018_01_01.models.ShareCredentialDetails] """ _validation = { @@ -44,6 +45,8 @@ def __init__( self, **kwargs ): + """ + """ super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None self.account_connection_string = None @@ -57,9 +60,10 @@ class AddressValidationOutput(msrest.serialization.Model): :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2018_01_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2018_01_01.models.ShippingAddress] """ _validation = { @@ -76,6 +80,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationOutput, self).__init__(**kwargs) self.validation_status = None self.alternate_addresses = None @@ -106,6 +112,8 @@ def __init__( self, **kwargs ): + """ + """ super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None @@ -140,6 +148,8 @@ def __init__( self, **kwargs ): + """ + """ super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None @@ -153,16 +163,16 @@ class AvailableSkuRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". + :ivar transfer_type: Type of the transfer. Has constant value: "ImportToAzure". :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :vartype location: str + :ivar sku_names: Sku Names to filter for available skus. + :vartype sku_names: list[str or ~azure.mgmt.databox.v2018_01_01.models.SkuName] """ _validation = { @@ -188,6 +198,16 @@ def __init__( sku_names: Optional[List[Union[str, "SkuName"]]] = None, **kwargs ): + """ + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + :keyword sku_names: Sku Names to filter for available skus. + :paramtype sku_names: list[str or ~azure.mgmt.databox.v2018_01_01.models.SkuName] + """ super(AvailableSkuRequest, self).__init__(**kwargs) self.country = country self.location = location @@ -200,9 +220,9 @@ class AvailableSkusResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2018_01_01.models.SkuInformation] + :ivar next_link: Link for the next set of skus. + :vartype next_link: str """ _validation = { @@ -220,6 +240,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of skus. + :paramtype next_link: str + """ super(AvailableSkusResult, self).__init__(**kwargs) self.value = None self.next_link = next_link @@ -230,8 +254,8 @@ class CancellationReason(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Required. Reason for cancellation. + :vartype reason: str """ _validation = { @@ -248,6 +272,10 @@ def __init__( reason: str, **kwargs ): + """ + :keyword reason: Required. Reason for cancellation. + :paramtype reason: str + """ super(CancellationReason, self).__init__(**kwargs) self.reason = reason @@ -257,18 +285,19 @@ class ContactDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :ivar contact_name: Required. Contact name of the person. + :vartype contact_name: str + :ivar phone: Required. Phone number of the contact person. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: Required. List of Email-ids to be notified about job progress. + :vartype email_list: list[str] + :ivar notification_preference: Notification preference for a job stage. + :vartype notification_preference: + list[~azure.mgmt.databox.v2018_01_01.models.NotificationPreference] """ _validation = { @@ -297,6 +326,21 @@ def __init__( notification_preference: Optional[List["NotificationPreference"]] = None, **kwargs ): + """ + :keyword contact_name: Required. Contact name of the person. + :paramtype contact_name: str + :keyword phone: Required. Phone number of the contact person. + :paramtype phone: str + :keyword phone_extension: Phone extension number of the contact person. + :paramtype phone_extension: str + :keyword mobile: Mobile number of the contact person. + :paramtype mobile: str + :keyword email_list: Required. List of Email-ids to be notified about job progress. + :paramtype email_list: list[str] + :keyword notification_preference: Notification preference for a job stage. + :paramtype notification_preference: + list[~azure.mgmt.databox.v2018_01_01.models.NotificationPreference] + """ super(ContactDetails, self).__init__(**kwargs) self.contact_name = contact_name self.phone = phone @@ -312,15 +356,16 @@ class CopyLogDetails(msrest.serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator """ _validation = { - 'copy_log_details_type': {'readonly': True}, + 'copy_log_details_type': {'required': True}, } _attribute_map = { @@ -335,6 +380,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] @@ -380,6 +427,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None self.account_id = None @@ -394,9 +443,12 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + All required parameters must be populated in order to send to Azure. + + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator :ivar account_name: Destination account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -404,7 +456,7 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'readonly': True}, + 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, } @@ -419,6 +471,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBox' # type: str self.account_name = None @@ -430,9 +484,12 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + All required parameters must be populated in order to send to Azure. + + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -442,7 +499,7 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'readonly': True}, + 'copy_log_details_type': {'required': True}, 'disk_serial_number': {'readonly': True}, 'error_log_link': {'readonly': True}, 'verbose_log_link': {'readonly': True}, @@ -459,6 +516,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None @@ -479,7 +538,7 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :vartype percent_complete: int :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", "Completed", "CompletedWithErrors", "Failed", "NotReturned". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :vartype status: str or ~azure.mgmt.databox.v2018_01_01.models.CopyStatus """ _validation = { @@ -500,6 +559,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -517,30 +578,31 @@ class JobDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2018_01_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype return_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails + :ivar destination_account_details: Required. Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2018_01_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. @@ -591,6 +653,20 @@ def __init__( preferences: Optional["Preferences"] = None, **kwargs ): + """ + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress + :keyword destination_account_details: Required. Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences + """ super(JobDetails, self).__init__(**kwargs) self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes self.job_stages = None @@ -614,45 +690,46 @@ class DataBoxDiskJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2018_01_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype return_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails + :ivar destination_account_details: Required. Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2018_01_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :ivar preferred_disks: User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :vartype copy_progress: list[~azure.mgmt.databox.v2018_01_01.models.DataBoxDiskCopyProgress] :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str + :ivar passkey: User entered passkey for DataBox Disk job. + :vartype passkey: str """ _validation = { @@ -703,6 +780,26 @@ def __init__( passkey: Optional[str] = None, **kwargs ): + """ + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress + :keyword destination_account_details: Required. Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences + :keyword preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. + :paramtype preferred_disks: dict[str, int] + :keyword passkey: User entered passkey for DataBox Disk job. + :paramtype passkey: str + """ super(DataBoxDiskJobDetails, self).__init__(expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) self.job_details_type = 'DataBoxDisk' # type: str self.preferred_disks = preferred_disks @@ -717,15 +814,15 @@ class JobSecrets(msrest.serialization.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator """ _validation = { - 'job_secrets_type': {'readonly': True}, + 'job_secrets_type': {'required': True}, } _attribute_map = { @@ -740,6 +837,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobSecrets, self).__init__(**kwargs) self.job_secrets_type = None # type: Optional[str] @@ -749,11 +848,13 @@ class DataBoxDiskJobSecrets(JobSecrets): Variables are only populated by the server, and will be ignored when sending a request. - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + All required parameters must be populated in order to send to Azure. + + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~azure.mgmt.databox.v2018_01_01.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -761,7 +862,7 @@ class DataBoxDiskJobSecrets(JobSecrets): """ _validation = { - 'job_secrets_type': {'readonly': True}, + 'job_secrets_type': {'required': True}, 'disk_secrets': {'readonly': True}, 'pass_key': {'readonly': True}, 'is_passkey_user_defined': {'readonly': True}, @@ -778,6 +879,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None @@ -790,9 +893,12 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): Variables are only populated by the server, and will be ignored when sending a request. - :ivar copy_log_details_type: Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + All required parameters must be populated in order to send to Azure. + + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator :ivar account_name: Destination account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -800,7 +906,7 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): """ _validation = { - 'copy_log_details_type': {'readonly': True}, + 'copy_log_details_type': {'required': True}, 'account_name': {'readonly': True}, 'copy_log_link': {'readonly': True}, } @@ -815,6 +921,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None @@ -828,36 +936,37 @@ class DataBoxHeavyJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2018_01_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype return_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails + :ivar destination_account_details: Required. Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2018_01_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] + :vartype copy_progress: list[~azure.mgmt.databox.v2018_01_01.models.CopyProgress] """ _validation = { @@ -902,6 +1011,20 @@ def __init__( preferences: Optional["Preferences"] = None, **kwargs ): + """ + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress + :keyword destination_account_details: Required. Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences + """ super(DataBoxHeavyJobDetails, self).__init__(expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None @@ -912,15 +1035,17 @@ class DataBoxHeavyJobSecrets(JobSecrets): Variables are only populated by the server, and will be ignored when sending a request. - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + All required parameters must be populated in order to send to Azure. + + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator :ivar cabinet_pod_secrets: Contains the list of secret objects for a DataBoxHeavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2018_01_01.models.DataBoxHeavySecret] """ _validation = { - 'job_secrets_type': {'readonly': True}, + 'job_secrets_type': {'required': True}, 'cabinet_pod_secrets': {'readonly': True}, } @@ -933,6 +1058,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None @@ -948,12 +1075,14 @@ class DataBoxHeavySecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2018_01_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2018_01_01.models.AccountCredentialDetails] """ _validation = { @@ -976,6 +1105,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -991,36 +1122,37 @@ class DataBoxJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_tera_bytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2018_01_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype return_package: ~azure.mgmt.databox.v2018_01_01.models.PackageShippingDetails + :ivar destination_account_details: Required. Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2018_01_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] + :vartype copy_progress: list[~azure.mgmt.databox.v2018_01_01.models.CopyProgress] """ _validation = { @@ -1065,6 +1197,20 @@ def __init__( preferences: Optional["Preferences"] = None, **kwargs ): + """ + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress + :keyword destination_account_details: Required. Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2018_01_01.models.Preferences + """ super(DataBoxJobDetails, self).__init__(expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) self.job_details_type = 'DataBox' # type: str self.copy_progress = None @@ -1073,17 +1219,17 @@ def __init__( class DataboxJobSecrets(JobSecrets): """The secrets related to a DataBox job. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :vartype job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2018_01_01.models.ClassDiscriminator + :ivar pod_secrets: Contains the list of secret objects for a job. + :vartype pod_secrets: list[~azure.mgmt.databox.v2018_01_01.models.DataBoxSecret] """ _validation = { - 'job_secrets_type': {'readonly': True}, + 'job_secrets_type': {'required': True}, } _attribute_map = { @@ -1097,6 +1243,10 @@ def __init__( pod_secrets: Optional[List["DataBoxSecret"]] = None, **kwargs ): + """ + :keyword pod_secrets: Contains the list of secret objects for a job. + :paramtype pod_secrets: list[~azure.mgmt.databox.v2018_01_01.models.DataBoxSecret] + """ super(DataboxJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBox' # type: str self.pod_secrets = pod_secrets @@ -1112,12 +1262,14 @@ class DataBoxSecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2018_01_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2018_01_01.models.AccountCredentialDetails] """ _validation = { @@ -1140,6 +1292,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1156,11 +1310,12 @@ class DestinationAccountDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. + :ivar data_destination_type: Required. Data Destination Type.Constant filled by server. Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str + :vartype data_destination_type: str or + ~azure.mgmt.databox.v2018_01_01.models.DataDestinationType + :ivar account_id: Arm Id of the destination where the data has to be moved. + :vartype account_id: str """ _validation = { @@ -1182,6 +1337,10 @@ def __init__( account_id: Optional[str] = None, **kwargs ): + """ + :keyword account_id: Arm Id of the destination where the data has to be moved. + :paramtype account_id: str + """ super(DestinationAccountDetails, self).__init__(**kwargs) self.data_destination_type = None # type: Optional[str] self.account_id = account_id @@ -1192,17 +1351,18 @@ class DestinationManagedDiskDetails(DestinationAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. + :ivar data_destination_type: Required. Data Destination Type.Constant filled by server. Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param resource_group_id: Required. Destination Resource Group Id where the Compute disks - should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account that can be used to + :vartype data_destination_type: str or + ~azure.mgmt.databox.v2018_01_01.models.DataDestinationType + :ivar account_id: Arm Id of the destination where the data has to be moved. + :vartype account_id: str + :ivar resource_group_id: Required. Destination Resource Group Id where the Compute disks should + be created. + :vartype resource_group_id: str + :ivar staging_storage_account_id: Required. Arm Id of the storage account that can be used to copy the vhd for staging. - :type staging_storage_account_id: str + :vartype staging_storage_account_id: str """ _validation = { @@ -1226,6 +1386,16 @@ def __init__( account_id: Optional[str] = None, **kwargs ): + """ + :keyword account_id: Arm Id of the destination where the data has to be moved. + :paramtype account_id: str + :keyword resource_group_id: Required. Destination Resource Group Id where the Compute disks + should be created. + :paramtype resource_group_id: str + :keyword staging_storage_account_id: Required. Arm Id of the storage account that can be used + to copy the vhd for staging. + :paramtype staging_storage_account_id: str + """ super(DestinationManagedDiskDetails, self).__init__(account_id=account_id, **kwargs) self.data_destination_type = 'ManagedDisk' # type: str self.resource_group_id = resource_group_id @@ -1237,13 +1407,14 @@ class DestinationStorageAccountDetails(DestinationAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. + :ivar data_destination_type: Required. Data Destination Type.Constant filled by server. Possible values include: "UnknownType", "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str + :vartype data_destination_type: str or + ~azure.mgmt.databox.v2018_01_01.models.DataDestinationType + :ivar account_id: Arm Id of the destination where the data has to be moved. + :vartype account_id: str + :ivar storage_account_id: Required. Destination Storage Account Arm Id. + :vartype storage_account_id: str """ _validation = { @@ -1264,6 +1435,12 @@ def __init__( account_id: Optional[str] = None, **kwargs ): + """ + :keyword account_id: Arm Id of the destination where the data has to be moved. + :paramtype account_id: str + :keyword storage_account_id: Required. Destination Storage Account Arm Id. + :paramtype storage_account_id: str + """ super(DestinationStorageAccountDetails, self).__init__(account_id=account_id, **kwargs) self.data_destination_type = 'StorageAccount' # type: str self.storage_account_id = storage_account_id @@ -1294,6 +1471,8 @@ def __init__( self, **kwargs ): + """ + """ super(DestinationToServiceLocationMap, self).__init__(**kwargs) self.destination_location = None self.service_location = None @@ -1325,6 +1504,8 @@ def __init__( self, **kwargs ): + """ + """ super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None @@ -1355,6 +1536,8 @@ def __init__( self, **kwargs ): + """ + """ super(Error, self).__init__(**kwargs) self.code = None self.message = None @@ -1393,6 +1576,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobErrorDetails, self).__init__(**kwargs) self.error_message = None self.error_code = None @@ -1405,16 +1590,16 @@ class Resource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2018_01_01.models.Sku """ _validation = { @@ -1436,6 +1621,18 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2018_01_01.models.Sku + """ super(Resource, self).__init__(**kwargs) self.location = location self.tags = tags @@ -1449,16 +1646,16 @@ class JobResource(Resource): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2018_01_01.models.Sku :ivar name: Name of the object. :vartype name: str :ivar id: Id of the object. @@ -1475,13 +1672,13 @@ class JobResource(Resource): "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted". - :vartype status: str or ~azure.mgmt.databox.models.StageName + :vartype status: str or ~azure.mgmt.databox.v2018_01_01.models.StageName :ivar start_time: Time at which the job was started in UTC ISO 8601 format. :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.Error - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~azure.mgmt.databox.v2018_01_01.models.Error + :ivar details: Details of a job run. This field will only be sent for expand details filter. + :vartype details: ~azure.mgmt.databox.v2018_01_01.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str """ @@ -1527,6 +1724,20 @@ def __init__( details: Optional["JobDetails"] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2018_01_01.models.Sku + :keyword details: Details of a job run. This field will only be sent for expand details filter. + :paramtype details: ~azure.mgmt.databox.v2018_01_01.models.JobDetails + """ super(JobResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) self.name = None self.id = None @@ -1544,10 +1755,10 @@ def __init__( class JobResourceList(msrest.serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :ivar value: List of job resources. + :vartype value: list[~azure.mgmt.databox.v2018_01_01.models.JobResource] + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str """ _attribute_map = { @@ -1562,6 +1773,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of job resources. + :paramtype value: list[~azure.mgmt.databox.v2018_01_01.models.JobResource] + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ super(JobResourceList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -1570,13 +1787,14 @@ def __init__( class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype tags: dict[str, str] + :ivar details: Details of a job to be updated. + :vartype details: ~azure.mgmt.databox.v2018_01_01.models.UpdateJobDetails + :ivar destination_account_details: Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] """ _attribute_map = { @@ -1593,6 +1811,16 @@ def __init__( destination_account_details: Optional[List["DestinationAccountDetails"]] = None, **kwargs ): + """ + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword details: Details of a job to be updated. + :paramtype details: ~azure.mgmt.databox.v2018_01_01.models.UpdateJobDetails + :keyword destination_account_details: Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2018_01_01.models.DestinationAccountDetails] + """ super(JobResourceUpdateParameter, self).__init__(**kwargs) self.tags = tags self.details = details @@ -1608,18 +1836,18 @@ class JobStages(msrest.serialization.Model): "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :vartype stage_name: str or ~azure.mgmt.databox.v2018_01_01.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :vartype stage_status: str or ~azure.mgmt.databox.v2018_01_01.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. :vartype stage_time: ~datetime.datetime :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object + :vartype job_stage_details: any :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype error_details: list[~azure.mgmt.databox.v2018_01_01.models.JobErrorDetails] """ _validation = { @@ -1644,6 +1872,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None @@ -1658,11 +1888,11 @@ class NotificationPreference(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + :ivar stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :vartype stage_name: str or ~azure.mgmt.databox.v2018_01_01.models.NotificationStageName + :ivar send_notification: Required. Notification is required or not. + :vartype send_notification: bool """ _validation = { @@ -1679,9 +1909,16 @@ def __init__( self, *, stage_name: Union[str, "NotificationStageName"], - send_notification: bool, + send_notification: bool = True, **kwargs ): + """ + :keyword stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :paramtype stage_name: str or ~azure.mgmt.databox.v2018_01_01.models.NotificationStageName + :keyword send_notification: Required. Notification is required or not. + :paramtype send_notification: bool + """ super(NotificationPreference, self).__init__(**kwargs) self.stage_name = stage_name self.send_notification = send_notification @@ -1696,9 +1933,9 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2018_01_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :vartype properties: any :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str """ @@ -1721,6 +1958,8 @@ def __init__( self, **kwargs ): + """ + """ super(Operation, self).__init__(**kwargs) self.name = None self.display = None @@ -1731,14 +1970,14 @@ def __init__( class OperationDisplay(msrest.serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :ivar provider: Provider name. + :vartype provider: str + :ivar resource: Resource name. + :vartype resource: str + :ivar operation: Localized name of the operation for display purpose. + :vartype operation: str + :ivar description: Localized description of the operation for display purpose. + :vartype description: str """ _attribute_map = { @@ -1757,6 +1996,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Provider name. + :paramtype provider: str + :keyword resource: Resource name. + :paramtype resource: str + :keyword operation: Localized name of the operation for display purpose. + :paramtype operation: str + :keyword description: Localized description of the operation for display purpose. + :paramtype description: str + """ super(OperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -1770,9 +2019,9 @@ class OperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2018_01_01.models.Operation] + :ivar next_link: Link for the next set of operations. + :vartype next_link: str """ _validation = { @@ -1790,6 +2039,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of operations. + :paramtype next_link: str + """ super(OperationList, self).__init__(**kwargs) self.value = None self.next_link = next_link @@ -1824,6 +2077,8 @@ def __init__( self, **kwargs ): + """ + """ super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None @@ -1833,8 +2088,8 @@ def __init__( class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: - :type preferred_data_center_region: list[str] + :ivar preferred_data_center_region: + :vartype preferred_data_center_region: list[str] """ _attribute_map = { @@ -1847,6 +2102,10 @@ def __init__( preferred_data_center_region: Optional[List[str]] = None, **kwargs ): + """ + :keyword preferred_data_center_region: + :paramtype preferred_data_center_region: list[str] + """ super(Preferences, self).__init__(**kwargs) self.preferred_data_center_region = preferred_data_center_region @@ -1860,13 +2119,14 @@ class ShareCredentialDetails(msrest.serialization.Model): :vartype share_name: str :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + :vartype share_type: str or ~azure.mgmt.databox.v2018_01_01.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] + :vartype supported_access_protocols: list[str or + ~azure.mgmt.databox.v2018_01_01.models.AccessProtocol] """ _validation = { @@ -1889,6 +2149,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -1902,14 +2164,14 @@ class ShipmentPickUpRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be + :ivar start_time: Required. Minimum date after which the pick up should commence, this must be in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be + :vartype start_time: ~datetime.datetime + :ivar end_time: Required. Maximum date before which the pick up should commence, this must be in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :vartype end_time: ~datetime.datetime + :ivar shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :vartype shipment_location: str """ _validation = { @@ -1932,6 +2194,16 @@ def __init__( shipment_location: str, **kwargs ): + """ + :keyword start_time: Required. Minimum date after which the pick up should commence, this must + be in local time of pick up area. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Required. Maximum date before which the pick up should commence, this must + be in local time of pick up area. + :paramtype end_time: ~datetime.datetime + :keyword shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :paramtype shipment_location: str + """ super(ShipmentPickUpRequest, self).__init__(**kwargs) self.start_time = start_time self.end_time = end_time @@ -1964,6 +2236,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None @@ -1974,27 +2248,27 @@ class ShippingAddress(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :ivar street_address1: Required. Street Address line 1. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: Required. Name of the Country. + :vartype country: str + :ivar postal_code: Required. Postal code. + :vartype postal_code: str + :ivar zip_extended_code: Extended Zip Code. + :vartype zip_extended_code: str + :ivar company_name: Name of the company. + :vartype company_name: str + :ivar address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :vartype address_type: str or ~azure.mgmt.databox.v2018_01_01.models.AddressType """ _validation = { @@ -2028,9 +2302,32 @@ def __init__( state_or_province: Optional[str] = None, zip_extended_code: Optional[str] = None, company_name: Optional[str] = None, - address_type: Optional[Union[str, "AddressType"]] = None, + address_type: Optional[Union[str, "AddressType"]] = "None", **kwargs ): + """ + :keyword street_address1: Required. Street Address line 1. + :paramtype street_address1: str + :keyword street_address2: Street Address line 2. + :paramtype street_address2: str + :keyword street_address3: Street Address line 3. + :paramtype street_address3: str + :keyword city: Name of the City. + :paramtype city: str + :keyword state_or_province: Name of the State or Province. + :paramtype state_or_province: str + :keyword country: Required. Name of the Country. + :paramtype country: str + :keyword postal_code: Required. Postal code. + :paramtype postal_code: str + :keyword zip_extended_code: Extended Zip Code. + :paramtype zip_extended_code: str + :keyword company_name: Name of the company. + :paramtype company_name: str + :keyword address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :paramtype address_type: str or ~azure.mgmt.databox.v2018_01_01.models.AddressType + """ super(ShippingAddress, self).__init__(**kwargs) self.street_address1 = street_address1 self.street_address2 = street_address2 @@ -2049,13 +2346,13 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :vartype name: str or ~azure.mgmt.databox.v2018_01_01.models.SkuName + :ivar display_name: The display name of the sku. + :vartype display_name: str + :ivar family: The sku family. + :vartype family: str """ _validation = { @@ -2076,6 +2373,15 @@ def __init__( family: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype name: str or ~azure.mgmt.databox.v2018_01_01.models.SkuName + :keyword display_name: The display name of the sku. + :paramtype display_name: str + :keyword family: The sku family. + :paramtype family: str + """ super(Sku, self).__init__(**kwargs) self.name = name self.display_name = display_name @@ -2107,6 +2413,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None @@ -2137,6 +2445,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None @@ -2148,21 +2458,21 @@ class SkuInformation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~azure.mgmt.databox.v2018_01_01.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool :ivar destination_to_service_location_map: The map of destination location to service location. :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] + list[~azure.mgmt.databox.v2018_01_01.models.DestinationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2018_01_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~azure.mgmt.databox.v2018_01_01.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :vartype disabled_reason: str or ~azure.mgmt.databox.v2018_01_01.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -2197,6 +2507,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None @@ -2217,7 +2529,7 @@ class UnencryptedCredentials(msrest.serialization.Model): :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2018_01_01.models.JobSecrets """ _validation = { @@ -2234,6 +2546,8 @@ def __init__( self, **kwargs ): + """ + """ super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None @@ -2242,10 +2556,10 @@ def __init__( class UnencryptedCredentialsList(msrest.serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :ivar value: List of unencrypted credentials. + :vartype value: list[~azure.mgmt.databox.v2018_01_01.models.UnencryptedCredentials] + :ivar next_link: Link for the next set of unencrypted credentials. + :vartype next_link: str """ _attribute_map = { @@ -2260,6 +2574,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of unencrypted credentials. + :paramtype value: list[~azure.mgmt.databox.v2018_01_01.models.UnencryptedCredentials] + :keyword next_link: Link for the next set of unencrypted credentials. + :paramtype next_link: str + """ super(UnencryptedCredentialsList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -2268,10 +2588,10 @@ def __init__( class UpdateJobDetails(msrest.serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar contact_details: Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress """ _attribute_map = { @@ -2286,6 +2606,12 @@ def __init__( shipping_address: Optional["ShippingAddress"] = None, **kwargs ): + """ + :keyword contact_details: Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2018_01_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress + """ super(UpdateJobDetails, self).__init__(**kwargs) self.contact_details = contact_details self.shipping_address = shipping_address @@ -2296,11 +2622,11 @@ class ValidateAddress(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2018_01_01.models.SkuName """ _validation = { @@ -2320,6 +2646,13 @@ def __init__( device_type: Union[str, "SkuName"], **kwargs ): + """ + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2018_01_01.models.ShippingAddress + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2018_01_01.models.SkuName + """ super(ValidateAddress, self).__init__(**kwargs) self.shipping_address = shipping_address self.device_type = device_type diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_jobs_operations.py index 680eb7dbdbdd..38eced2eb992 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_jobs_operations.py @@ -5,25 +5,380 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_book_shipment_pick_up_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_credentials_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class JobsOperations(object): """JobsOperations operations. @@ -32,7 +387,7 @@ class JobsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2018_01_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -47,12 +402,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: """Lists all the jobs available under the subscription. :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in @@ -60,7 +415,7 @@ def list( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -68,36 +423,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,18 +465,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: """Lists all the jobs available under the given resource group. :param resource_group_name: The Resource Group Name. @@ -136,7 +487,7 @@ def list_by_resource_group( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -144,37 +495,33 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -192,19 +539,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - job_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.JobResource" + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": """Gets information about the specified job. :param resource_group_name: The Resource Group Name. @@ -217,7 +565,7 @@ def get( :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource + :rtype: ~azure.mgmt.databox.v2018_01_01.models.JobResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] @@ -225,29 +573,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -261,47 +598,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + def _create_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,16 +645,18 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_create( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: """Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. @@ -336,18 +666,22 @@ def begin_create( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource: Job details from request body. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :type job_resource: ~azure.mgmt.databox.v2018_01_01.models.JobResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2018_01_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -359,27 +693,21 @@ def begin_create( resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -391,39 +719,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -436,13 +756,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a job. :param resource_group_name: The Resource Group Name. @@ -452,15 +773,17 @@ def begin_delete( :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -474,21 +797,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -500,50 +816,39 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _update_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -559,17 +864,19 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_update( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: """Updates the properties of an existing job. :param resource_group_name: The Resource Group Name. @@ -578,21 +885,26 @@ def begin_update( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2018_01_01.models.JobResourceUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2018_01_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -605,27 +917,21 @@ def begin_update( job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -637,16 +943,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + @distributed_trace def book_shipment_pick_up( self, - resource_group_name, # type: str - job_name, # type: str - shipment_pick_up_request, # type: "_models.ShipmentPickUpRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ShipmentPickUpResponse" + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": """Book shipment pick up. :param resource_group_name: The Resource Group Name. @@ -655,10 +962,10 @@ def book_shipment_pick_up( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :type shipment_pick_up_request: ~azure.mgmt.databox.v2018_01_01.models.ShipmentPickUpRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.v2018_01_01.models.ShipmentPickUpResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] @@ -666,32 +973,22 @@ def book_shipment_pick_up( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -705,16 +1002,18 @@ def book_shipment_pick_up( return cls(pipeline_response, deserialized, {}) return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + @distributed_trace def cancel( self, - resource_group_name, # type: str - job_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: """CancelJob. :param resource_group_name: The Resource Group Name. @@ -723,7 +1022,7 @@ def cancel( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :type cancellation_reason: ~azure.mgmt.databox.v2018_01_01.models.CancellationReason :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 @@ -734,30 +1033,22 @@ def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -770,13 +1061,14 @@ def cancel( cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + @distributed_trace def list_credentials( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UnencryptedCredentialsList"] + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentialsList"]: """This method gets the unencrypted secrets related to the job. :param resource_group_name: The Resource Group Name. @@ -785,8 +1077,10 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.UnencryptedCredentialsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] @@ -794,36 +1088,33 @@ def list_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -841,6 +1132,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_operations.py index c67bbf185f94..6b4035256b8d 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_operations.py @@ -5,23 +5,50 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +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: + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.DataBox/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -30,7 +57,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2018_01_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,16 +72,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationList"] + **kwargs: Any + ) -> Iterable["_models.OperationList"]: """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 OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.OperationList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -62,30 +89,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + 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) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +127,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_service_operations.py index 1bd91217c489..bb37559eafcc 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/operations/_service_operations.py @@ -5,23 +5,110 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +def build_list_available_skus_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_address_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2018-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ServiceOperations(object): """ServiceOperations operations. @@ -30,7 +117,7 @@ class ServiceOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2018_01_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,66 +132,63 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_available_skus( self, - location, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> Iterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription and location. :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2018_01_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2018_01_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,27 +206,28 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + @distributed_trace def validate_address( self, - location, # type: str - validate_address, # type: "_models.ValidateAddress" - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressValidationOutput" + location: str, + validate_address: "_models.ValidateAddress", + **kwargs: Any + ) -> "_models.AddressValidationOutput": """This method validates the customer shipping address and provide alternate addresses if any. :param location: The location of the resource. :type location: str :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :type validate_address: ~azure.mgmt.databox.v2018_01_01.models.ValidateAddress :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.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.v2018_01_01.models.AddressValidationOutput :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] @@ -150,31 +235,21 @@ def validate_address( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-01-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -188,4 +263,6 @@ def validate_address( return cls(pipeline_response, deserialized, {}) return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/__init__.py index ae972ed54f84..72afe00aa0a1 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['DataBoxManagementClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_configuration.py index ff9318047975..1be24f8f0da5 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_configuration.py @@ -6,18 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential @@ -35,16 +33,15 @@ class DataBoxManagementClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) 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 @@ -68,4 +65,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_data_box_management_client.py index e696cb06a780..7bd9f3f4148c 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_data_box_management_client.py @@ -6,65 +6,84 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import JobsOperations, Operations, ServiceOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from . import models - - -class DataBoxManagementClient(object): +class DataBoxManagementClient: """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations + :vartype operations: azure.mgmt.databox.v2019_09_01.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2019_09_01.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations + :vartype service: azure.mgmt.databox.v2019_09_01.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + 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(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._serialize.client_side_validation = False 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, # type: 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/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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 + """ - 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) + 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): # type: () -> None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_metadata.json index 10c0c55446ae..d37e8983f057 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_metadata.json +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_metadata.json @@ -5,11 +5,13 @@ "name": "DataBoxManagementClient", "filename": "_data_box_management_client", "description": "The DataBox Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The Subscription Id.", "docstring_type": "str", "required": true @@ -42,22 +44,61 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "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" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_version.py index eae7c95b6fbd..e5754a47ce68 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_version.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0b1" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/__init__.py index bb6b75a72db8..c57c5574bdd0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._data_box_management_client import DataBoxManagementClient __all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_configuration.py index bd2655860674..79cf68b3cefc 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -37,11 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) 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 @@ -64,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_data_box_management_client.py index b192ff7cd771..b1851e218c63 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_data_box_management_client.py @@ -6,62 +6,84 @@ # 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, Optional, TYPE_CHECKING +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +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 -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from .. import models - - -class DataBoxManagementClient(object): +class DataBoxManagementClient: """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.aio.operations.Operations + :vartype operations: azure.mgmt.databox.v2019_09_01.aio.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2019_09_01.aio.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.aio.operations.ServiceOperations + :vartype service: azure.mgmt.databox.v2019_09_01.aio.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataBoxManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False 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/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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 + """ - 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) + 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() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_jobs_operations.py index f01a52d0a1a9..f096c6b98655 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_jobs_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._jobs_operations import build_book_shipment_pick_up_request, build_cancel_request, build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_credentials_request, build_list_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -28,7 +33,7 @@ class JobsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2019_09_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -43,10 +48,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResourceList"]: """Lists all the jobs available under the subscription. @@ -55,7 +61,8 @@ def list( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -63,36 +70,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,16 +112,18 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResourceList"]: """Lists all the jobs available under the given resource group. @@ -130,7 +134,8 @@ def list_by_resource_group( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -138,37 +143,33 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -186,17 +187,19 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, job_name: str, expand: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.JobResource": """Gets information about the specified job. @@ -210,7 +213,7 @@ async def get( :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource + :rtype: ~azure.mgmt.databox.v2019_09_01.models.JobResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] @@ -218,29 +221,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,46 +246,38 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + async def _create_initial( self, resource_group_name: str, job_name: str, job_resource: "_models.JobResource", - **kwargs + **kwargs: Any ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -309,14 +293,17 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, resource_group_name: str, job_name: str, job_resource: "_models.JobResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.JobResource"]: """Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. @@ -327,18 +314,22 @@ async def begin_create( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource: Job details from request body. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :type job_resource: ~azure.mgmt.databox.v2019_09_01.models.JobResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2019_09_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -350,27 +341,21 @@ async def begin_create( resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -382,40 +367,31 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore async def _delete_initial( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -428,11 +404,13 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a job. @@ -443,15 +421,17 @@ async def begin_delete( :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -465,21 +445,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -491,6 +464,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore async def _update_initial( @@ -499,41 +473,30 @@ async def _update_initial( job_name: str, job_resource_update_parameter: "_models.JobResourceUpdateParameter", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -549,15 +512,18 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, resource_group_name: str, job_name: str, job_resource_update_parameter: "_models.JobResourceUpdateParameter", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.JobResource"]: """Updates the properties of an existing job. @@ -567,21 +533,26 @@ async def begin_update( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2019_09_01.models.JobResourceUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2019_09_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -594,27 +565,21 @@ async def begin_update( job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -626,14 +591,16 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + @distributed_trace_async async def book_shipment_pick_up( self, resource_group_name: str, job_name: str, shipment_pick_up_request: "_models.ShipmentPickUpRequest", - **kwargs + **kwargs: Any ) -> "_models.ShipmentPickUpResponse": """Book shipment pick up. @@ -643,10 +610,10 @@ async def book_shipment_pick_up( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :type shipment_pick_up_request: ~azure.mgmt.databox.v2019_09_01.models.ShipmentPickUpRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.v2019_09_01.models.ShipmentPickUpResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] @@ -654,32 +621,22 @@ async def book_shipment_pick_up( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -693,14 +650,17 @@ async def book_shipment_pick_up( return cls(pipeline_response, deserialized, {}) return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + @distributed_trace_async async def cancel( self, resource_group_name: str, job_name: str, cancellation_reason: "_models.CancellationReason", - **kwargs + **kwargs: Any ) -> None: """CancelJob. @@ -710,7 +670,7 @@ async def cancel( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :type cancellation_reason: ~azure.mgmt.databox.v2019_09_01.models.CancellationReason :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 @@ -721,32 +681,22 @@ async def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -759,11 +709,13 @@ async def cancel( cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + @distributed_trace def list_credentials( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: """This method gets the unencrypted secrets related to the job. @@ -773,8 +725,10 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.UnencryptedCredentialsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] @@ -782,36 +736,33 @@ def list_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -829,6 +780,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_operations.py index bd99838be8c3..85f10c9974cf 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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]] @@ -26,7 +31,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2019_09_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,15 +46,17 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationList"]: """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 OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.OperationList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + 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) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +102,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_service_operations.py index a07ce55b508d..86d8c8bc3e7f 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/aio/operations/_service_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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]] @@ -26,7 +31,7 @@ class ServiceOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2019_09_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,65 +46,63 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_available_skus( self, location: str, available_sku_request: "_models.AvailableSkuRequest", - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription and location. :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,17 +120,19 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + @distributed_trace def list_available_skus_by_resource_group( self, resource_group_name: str, location: str, available_sku_request: "_models.AvailableSkuRequest", - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription, resource group and location. @@ -137,55 +142,53 @@ def list_available_skus_by_resource_group( :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2019_09_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -203,16 +206,18 @@ async def get_next(next_link=None): 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'} # type: ignore + @distributed_trace_async async def validate_address( self, location: str, validate_address: "_models.ValidateAddress", - **kwargs + **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. @@ -220,10 +225,10 @@ async def validate_address( :param location: The location of the resource. :type location: str :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :type validate_address: ~azure.mgmt.databox.v2019_09_01.models.ValidateAddress :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.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] @@ -231,31 +236,21 @@ async def validate_address( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(validate_address, 'ValidateAddress') + + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,14 +264,17 @@ async def validate_address( return cls(pipeline_response, deserialized, {}) return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + @distributed_trace_async async def validate_inputs_by_resource_group( self, resource_group_name: str, location: str, validation_request: "_models.ValidationRequest", - **kwargs + **kwargs: Any ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under resource group. @@ -285,10 +283,10 @@ async def validate_inputs_by_resource_group( :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -296,32 +294,22 @@ async def validate_inputs_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -335,23 +323,26 @@ async def validate_inputs_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace_async async def validate_inputs( self, location: str, validation_request: "_models.ValidationRequest", - **kwargs + **kwargs: Any ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under subscription. :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -359,31 +350,21 @@ async def validate_inputs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -397,23 +378,27 @@ async def validate_inputs( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace_async async def region_configuration( self, location: str, region_configuration_request: "_models.RegionConfigurationRequest", - **kwargs + **kwargs: Any ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location. :param location: The location of the resource. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -421,31 +406,21 @@ async def region_configuration( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -459,4 +434,6 @@ async def region_configuration( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/__init__.py index 84b34d519a62..51459150decd 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/__init__.py @@ -6,176 +6,91 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - 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 -except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails # type: ignore - from ._models import AddressValidationOutput # type: ignore - from ._models import AddressValidationProperties # type: ignore - from ._models import ApplianceNetworkConfiguration # type: ignore - from ._models import ArmBaseObject # type: ignore - from ._models import AvailableSkuRequest # type: ignore - from ._models import AvailableSkusResult # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import CloudError # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CopyLogDetails # type: ignore - from ._models import CopyProgress # type: ignore - from ._models import CreateJobValidations # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationRequest # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties # type: ignore - from ._models import DataBoxAccountCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyProgress # type: ignore - from ._models import DataBoxDiskJobDetails # type: ignore - from ._models import DataBoxDiskJobSecrets # type: ignore - from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore - from ._models import DataBoxHeavyJobDetails # type: ignore - from ._models import DataBoxHeavyJobSecrets # type: ignore - from ._models import DataBoxHeavySecret # type: ignore - from ._models import DataBoxJobDetails # type: ignore - from ._models import DataBoxScheduleAvailabilityRequest # type: ignore - from ._models import DataBoxSecret # type: ignore - from ._models import DataDestinationDetailsValidationRequest # type: ignore - from ._models import DataDestinationDetailsValidationResponseProperties # type: ignore - from ._models import DataboxJobSecrets # type: ignore - from ._models import DcAccessSecurityCode # type: ignore - from ._models import DestinationAccountDetails # type: ignore - from ._models import DestinationManagedDiskDetails # type: ignore - from ._models import DestinationStorageAccountDetails # type: ignore - from ._models import DestinationToServiceLocationMap # type: ignore - from ._models import DiskScheduleAvailabilityRequest # type: ignore - from ._models import DiskSecret # type: ignore - from ._models import Error # type: ignore - from ._models import HeavyScheduleAvailabilityRequest # type: ignore - from ._models import JobDeliveryInfo # type: ignore - from ._models import JobDetails # type: ignore - from ._models import JobErrorDetails # type: ignore - from ._models import JobResource # type: ignore - from ._models import JobResourceList # type: ignore - from ._models import JobResourceUpdateParameter # type: ignore - from ._models import JobSecrets # type: ignore - from ._models import JobStages # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import PackageShippingDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import PreferencesValidationRequest # type: ignore - from ._models import PreferencesValidationResponseProperties # type: ignore - from ._models import RegionConfigurationRequest # type: ignore - from ._models import RegionConfigurationResponse # type: ignore - from ._models import Resource # type: ignore - from ._models import ScheduleAvailabilityRequest # type: ignore - from ._models import ScheduleAvailabilityResponse # type: ignore - from ._models import ShareCredentialDetails # type: ignore - from ._models import ShipmentPickUpRequest # type: ignore - from ._models import ShipmentPickUpResponse # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuAvailabilityValidationRequest # type: ignore - from ._models import SkuAvailabilityValidationResponseProperties # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuCost # type: ignore - from ._models import SkuInformation # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationRequest # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties # type: ignore - from ._models import TransportAvailabilityDetails # type: ignore - from ._models import TransportAvailabilityRequest # type: ignore - from ._models import TransportAvailabilityResponse # type: ignore - from ._models import TransportPreferences # type: ignore - from ._models import UnencryptedCredentials # type: ignore - from ._models import UnencryptedCredentialsList # type: ignore - from ._models import UpdateJobDetails # type: ignore - from ._models import ValidateAddress # type: ignore - from ._models import ValidationInputRequest # type: ignore - from ._models import ValidationInputResponse # type: ignore - from ._models import ValidationRequest # type: ignore - from ._models import ValidationResponse # type: ignore +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, diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_data_box_management_client_enums.py index e3da769b08c0..f01f81e223e8 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_data_box_management_client_enums.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_data_box_management_client_enums.py @@ -6,187 +6,257 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) +class AccessProtocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" -class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - SMB = "SMB" #: Server Message Block protocol(SMB). - NFS = "NFS" #: Network File System protocol(NFS). - -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AddressType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of address. """ - NONE = "None" #: Address type not known. - RESIDENTIAL = "Residential" #: Residential Address. - COMMERCIAL = "Commercial" #: Commercial Address. + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" -class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AddressValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" -class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ClassDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Indicates the type of job details. """ - DATA_BOX = "DataBox" #: Databox orders. - DATA_BOX_DISK = "DataBoxDisk" #: DataboxDisk orders. - DATA_BOX_HEAVY = "DataBoxHeavy" #: DataboxHeavy orders. + #: Databox orders. + DATA_BOX = "DataBox" + #: DataboxDisk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: DataboxHeavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" -class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CopyStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + +class DataDestinationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Data Destination Type. """ - STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . - MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" -class JobDeliveryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class JobDeliveryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Delivery type of Job. """ - NON_SCHEDULED = "NonScheduled" #: Non Scheduled job. - SCHEDULED = "Scheduled" #: Scheduled job. + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NotificationStageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + +class OverallValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" -class ShareDestinationFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ShareDestinationFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + +class SkuDisabledReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - DATA_BOX = "DataBox" #: Databox. - DATA_BOX_DISK = "DataBoxDisk" #: DataboxDisk. - DATA_BOX_HEAVY = "DataBoxHeavy" #: DataboxHeavy. - -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Databox. + DATA_BOX = "DataBox" + #: DataboxDisk. + DATA_BOX_DISK = "DataBoxDisk" + #: DataboxHeavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + +class StageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + +class StageStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + +class TransportShipmentTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" -class ValidationInputDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ValidationInputDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response of data destination details validation. + VALIDATE_DATA_DESTINATION_DETAILS = "ValidateDataDestinationDetails" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + +class ValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Create order limit validation status. """ - VALID = "Valid" #: Validation is successful. - INVALID = "Invalid" #: Validation is not successful. - SKIPPED = "Skipped" #: Validation is skipped. + #: Validation is successful. + VALID = "Valid" + #: Validation is not successful. + INVALID = "Invalid" + #: Validation is skipped. + SKIPPED = "Skipped" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models.py deleted file mode 100644 index 0d62bb7ec209..000000000000 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models.py +++ /dev/null @@ -1,3351 +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. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class AccountCredentialDetails(msrest.serialization.Model): - """Credential details of the account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar account_name: Name of the account. - :vartype account_name: str - :ivar data_destination_type: Data Destination Type. Possible values include: "StorageAccount", - "ManagedDisk". - :vartype data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :ivar account_connection_string: Connection string of the account endpoint to use the account - as a storage endpoint on the device. - :vartype account_connection_string: str - :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] - """ - - _validation = { - 'account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, - 'account_connection_string': {'readonly': True}, - 'share_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'account_connection_string': {'key': 'accountConnectionString', 'type': 'str'}, - 'share_credential_details': {'key': 'shareCredentialDetails', 'type': '[ShareCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(AccountCredentialDetails, self).__init__(**kwargs) - self.account_name = None - self.data_destination_type = None - self.account_connection_string = None - self.share_credential_details = None - - -class AddressValidationOutput(msrest.serialization.Model): - """Output of the address validation api. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param validation_type: Identifies the type of validation response.Constant filled by server. - Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'properties.validationType', 'type': 'str'}, - 'error': {'key': 'properties.error', 'type': 'Error'}, - 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressValidationOutput, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - self.error = None - self.validation_status = None - self.alternate_addresses = None - - -class ValidationInputResponse(msrest.serialization.Model): - """Minimum properties that should be present in each individual validation response. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, DataDestinationDetailsValidationResponseProperties, PreferencesValidationResponseProperties, SkuAvailabilityValidationResponseProperties, SubscriptionIsAllowedToCreateJobValidationResponseProperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - } - - _subtype_map = { - 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationInputResponse, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - self.error = None - - -class AddressValidationProperties(ValidationInputResponse): - """The address validation output. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar validation_status: The address validation status. Possible values include: "Valid", - "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus - :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'validation_status': {'readonly': True}, - 'alternate_addresses': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'validation_status': {'key': 'validationStatus', 'type': 'str'}, - 'alternate_addresses': {'key': 'alternateAddresses', 'type': '[ShippingAddress]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressValidationProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str - self.validation_status = None - self.alternate_addresses = None - - -class ApplianceNetworkConfiguration(msrest.serialization.Model): - """The Network Adapter configuration of a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the network. - :vartype name: str - :ivar mac_address: Mac Address. - :vartype mac_address: str - """ - - _validation = { - 'name': {'readonly': True}, - 'mac_address': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplianceNetworkConfiguration, self).__init__(**kwargs) - self.name = None - self.mac_address = None - - -class ArmBaseObject(msrest.serialization.Model): - """Base class for all objects under resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str - """ - - _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ArmBaseObject, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - - -class AvailableSkuRequest(msrest.serialization.Model): - """The filters for showing the available skus. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] - """ - - _validation = { - 'transfer_type': {'required': True, 'constant': True}, - 'country': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'transfer_type': {'key': 'transferType', 'type': 'str'}, - 'country': {'key': 'country', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku_names': {'key': 'skuNames', 'type': '[str]'}, - } - - transfer_type = "ImportToAzure" - - def __init__( - self, - **kwargs - ): - super(AvailableSkuRequest, self).__init__(**kwargs) - self.country = kwargs['country'] - self.location = kwargs['location'] - self.sku_names = kwargs.get('sku_names', None) - - -class AvailableSkusResult(msrest.serialization.Model): - """The available skus operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SkuInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailableSkusResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class CancellationReason(msrest.serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :param reason: Required. Reason for cancellation. - :type reason: str - """ - - _validation = { - 'reason': {'required': True}, - } - - _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs['reason'] - - -class CloudError(msrest.serialization.Model): - """The error information object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code string. - :vartype code: str - :ivar message: Descriptive error information. - :vartype message: str - :param target: Error target. - :type target: str - :param details: More detailed error information. - :type details: list[~azure.mgmt.databox.models.CloudError] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[CloudError]'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudError, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class ContactDetails(msrest.serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] - """ - - _validation = { - 'contact_name': {'required': True}, - 'phone': {'required': True}, - 'email_list': {'required': True}, - } - - _attribute_map = { - 'contact_name': {'key': 'contactName', 'type': 'str'}, - 'phone': {'key': 'phone', 'type': 'str'}, - 'phone_extension': {'key': 'phoneExtension', 'type': 'str'}, - 'mobile': {'key': 'mobile', 'type': 'str'}, - 'email_list': {'key': 'emailList', 'type': '[str]'}, - 'notification_preference': {'key': 'notificationPreference', 'type': '[NotificationPreference]'}, - } - - def __init__( - self, - **kwargs - ): - super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs['contact_name'] - self.phone = kwargs['phone'] - self.phone_extension = kwargs.get('phone_extension', None) - self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs['email_list'] - self.notification_preference = kwargs.get('notification_preference', None) - - -class CopyLogDetails(msrest.serialization.Model): - """Details for log generated during copy. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxAccountCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. - - All required parameters must be populated in order to send to Azure. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - } - - _subtype_map = { - 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} - } - - def __init__( - self, - **kwargs - ): - super(CopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = None # type: Optional[str] - - -class CopyProgress(msrest.serialization.Model): - """Copy progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar storage_account_name: Name of the storage account where the data needs to be uploaded. - :vartype storage_account_name: str - :ivar data_destination_type: Data Destination Type. Possible values include: "StorageAccount", - "ManagedDisk". - :vartype data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :ivar account_id: Id of the account where the data needs to be uploaded. - :vartype account_id: str - :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. - :vartype bytes_sent_to_cloud: long - :ivar total_bytes_to_process: Total amount of data to be processed by the job. - :vartype total_bytes_to_process: long - :ivar files_processed: Number of files processed by the job as of now. - :vartype files_processed: long - :ivar total_files_to_process: Total number of files to be processed by the job. - :vartype total_files_to_process: long - :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype invalid_files_processed: long - :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming - conventions which were processed by automatic renaming. - :vartype invalid_file_bytes_uploaded: long - :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which - were processed by automatic renaming. - :vartype renamed_container_count: long - :ivar files_errored_out: Number of files which could not be copied. - :vartype files_errored_out: long - """ - - _validation = { - 'storage_account_name': {'readonly': True}, - 'data_destination_type': {'readonly': True}, - 'account_id': {'readonly': True}, - 'bytes_sent_to_cloud': {'readonly': True}, - 'total_bytes_to_process': {'readonly': True}, - 'files_processed': {'readonly': True}, - 'total_files_to_process': {'readonly': True}, - 'invalid_files_processed': {'readonly': True}, - 'invalid_file_bytes_uploaded': {'readonly': True}, - 'renamed_container_count': {'readonly': True}, - 'files_errored_out': {'readonly': True}, - } - - _attribute_map = { - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'bytes_sent_to_cloud': {'key': 'bytesSentToCloud', 'type': 'long'}, - 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, - 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, - 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, - 'invalid_files_processed': {'key': 'invalidFilesProcessed', 'type': 'long'}, - 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, - 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, - 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyProgress, self).__init__(**kwargs) - self.storage_account_name = None - self.data_destination_type = None - self.account_id = None - self.bytes_sent_to_cloud = None - self.total_bytes_to_process = None - self.files_processed = None - self.total_files_to_process = None - self.invalid_files_processed = None - self.invalid_file_bytes_uploaded = None - self.renamed_container_count = None - self.files_errored_out = None - - -class ValidationRequest(msrest.serialization.Model): - """Input request for all pre job creation validation. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CreateJobValidations. - - All required parameters must be populated in order to send to Azure. - - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - """ - - _validation = { - 'individual_request_details': {'required': True}, - 'validation_category': {'required': True}, - } - - _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - } - - _subtype_map = { - 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationRequest, self).__init__(**kwargs) - self.individual_request_details = kwargs['individual_request_details'] - self.validation_category = None # type: Optional[str] - - -class CreateJobValidations(ValidationRequest): - """It does all pre-job creation validations. - - All required parameters must be populated in order to send to Azure. - - :param individual_request_details: Required. List of request details contain validationType and - its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Identify the nature of validation.Constant filled by - server. - :type validation_category: str - """ - - _validation = { - 'individual_request_details': {'required': True}, - 'validation_category': {'required': True}, - } - - _attribute_map = { - 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, - 'validation_category': {'key': 'validationCategory', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateJobValidations, self).__init__(**kwargs) - self.validation_category = 'JobCreationValidation' # type: str - - -class ValidationInputRequest(msrest.serialization.Model): - """Minimum fields that must be present in any type of validation request. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, DataDestinationDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - 'validation_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - } - - _subtype_map = { - 'validation_type': {'ValidateAddress': 'ValidateAddress', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataDestinationDetails': 'DataDestinationDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest'} - } - - def __init__( - self, - **kwargs - ): - super(ValidationInputRequest, self).__init__(**kwargs) - self.validation_type = None # type: Optional[str] - - -class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): - """Request to validate create order limit for current subscription. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - """ - - _validation = { - 'validation_type': {'required': True}, - 'device_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str - self.device_type = kwargs['device_type'] - - -class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): - """Properties of create order limit for subscription validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Create order limit validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateCreateOrderLimit' # type: str - self.status = None - - -class DataBoxAccountCopyLogDetails(CopyLogDetails): - """Copy log details for a storage account of a DataBox job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar account_name: Destination account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'copy_log_link': {'key': 'copyLogLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBox' # type: str - self.account_name = None - self.copy_log_link = None - - -class DataBoxDiskCopyLogDetails(CopyLogDetails): - """Copy Log Details for a disk. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar disk_serial_number: Disk Serial Number. - :vartype disk_serial_number: str - :ivar error_log_link: Link for copy error logs. - :vartype error_log_link: str - :ivar verbose_log_link: Link for copy verbose logs. - :vartype verbose_log_link: str - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'disk_serial_number': {'readonly': True}, - 'error_log_link': {'readonly': True}, - 'verbose_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'disk_serial_number': {'key': 'diskSerialNumber', 'type': 'str'}, - 'error_log_link': {'key': 'errorLogLink', 'type': 'str'}, - 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxDisk' # type: str - self.disk_serial_number = None - self.error_log_link = None - self.verbose_log_link = None - - -class DataBoxDiskCopyProgress(msrest.serialization.Model): - """DataBox Disk Copy Progress. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar serial_number: The serial number of the disk. - :vartype serial_number: str - :ivar bytes_copied: Bytes copied during the copy of disk. - :vartype bytes_copied: long - :ivar percent_complete: Indicates the percentage completed for the copy of the disk. - :vartype percent_complete: int - :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", - "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", - "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus - """ - - _validation = { - 'serial_number': {'readonly': True}, - 'bytes_copied': {'readonly': True}, - 'percent_complete': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'serial_number': {'key': 'serialNumber', 'type': 'str'}, - 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, - 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskCopyProgress, self).__init__(**kwargs) - self.serial_number = None - self.bytes_copied = None - self.percent_complete = None - self.status = None - - -class JobDetails(msrest.serialization.Model): - """Job details. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, - 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, - 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - } - - _subtype_map = { - 'job_details_type': {'DataBox': 'DataBoxJobDetails', 'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails'} - } - - def __init__( - self, - **kwargs - ): - super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) - self.job_stages = None - self.contact_details = kwargs['contact_details'] - self.shipping_address = kwargs['shipping_address'] - self.delivery_package = None - self.return_package = None - self.destination_account_details = kwargs['destination_account_details'] - self.error_details = None - self.job_details_type = None # type: Optional[str] - self.preferences = kwargs.get('preferences', None) - self.copy_log_details = None - self.reverse_shipment_label_sas_key = None - self.chain_of_custody_sas_key = None - - -class DataBoxDiskJobDetails(JobDetails): - """DataBox Disk Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :param preferred_disks: User preference on what size disks are needed for the job. The map is - from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but - will be checked against an int. - :type preferred_disks: dict[str, int] - :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] - :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being - used for the job. Is returned only after the disks are shipped to the customer. - :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - 'disks_and_size_details': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, - 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, - 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, - 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, - 'passkey': {'key': 'passkey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxDisk' # type: str - self.preferred_disks = kwargs.get('preferred_disks', None) - self.copy_progress = None - self.disks_and_size_details = None - self.passkey = kwargs.get('passkey', None) - - -class JobSecrets(msrest.serialization.Model): - """The base class for the secrets. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataboxJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - """ - - _validation = { - 'job_secrets_type': {'required': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - } - - _subtype_map = { - 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} - } - - def __init__( - self, - **kwargs - ): - super(JobSecrets, self).__init__(**kwargs) - self.job_secrets_type = None # type: Optional[str] - self.dc_access_security_code = kwargs.get('dc_access_security_code', None) - - -class DataBoxDiskJobSecrets(JobSecrets): - """The secrets related to disk job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] - :ivar pass_key: PassKey for the disk Job. - :vartype pass_key: str - :ivar is_passkey_user_defined: Whether passkey was provided by user. - :vartype is_passkey_user_defined: bool - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'disk_secrets': {'readonly': True}, - 'pass_key': {'readonly': True}, - 'is_passkey_user_defined': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, - 'pass_key': {'key': 'passKey', 'type': 'str'}, - 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxDiskJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxDisk' # type: str - self.disk_secrets = None - self.pass_key = None - self.is_passkey_user_defined = None - - -class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): - """Copy log details for a storage account for Databox heavy. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :ivar account_name: Destination account name. - :vartype account_name: str - :ivar copy_log_link: Link for copy logs. - :vartype copy_log_link: list[str] - """ - - _validation = { - 'copy_log_details_type': {'required': True}, - 'account_name': {'readonly': True}, - 'copy_log_link': {'readonly': True}, - } - - _attribute_map = { - 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'copy_log_link': {'key': 'copyLogLink', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) - self.copy_log_details_type = 'DataBoxHeavy' # type: str - self.account_name = None - self.copy_log_link = None - - -class DataBoxHeavyJobDetails(JobDetails): - """Databox Heavy Device Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, - 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, - 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBoxHeavy' # type: str - self.copy_progress = None - self.device_password = kwargs.get('device_password', None) - - -class DataBoxHeavyJobSecrets(JobSecrets): - """The secrets related to a databox heavy job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] - """ - - _validation = { - 'job_secrets_type': {'required': True}, - 'cabinet_pod_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'cabinet_pod_secrets': {'key': 'cabinetPodSecrets', 'type': '[DataBoxHeavySecret]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBoxHeavy' # type: str - self.cabinet_pod_secrets = None - - -class DataBoxHeavySecret(msrest.serialization.Model): - """The secrets related to a databox heavy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxHeavySecret, self).__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DataBoxJobDetails(JobDetails): - """Databox Job Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be - transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails - :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. - Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences - :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] - :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. - :vartype reverse_shipment_label_sas_key: str - :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. - :vartype chain_of_custody_sas_key: str - :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. - :type device_password: str - """ - - _validation = { - 'job_stages': {'readonly': True}, - 'contact_details': {'required': True}, - 'shipping_address': {'required': True}, - 'delivery_package': {'readonly': True}, - 'return_package': {'readonly': True}, - 'destination_account_details': {'required': True}, - 'error_details': {'readonly': True}, - 'job_details_type': {'required': True}, - 'copy_log_details': {'readonly': True}, - 'reverse_shipment_label_sas_key': {'readonly': True}, - 'chain_of_custody_sas_key': {'readonly': True}, - 'copy_progress': {'readonly': True}, - } - - _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, - 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, - 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, - 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, - 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxJobDetails, self).__init__(**kwargs) - self.job_details_type = 'DataBox' # type: str - self.copy_progress = None - self.device_password = kwargs.get('device_password', None) - - -class DataboxJobSecrets(JobSecrets): - """The secrets related to a databox job. - - All required parameters must be populated in order to send to Azure. - - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] - """ - - _validation = { - 'job_secrets_type': {'required': True}, - } - - _attribute_map = { - 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, - 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, - 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataboxJobSecrets, self).__init__(**kwargs) - self.job_secrets_type = 'DataBox' # type: str - self.pod_secrets = kwargs.get('pod_secrets', None) - - -class ScheduleAvailabilityRequest(msrest.serialization.Model): - """Request body to get the availability for scheduling orders. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest. - - All required parameters must be populated in order to send to Azure. - - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - """ - - _validation = { - 'storage_location': {'required': True}, - 'sku_name': {'required': True}, - } - - _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, - } - - _subtype_map = { - 'sku_name': {'DataBox': 'DataBoxScheduleAvailabilityRequest', 'DataBoxDisk': 'DiskScheduleAvailabilityRequest', 'DataBoxHeavy': 'HeavyScheduleAvailabilityRequest'} - } - - def __init__( - self, - **kwargs - ): - super(ScheduleAvailabilityRequest, self).__init__(**kwargs) - self.storage_location = kwargs['storage_location'] - self.sku_name = None # type: Optional[str] - - -class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling data box orders orders. - - All required parameters must be populated in order to send to Azure. - - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - """ - - _validation = { - 'storage_location': {'required': True}, - 'sku_name': {'required': True}, - } - - _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBox' # type: str - - -class DataBoxSecret(msrest.serialization.Model): - """The secrets related to a DataBox. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_serial_number: Serial number of the assigned device. - :vartype device_serial_number: str - :ivar device_password: Password for out of the box experience on device. - :vartype device_password: str - :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] - :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the - device. - :vartype encoded_validation_cert_pub_key: str - :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] - """ - - _validation = { - 'device_serial_number': {'readonly': True}, - 'device_password': {'readonly': True}, - 'network_configurations': {'readonly': True}, - 'encoded_validation_cert_pub_key': {'readonly': True}, - 'account_credential_details': {'readonly': True}, - } - - _attribute_map = { - 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, - 'device_password': {'key': 'devicePassword', 'type': 'str'}, - 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, - 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, - 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(DataBoxSecret, self).__init__(**kwargs) - self.device_serial_number = None - self.device_password = None - self.network_configurations = None - self.encoded_validation_cert_pub_key = None - self.account_credential_details = None - - -class DataDestinationDetailsValidationRequest(ValidationInputRequest): - """Request to validate data destination details. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param destination_account_details: Required. Destination account details list. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param location: Required. Location of stamp or geo. - :type location: str - """ - - _validation = { - 'validation_type': {'required': True}, - 'destination_account_details': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'destination_account_details': {'key': 'destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataDestinationDetailsValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateDataDestinationDetails' # type: str - self.destination_account_details = kwargs['destination_account_details'] - self.location = kwargs['location'] - - -class DataDestinationDetailsValidationResponseProperties(ValidationInputResponse): - """Properties of data destination details validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Data destination details validation status. Possible values include: "Valid", - "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataDestinationDetailsValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateDataDestinationDetails' # type: str - self.status = None - - -class DcAccessSecurityCode(msrest.serialization.Model): - """Dc Access Security code for device. - - :param forward_dc_access_code: Dc Access Code for dispatching from DC. - :type forward_dc_access_code: str - :param reverse_dc_access_code: Dc Access code for dropping off at DC. - :type reverse_dc_access_code: str - """ - - _attribute_map = { - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DcAccessSecurityCode, self).__init__(**kwargs) - self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) - self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) - - -class DestinationAccountDetails(msrest.serialization.Model): - """Details of the destination storage accounts. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DestinationManagedDiskDetails, DestinationStorageAccountDetails. - - All required parameters must be populated in order to send to Azure. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - """ - - _validation = { - 'data_destination_type': {'required': True}, - } - - _attribute_map = { - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - } - - _subtype_map = { - 'data_destination_type': {'ManagedDisk': 'DestinationManagedDiskDetails', 'StorageAccount': 'DestinationStorageAccountDetails'} - } - - def __init__( - self, - **kwargs - ): - super(DestinationAccountDetails, self).__init__(**kwargs) - self.data_destination_type = None # type: Optional[str] - self.account_id = kwargs.get('account_id', None) - self.share_password = kwargs.get('share_password', None) - - -class DestinationManagedDiskDetails(DestinationAccountDetails): - """Details for the destination compute disks. - - All required parameters must be populated in order to send to Azure. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param resource_group_id: Required. Destination Resource Group Id where the Compute disks - should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account that can be used to - copy the vhd for staging. - :type staging_storage_account_id: str - """ - - _validation = { - 'data_destination_type': {'required': True}, - 'resource_group_id': {'required': True}, - 'staging_storage_account_id': {'required': True}, - } - - _attribute_map = { - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, - 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DestinationManagedDiskDetails, self).__init__(**kwargs) - self.data_destination_type = 'ManagedDisk' # type: str - self.resource_group_id = kwargs['resource_group_id'] - self.staging_storage_account_id = kwargs['staging_storage_account_id'] - - -class DestinationStorageAccountDetails(DestinationAccountDetails): - """Details for the destination storage account. - - All required parameters must be populated in order to send to Azure. - - :param data_destination_type: Required. Data Destination Type.Constant filled by server. - Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str - """ - - _validation = { - 'data_destination_type': {'required': True}, - 'storage_account_id': {'required': True}, - } - - _attribute_map = { - 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'share_password': {'key': 'sharePassword', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DestinationStorageAccountDetails, self).__init__(**kwargs) - self.data_destination_type = 'StorageAccount' # type: str - self.storage_account_id = kwargs['storage_account_id'] - - -class DestinationToServiceLocationMap(msrest.serialization.Model): - """Map of destination location to service location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar destination_location: Location of the destination. - :vartype destination_location: str - :ivar service_location: Location of the service. - :vartype service_location: str - """ - - _validation = { - 'destination_location': {'readonly': True}, - 'service_location': {'readonly': True}, - } - - _attribute_map = { - 'destination_location': {'key': 'destinationLocation', 'type': 'str'}, - 'service_location': {'key': 'serviceLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DestinationToServiceLocationMap, self).__init__(**kwargs) - self.destination_location = None - self.service_location = None - - -class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling disk orders. - - All required parameters must be populated in order to send to Azure. - - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to - be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - """ - - _validation = { - 'storage_location': {'required': True}, - 'sku_name': {'required': True}, - 'expected_data_size_in_terabytes': {'required': True}, - } - - _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = kwargs['expected_data_size_in_terabytes'] - - -class DiskSecret(msrest.serialization.Model): - """Contains all the secrets of a Disk. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar disk_serial_number: Serial number of the assigned disk. - :vartype disk_serial_number: str - :ivar bit_locker_key: Bit Locker key of the disk which can be used to unlock the disk to copy - data. - :vartype bit_locker_key: str - """ - - _validation = { - 'disk_serial_number': {'readonly': True}, - 'bit_locker_key': {'readonly': True}, - } - - _attribute_map = { - 'disk_serial_number': {'key': 'diskSerialNumber', 'type': 'str'}, - 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskSecret, self).__init__(**kwargs) - self.disk_serial_number = None - self.bit_locker_key = None - - -class Error(msrest.serialization.Model): - """Top level error for the job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code that can be used to programmatically identify the error. - :vartype code: str - :ivar message: Describes the error in detail and provides debugging information. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Error, self).__init__(**kwargs) - self.code = None - self.message = None - - -class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): - """Request body to get the availability for scheduling heavy orders. - - All required parameters must be populated in order to send to Azure. - - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - """ - - _validation = { - 'storage_location': {'required': True}, - 'sku_name': {'required': True}, - } - - _attribute_map = { - 'storage_location': {'key': 'storageLocation', 'type': 'str'}, - 'sku_name': {'key': 'skuName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HeavyScheduleAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = 'DataBoxHeavy' # type: str - - -class JobDeliveryInfo(msrest.serialization.Model): - """Additional delivery info. - - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime - """ - - _attribute_map = { - 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = kwargs.get('scheduled_date_time', None) - - -class JobErrorDetails(msrest.serialization.Model): - """Job Error Details for providing the information and recommended action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_message: Message for the error. - :vartype error_message: str - :ivar error_code: Code for the error. - :vartype error_code: int - :ivar recommended_action: Recommended action for the error. - :vartype recommended_action: str - :ivar exception_message: Contains the non localized exception message. - :vartype exception_message: str - """ - - _validation = { - 'error_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'exception_message': {'readonly': True}, - } - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'exception_message': {'key': 'exceptionMessage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobErrorDetails, self).__init__(**kwargs) - self.error_message = None - self.error_code = None - self.recommended_action = None - self.exception_message = None - - -class Resource(msrest.serialization.Model): - """Model of the Resource. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - """ - - _validation = { - 'location': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs['sku'] - - -class JobResource(Resource): - """Job Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one of the supported and - registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a - resource cannot be changed once it is created, but if an identical region is specified on - update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :ivar name: Name of the object. - :vartype name: str - :ivar id: Id of the object. - :vartype id: str - :ivar type: Type of the object. - :vartype type: str - :ivar is_cancellable: Describes whether the job is cancellable or not. - :vartype is_cancellable: bool - :ivar is_deletable: Describes whether the job is deletable or not. - :vartype is_deletable: bool - :ivar is_shipping_address_editable: Describes whether the shipping address is editable or not. - :vartype is_shipping_address_editable: bool - :ivar status: Name of the stage which is in progress. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.models.StageName - :ivar start_time: Time at which the job was started in UTC ISO 8601 format. - :vartype start_time: ~datetime.datetime - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.Error - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails - :ivar cancellation_reason: Reason for cancellation. - :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo - :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. - :vartype is_cancellable_without_fee: bool - """ - - _validation = { - 'location': {'required': True}, - 'sku': {'required': True}, - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'is_cancellable': {'readonly': True}, - 'is_deletable': {'readonly': True}, - 'is_shipping_address_editable': {'readonly': True}, - 'status': {'readonly': True}, - 'start_time': {'readonly': True}, - 'error': {'readonly': True}, - 'cancellation_reason': {'readonly': True}, - 'is_cancellable_without_fee': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, - 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, - 'is_shipping_address_editable': {'key': 'properties.isShippingAddressEditable', 'type': 'bool'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'error': {'key': 'properties.error', 'type': 'Error'}, - 'details': {'key': 'properties.details', 'type': 'JobDetails'}, - 'cancellation_reason': {'key': 'properties.cancellationReason', 'type': 'str'}, - 'delivery_type': {'key': 'properties.deliveryType', 'type': 'str'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'JobDeliveryInfo'}, - 'is_cancellable_without_fee': {'key': 'properties.isCancellableWithoutFee', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResource, self).__init__(**kwargs) - self.name = None - self.id = None - self.type = None - self.is_cancellable = None - self.is_deletable = None - self.is_shipping_address_editable = None - self.status = None - self.start_time = None - self.error = None - self.details = kwargs.get('details', None) - self.cancellation_reason = None - self.delivery_type = kwargs.get('delivery_type', None) - self.delivery_info = kwargs.get('delivery_info', None) - self.is_cancellable_without_fee = None - - -class JobResourceList(msrest.serialization.Model): - """Job Resource Collection. - - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[JobResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class JobResourceUpdateParameter(msrest.serialization.Model): - """The JobResourceUpdateParameter. - - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags - can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, - 'destination_account_details': {'key': 'properties.destinationAccountDetails', 'type': '[DestinationAccountDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.details = kwargs.get('details', None) - self.destination_account_details = kwargs.get('destination_account_details', None) - - -class JobStages(msrest.serialization.Model): - """Job stages. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar stage_name: Name of the job stage. Possible values include: "DeviceOrdered", - "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", - "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", - "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", - "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName - :ivar display_name: Display name of the job stage. - :vartype display_name: str - :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", - "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus - :ivar stage_time: Time for the job stage in UTC ISO 8601 format. - :vartype stage_time: ~datetime.datetime - :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object - :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - """ - - _validation = { - 'stage_name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'stage_status': {'readonly': True}, - 'stage_time': {'readonly': True}, - 'job_stage_details': {'readonly': True}, - 'error_details': {'readonly': True}, - } - - _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'stage_status': {'key': 'stageStatus', 'type': 'str'}, - 'stage_time': {'key': 'stageTime', 'type': 'iso-8601'}, - 'job_stage_details': {'key': 'jobStageDetails', 'type': 'object'}, - 'error_details': {'key': 'errorDetails', 'type': '[JobErrorDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(JobStages, self).__init__(**kwargs) - self.stage_name = None - self.display_name = None - self.stage_status = None - self.stage_time = None - self.job_stage_details = None - self.error_details = None - - -class NotificationPreference(msrest.serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", - "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool - """ - - _validation = { - 'stage_name': {'required': True}, - 'send_notification': {'required': True}, - } - - _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs['stage_name'] - self.send_notification = kwargs['send_notification'] - - -class Operation(msrest.serialization.Model): - """Operation entity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the operation. Format: - {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. - :vartype name: str - :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay - :ivar properties: Operation properties. - :vartype properties: object - :ivar origin: Origin of the operation. Can be : user|system|user,system. - :vartype origin: str - """ - - _validation = { - 'name': {'readonly': True}, - 'display': {'readonly': True}, - 'properties': {'readonly': True}, - 'origin': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'origin': {'key': 'origin', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None - self.properties = None - self.origin = None - - -class OperationDisplay(msrest.serialization.Model): - """Operation display. - - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class OperationList(msrest.serialization.Model): - """Operation Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class PackageShippingDetails(msrest.serialization.Model): - """Shipping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar tracking_id: Tracking Id of shipment. - :vartype tracking_id: str - :ivar tracking_url: Url where shipment can be tracked. - :vartype tracking_url: str - """ - - _validation = { - 'carrier_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, - } - - _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PackageShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.tracking_id = None - self.tracking_url = None - - -class Preferences(msrest.serialization.Model): - """Preferences related to the order. - - :param preferred_data_center_region: Preferred Data Center Region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - """ - - _attribute_map = { - 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - } - - def __init__( - self, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) - self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) - self.transport_preferences = kwargs.get('transport_preferences', None) - - -class PreferencesValidationRequest(ValidationInputRequest): - """Request to validate preference of transport and data center. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference requested with respect to transport type and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - """ - - _validation = { - 'validation_type': {'required': True}, - 'device_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'preference': {'key': 'preference', 'type': 'Preferences'}, - 'device_type': {'key': 'deviceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PreferencesValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str - self.preference = kwargs.get('preference', None) - self.device_type = kwargs['device_type'] - - -class PreferencesValidationResponseProperties(ValidationInputResponse): - """Properties of data center and transport preference validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Validation status of requested data center and transport. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PreferencesValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidatePreferences' # type: str - self.status = None - - -class RegionConfigurationRequest(msrest.serialization.Model): - """Request body to get the configuration for the region. - - :param schedule_availability_request: Request body to get the availability for scheduling - orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given - sku. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest - """ - - _attribute_map = { - 'schedule_availability_request': {'key': 'scheduleAvailabilityRequest', 'type': 'ScheduleAvailabilityRequest'}, - 'transport_availability_request': {'key': 'transportAvailabilityRequest', 'type': 'TransportAvailabilityRequest'}, - } - - def __init__( - self, - **kwargs - ): - super(RegionConfigurationRequest, self).__init__(**kwargs) - self.schedule_availability_request = kwargs.get('schedule_availability_request', None) - self.transport_availability_request = kwargs.get('transport_availability_request', None) - - -class RegionConfigurationResponse(msrest.serialization.Model): - """Configuration response specific to a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar schedule_availability_response: Schedule availability for given sku in a region. - :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse - :ivar transport_availability_response: Transport options available for given sku in a region. - :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse - """ - - _validation = { - 'schedule_availability_response': {'readonly': True}, - 'transport_availability_response': {'readonly': True}, - } - - _attribute_map = { - 'schedule_availability_response': {'key': 'scheduleAvailabilityResponse', 'type': 'ScheduleAvailabilityResponse'}, - 'transport_availability_response': {'key': 'transportAvailabilityResponse', 'type': 'TransportAvailabilityResponse'}, - } - - def __init__( - self, - **kwargs - ): - super(RegionConfigurationResponse, self).__init__(**kwargs) - self.schedule_availability_response = None - self.transport_availability_response = None - - -class ScheduleAvailabilityResponse(msrest.serialization.Model): - """Schedule availability response for given sku in a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar available_dates: List of dates available to schedule. - :vartype available_dates: list[~datetime.datetime] - """ - - _validation = { - 'available_dates': {'readonly': True}, - } - - _attribute_map = { - 'available_dates': {'key': 'availableDates', 'type': '[iso-8601]'}, - } - - def __init__( - self, - **kwargs - ): - super(ScheduleAvailabilityResponse, self).__init__(**kwargs) - self.available_dates = None - - -class ShareCredentialDetails(msrest.serialization.Model): - """Credential details of the shares in account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar share_name: Name of the share. - :vartype share_name: str - :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType - :ivar user_name: User name for the share. - :vartype user_name: str - :ivar password: Password for the share. - :vartype password: str - :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] - """ - - _validation = { - 'share_name': {'readonly': True}, - 'share_type': {'readonly': True}, - 'user_name': {'readonly': True}, - 'password': {'readonly': True}, - 'supported_access_protocols': {'readonly': True}, - } - - _attribute_map = { - 'share_name': {'key': 'shareName', 'type': 'str'}, - 'share_type': {'key': 'shareType', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ShareCredentialDetails, self).__init__(**kwargs) - self.share_name = None - self.share_type = None - self.user_name = None - self.password = None - self.supported_access_protocols = None - - -class ShipmentPickUpRequest(msrest.serialization.Model): - """Shipment pick up request details. - - All required parameters must be populated in order to send to Azure. - - :param start_time: Required. Minimum date after which the pick up should commence, this must be - in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be - in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str - """ - - _validation = { - 'start_time': {'required': True}, - 'end_time': {'required': True}, - 'shipment_location': {'required': True}, - } - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'shipment_location': {'key': 'shipmentLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs['start_time'] - self.end_time = kwargs['end_time'] - self.shipment_location = kwargs['shipment_location'] - - -class ShipmentPickUpResponse(msrest.serialization.Model): - """Shipment pick up response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar confirmation_number: Confirmation number for the pick up request. - :vartype confirmation_number: str - :ivar ready_by_time: Time by which shipment should be ready for pick up, this is in local time - of pick up area. - :vartype ready_by_time: ~datetime.datetime - """ - - _validation = { - 'confirmation_number': {'readonly': True}, - 'ready_by_time': {'readonly': True}, - } - - _attribute_map = { - 'confirmation_number': {'key': 'confirmationNumber', 'type': 'str'}, - 'ready_by_time': {'key': 'readyByTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ShipmentPickUpResponse, self).__init__(**kwargs) - self.confirmation_number = None - self.ready_by_time = None - - -class ShippingAddress(msrest.serialization.Model): - """Shipping address where customer wishes to receive the device. - - All required parameters must be populated in order to send to Azure. - - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType - """ - - _validation = { - 'street_address1': {'required': True}, - 'country': {'required': True}, - 'postal_code': {'required': True}, - } - - _attribute_map = { - 'street_address1': {'key': 'streetAddress1', 'type': 'str'}, - 'street_address2': {'key': 'streetAddress2', 'type': 'str'}, - 'street_address3': {'key': 'streetAddress3', 'type': 'str'}, - 'city': {'key': 'city', 'type': 'str'}, - 'state_or_province': {'key': 'stateOrProvince', 'type': 'str'}, - 'country': {'key': 'country', 'type': 'str'}, - 'postal_code': {'key': 'postalCode', 'type': 'str'}, - 'zip_extended_code': {'key': 'zipExtendedCode', 'type': 'str'}, - 'company_name': {'key': 'companyName', 'type': 'str'}, - 'address_type': {'key': 'addressType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs['street_address1'] - self.street_address2 = kwargs.get('street_address2', None) - self.street_address3 = kwargs.get('street_address3', None) - self.city = kwargs.get('city', None) - self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs['country'] - self.postal_code = kwargs['postal_code'] - self.zip_extended_code = kwargs.get('zip_extended_code', None) - self.company_name = kwargs.get('company_name', None) - self.address_type = kwargs.get('address_type', None) - - -class Sku(msrest.serialization.Model): - """The Sku. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.display_name = kwargs.get('display_name', None) - self.family = kwargs.get('family', None) - - -class SkuAvailabilityValidationRequest(ValidationInputRequest): - """Request to validate sku availability. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". - :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: - https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - """ - - _validation = { - 'validation_type': {'required': True}, - 'device_type': {'required': True}, - 'transfer_type': {'required': True, 'constant': True}, - 'country': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'device_type': {'key': 'deviceType', 'type': 'str'}, - 'transfer_type': {'key': 'transferType', 'type': 'str'}, - 'country': {'key': 'country', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - transfer_type = "ImportToAzure" - - def __init__( - self, - **kwargs - ): - super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str - self.device_type = kwargs['device_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] - - -class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): - """Properties of sku availability validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", - "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSkuAvailability' # type: str - self.status = None - - -class SkuCapacity(msrest.serialization.Model): - """Capacity of the sku. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar usable: Usable capacity in TB. - :vartype usable: str - :ivar maximum: Maximum capacity in TB. - :vartype maximum: str - """ - - _validation = { - 'usable': {'readonly': True}, - 'maximum': {'readonly': True}, - } - - _attribute_map = { - 'usable': {'key': 'usable', 'type': 'str'}, - 'maximum': {'key': 'maximum', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuCapacity, self).__init__(**kwargs) - self.usable = None - self.maximum = None - - -class SkuCost(msrest.serialization.Model): - """Describes metadata for retrieving price info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar meter_id: Meter id of the Sku. - :vartype meter_id: str - :ivar meter_type: The type of the meter. - :vartype meter_type: str - """ - - _validation = { - 'meter_id': {'readonly': True}, - 'meter_type': {'readonly': True}, - } - - _attribute_map = { - 'meter_id': {'key': 'meterId', 'type': 'str'}, - 'meter_type': {'key': 'meterType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuCost, self).__init__(**kwargs) - self.meter_id = None - self.meter_type = None - - -class SkuInformation(msrest.serialization.Model): - """Information of the sku. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku - :ivar enabled: The sku is enabled or not. - :vartype enabled: bool - :ivar destination_to_service_location_map: The map of destination location to service location. - :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] - :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity - :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] - :ivar api_versions: Api versions that support this Sku. - :vartype api_versions: list[str] - :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason - :ivar disabled_reason_message: Message for why the Sku is disabled. - :vartype disabled_reason_message: str - :ivar required_feature: Required feature to access the sku. - :vartype required_feature: str - """ - - _validation = { - 'sku': {'readonly': True}, - 'enabled': {'readonly': True}, - 'destination_to_service_location_map': {'readonly': True}, - 'capacity': {'readonly': True}, - 'costs': {'readonly': True}, - 'api_versions': {'readonly': True}, - 'disabled_reason': {'readonly': True}, - 'disabled_reason_message': {'readonly': True}, - 'required_feature': {'readonly': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'destination_to_service_location_map': {'key': 'properties.destinationToServiceLocationMap', 'type': '[DestinationToServiceLocationMap]'}, - 'capacity': {'key': 'properties.capacity', 'type': 'SkuCapacity'}, - 'costs': {'key': 'properties.costs', 'type': '[SkuCost]'}, - 'api_versions': {'key': 'properties.apiVersions', 'type': '[str]'}, - 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'str'}, - 'disabled_reason_message': {'key': 'properties.disabledReasonMessage', 'type': 'str'}, - 'required_feature': {'key': 'properties.requiredFeature', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SkuInformation, self).__init__(**kwargs) - self.sku = None - self.enabled = None - self.destination_to_service_location_map = None - self.capacity = None - self.costs = None - self.api_versions = None - self.disabled_reason = None - self.disabled_reason_message = None - self.required_feature = None - - -class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): - """Request to validate subscription permission to create jobs. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - """ - - _validation = { - 'validation_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str - - -class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): - """Properties of subscription permission to create job validation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error - :ivar status: Validation status of subscription permission to create job. Possible values - include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus - """ - - _validation = { - 'validation_type': {'required': True}, - 'error': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) - self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str - self.status = None - - -class TransportAvailabilityDetails(msrest.serialization.Model): - """Transport options availability details for given region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar shipment_type: Transport Shipment Type supported for given region. Possible values - include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - - _validation = { - 'shipment_type': {'readonly': True}, - } - - _attribute_map = { - 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityDetails, self).__init__(**kwargs) - self.shipment_type = None - - -class TransportAvailabilityRequest(msrest.serialization.Model): - """Request body to get the transport availability for given sku. - - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", - "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - """ - - _attribute_map = { - 'sku_name': {'key': 'skuName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = kwargs.get('sku_name', None) - - -class TransportAvailabilityResponse(msrest.serialization.Model): - """Transport options available for given sku in a region. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar transport_availability_details: List of transport availability details for given region. - :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] - """ - - _validation = { - 'transport_availability_details': {'readonly': True}, - } - - _attribute_map = { - 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportAvailabilityResponse, self).__init__(**kwargs) - self.transport_availability_details = None - - -class TransportPreferences(msrest.serialization.Model): - """Preferences related to the shipment logistics of the sku. - - All required parameters must be populated in order to send to Azure. - - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer - preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes - """ - - _validation = { - 'preferred_shipment_type': {'required': True}, - } - - _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportPreferences, self).__init__(**kwargs) - self.preferred_shipment_type = kwargs['preferred_shipment_type'] - - -class UnencryptedCredentials(msrest.serialization.Model): - """Unencrypted credentials for accessing device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_name: Name of the job. - :vartype job_name: str - :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets - """ - - _validation = { - 'job_name': {'readonly': True}, - 'job_secrets': {'readonly': True}, - } - - _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentials, self).__init__(**kwargs) - self.job_name = None - self.job_secrets = None - - -class UnencryptedCredentialsList(msrest.serialization.Model): - """List of unencrypted credentials for accessing device. - - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UnencryptedCredentialsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class UpdateJobDetails(msrest.serialization.Model): - """Job details for update. - - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - """ - - _attribute_map = { - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = kwargs.get('contact_details', None) - self.shipping_address = kwargs.get('shipping_address', None) - - -class ValidateAddress(ValidationInputRequest): - """The requirements to validate customer address where the device needs to be shipped. - - All required parameters must be populated in order to send to Azure. - - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: - "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - """ - - _validation = { - 'validation_type': {'required': True}, - 'shipping_address': {'required': True}, - 'device_type': {'required': True}, - } - - _attribute_map = { - 'validation_type': {'key': 'validationType', 'type': 'str'}, - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'device_type': {'key': 'deviceType', 'type': 'str'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidateAddress, self).__init__(**kwargs) - self.validation_type = 'ValidateAddress' # type: str - self.shipping_address = kwargs['shipping_address'] - self.device_type = kwargs['device_type'] - self.transport_preferences = kwargs.get('transport_preferences', None) - - -class ValidationResponse(msrest.serialization.Model): - """Response of pre job creation validations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: Overall validation status. Possible values include: "AllValidToProceed", - "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus - :ivar individual_response_details: List of response details contain validationType and its - response as key and value respectively. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] - """ - - _validation = { - 'status': {'readonly': True}, - 'individual_response_details': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'str'}, - 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, - } - - def __init__( - self, - **kwargs - ): - super(ValidationResponse, self).__init__(**kwargs) - self.status = None - self.individual_response_details = None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models_py3.py index 89c416984590..53ab889aa00b 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models_py3.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/models/_models_py3.py @@ -23,12 +23,14 @@ class AccountCredentialDetails(msrest.serialization.Model): :vartype account_name: str :ivar data_destination_type: Data Destination Type. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType + :vartype data_destination_type: str or + ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType :ivar account_connection_string: Connection string of the account endpoint to use the account as a storage endpoint on the device. :vartype account_connection_string: str :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] + :vartype share_credential_details: + list[~azure.mgmt.databox.v2019_09_01.models.ShareCredentialDetails] """ _validation = { @@ -49,6 +51,8 @@ def __init__( self, **kwargs ): + """ + """ super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None self.data_destination_type = None @@ -61,18 +65,20 @@ class AddressValidationOutput(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param validation_type: Identifies the type of validation response.Constant filled by server. + :ivar validation_type: Identifies the type of validation response.Constant filled by server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2019_09_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2019_09_01.models.ShippingAddress] """ _validation = { @@ -92,6 +98,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationOutput, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -109,13 +117,14 @@ class ValidationInputResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error """ _validation = { @@ -136,6 +145,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputResponse, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -148,18 +159,20 @@ class AddressValidationProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2019_09_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2019_09_01.models.ShippingAddress] """ _validation = { @@ -180,6 +193,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationProperties, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str self.validation_status = None @@ -211,6 +226,8 @@ def __init__( self, **kwargs ): + """ + """ super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None @@ -245,6 +262,8 @@ def __init__( self, **kwargs ): + """ + """ super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None @@ -258,16 +277,16 @@ class AvailableSkuRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". + :ivar transfer_type: Type of the transfer. Has constant value: "ImportToAzure". :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :vartype location: str + :ivar sku_names: Sku Names to filter for available skus. + :vartype sku_names: list[str or ~azure.mgmt.databox.v2019_09_01.models.SkuName] """ _validation = { @@ -293,6 +312,16 @@ def __init__( sku_names: Optional[List[Union[str, "SkuName"]]] = None, **kwargs ): + """ + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + :keyword sku_names: Sku Names to filter for available skus. + :paramtype sku_names: list[str or ~azure.mgmt.databox.v2019_09_01.models.SkuName] + """ super(AvailableSkuRequest, self).__init__(**kwargs) self.country = country self.location = location @@ -305,9 +334,9 @@ class AvailableSkusResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2019_09_01.models.SkuInformation] + :ivar next_link: Link for the next set of skus. + :vartype next_link: str """ _validation = { @@ -325,6 +354,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of skus. + :paramtype next_link: str + """ super(AvailableSkusResult, self).__init__(**kwargs) self.value = None self.next_link = next_link @@ -335,8 +368,8 @@ class CancellationReason(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Required. Reason for cancellation. + :vartype reason: str """ _validation = { @@ -353,6 +386,10 @@ def __init__( reason: str, **kwargs ): + """ + :keyword reason: Required. Reason for cancellation. + :paramtype reason: str + """ super(CancellationReason, self).__init__(**kwargs) self.reason = reason @@ -366,10 +403,10 @@ class CloudError(msrest.serialization.Model): :vartype code: str :ivar message: Descriptive error information. :vartype message: str - :param target: Error target. - :type target: str - :param details: More detailed error information. - :type details: list[~azure.mgmt.databox.models.CloudError] + :ivar target: Error target. + :vartype target: str + :ivar details: More detailed error information. + :vartype details: list[~azure.mgmt.databox.v2019_09_01.models.CloudError] """ _validation = { @@ -391,6 +428,12 @@ def __init__( details: Optional[List["CloudError"]] = None, **kwargs ): + """ + :keyword target: Error target. + :paramtype target: str + :keyword details: More detailed error information. + :paramtype details: list[~azure.mgmt.databox.v2019_09_01.models.CloudError] + """ super(CloudError, self).__init__(**kwargs) self.code = None self.message = None @@ -403,18 +446,19 @@ class ContactDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :ivar contact_name: Required. Contact name of the person. + :vartype contact_name: str + :ivar phone: Required. Phone number of the contact person. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: Required. List of Email-ids to be notified about job progress. + :vartype email_list: list[str] + :ivar notification_preference: Notification preference for a job stage. + :vartype notification_preference: + list[~azure.mgmt.databox.v2019_09_01.models.NotificationPreference] """ _validation = { @@ -443,6 +487,21 @@ def __init__( notification_preference: Optional[List["NotificationPreference"]] = None, **kwargs ): + """ + :keyword contact_name: Required. Contact name of the person. + :paramtype contact_name: str + :keyword phone: Required. Phone number of the contact person. + :paramtype phone: str + :keyword phone_extension: Phone extension number of the contact person. + :paramtype phone_extension: str + :keyword mobile: Mobile number of the contact person. + :paramtype mobile: str + :keyword email_list: Required. List of Email-ids to be notified about job progress. + :paramtype email_list: list[str] + :keyword notification_preference: Notification preference for a job stage. + :paramtype notification_preference: + list[~azure.mgmt.databox.v2019_09_01.models.NotificationPreference] + """ super(ContactDetails, self).__init__(**kwargs) self.contact_name = contact_name self.phone = phone @@ -460,9 +519,10 @@ class CopyLogDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator """ _validation = { @@ -481,6 +541,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] @@ -494,7 +556,8 @@ class CopyProgress(msrest.serialization.Model): :vartype storage_account_name: str :ivar data_destination_type: Data Destination Type. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType + :vartype data_destination_type: str or + ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str :ivar bytes_sent_to_cloud: Amount of data uploaded by the job as of now. @@ -550,6 +613,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None self.data_destination_type = None @@ -572,12 +637,13 @@ class ValidationRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details contain validationType and + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Identify the nature of validation.Constant filled by + :vartype individual_request_details: + list[~azure.mgmt.databox.v2019_09_01.models.ValidationInputRequest] + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str + :vartype validation_category: str """ _validation = { @@ -600,6 +666,12 @@ def __init__( individual_request_details: List["ValidationInputRequest"], **kwargs ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2019_09_01.models.ValidationInputRequest] + """ super(ValidationRequest, self).__init__(**kwargs) self.individual_request_details = individual_request_details self.validation_category = None # type: Optional[str] @@ -610,12 +682,13 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param individual_request_details: Required. List of request details contain validationType and + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] - :param validation_category: Required. Identify the nature of validation.Constant filled by + :vartype individual_request_details: + list[~azure.mgmt.databox.v2019_09_01.models.ValidationInputRequest] + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str + :vartype validation_category: str """ _validation = { @@ -634,6 +707,12 @@ def __init__( individual_request_details: List["ValidationInputRequest"], **kwargs ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2019_09_01.models.ValidationInputRequest] + """ super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) self.validation_category = 'JobCreationValidation' # type: str @@ -646,11 +725,12 @@ class ValidationInputRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator """ _validation = { @@ -669,6 +749,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputRequest, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] @@ -678,14 +760,15 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName """ _validation = { @@ -704,6 +787,11 @@ def __init__( device_type: Union[str, "SkuName"], **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + """ super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str self.device_type = device_type @@ -716,16 +804,17 @@ class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInpu All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error :ivar status: Create order limit validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.ValidationStatus """ _validation = { @@ -744,6 +833,8 @@ def __init__( self, **kwargs ): + """ + """ super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str self.status = None @@ -756,9 +847,10 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator :ivar account_name: Destination account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -781,6 +873,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBox' # type: str self.account_name = None @@ -794,9 +888,10 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -823,6 +918,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None @@ -844,7 +941,7 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.CopyStatus """ _validation = { @@ -865,6 +962,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -882,30 +981,31 @@ class JobDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2019_09_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype return_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails + :ivar destination_account_details: Required. Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2019_09_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. @@ -927,7 +1027,7 @@ class JobDetails(msrest.serialization.Model): } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, @@ -952,12 +1052,26 @@ def __init__( contact_details: "ContactDetails", shipping_address: "ShippingAddress", destination_account_details: List["DestinationAccountDetails"], - expected_data_size_in_terabytes: Optional[int] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, preferences: Optional["Preferences"] = None, **kwargs ): + """ + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress + :keyword destination_account_details: Required. Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences + """ super(JobDetails, self).__init__(**kwargs) - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes self.job_stages = None self.contact_details = contact_details self.shipping_address = shipping_address @@ -979,45 +1093,46 @@ class DataBoxDiskJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2019_09_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype return_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails + :ivar destination_account_details: Required. Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2019_09_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :ivar preferred_disks: User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :vartype copy_progress: list[~azure.mgmt.databox.v2019_09_01.models.DataBoxDiskCopyProgress] :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str + :ivar passkey: User entered passkey for DataBox Disk job. + :vartype passkey: str """ _validation = { @@ -1037,7 +1152,7 @@ class DataBoxDiskJobDetails(JobDetails): } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, @@ -1062,13 +1177,33 @@ def __init__( contact_details: "ContactDetails", shipping_address: "ShippingAddress", destination_account_details: List["DestinationAccountDetails"], - expected_data_size_in_terabytes: Optional[int] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, preferences: Optional["Preferences"] = None, preferred_disks: Optional[Dict[str, int]] = None, passkey: Optional[str] = None, **kwargs ): - super(DataBoxDiskJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) + """ + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress + :keyword destination_account_details: Required. Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences + :keyword preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. + :paramtype preferred_disks: dict[str, int] + :keyword passkey: User entered passkey for DataBox Disk job. + :paramtype passkey: str + """ + super(DataBoxDiskJobDetails, self).__init__(expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) self.job_details_type = 'DataBoxDisk' # type: str self.preferred_disks = preferred_disks self.copy_progress = None @@ -1084,11 +1219,11 @@ class JobSecrets(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode """ _validation = { @@ -1110,6 +1245,10 @@ def __init__( dc_access_security_code: Optional["DcAccessSecurityCode"] = None, **kwargs ): + """ + :keyword dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :paramtype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode + """ super(JobSecrets, self).__init__(**kwargs) self.job_secrets_type = None # type: Optional[str] self.dc_access_security_code = dc_access_security_code @@ -1122,13 +1261,13 @@ class DataBoxDiskJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~azure.mgmt.databox.v2019_09_01.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -1156,6 +1295,10 @@ def __init__( dc_access_security_code: Optional["DcAccessSecurityCode"] = None, **kwargs ): + """ + :keyword dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :paramtype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode + """ super(DataBoxDiskJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None @@ -1170,9 +1313,10 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator :ivar account_name: Destination account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -1195,6 +1339,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None @@ -1208,38 +1354,39 @@ class DataBoxHeavyJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2019_09_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype return_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails + :ivar destination_account_details: Required. Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2019_09_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. - :type device_password: str + :vartype copy_progress: list[~azure.mgmt.databox.v2019_09_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox Heavy. + :vartype device_password: str """ _validation = { @@ -1258,7 +1405,7 @@ class DataBoxHeavyJobDetails(JobDetails): } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, @@ -1281,12 +1428,28 @@ def __init__( contact_details: "ContactDetails", shipping_address: "ShippingAddress", destination_account_details: List["DestinationAccountDetails"], - expected_data_size_in_terabytes: Optional[int] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, preferences: Optional["Preferences"] = None, device_password: Optional[str] = None, **kwargs ): - super(DataBoxHeavyJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) + """ + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress + :keyword destination_account_details: Required. Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences + :keyword device_password: Set Device password for unlocking Databox Heavy. + :paramtype device_password: str + """ + super(DataBoxHeavyJobDetails, self).__init__(expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None self.device_password = device_password @@ -1299,13 +1462,13 @@ class DataBoxHeavyJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2019_09_01.models.DataBoxHeavySecret] """ _validation = { @@ -1325,6 +1488,10 @@ def __init__( dc_access_security_code: Optional["DcAccessSecurityCode"] = None, **kwargs ): + """ + :keyword dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :paramtype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode + """ super(DataBoxHeavyJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None @@ -1340,12 +1507,14 @@ class DataBoxHeavySecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2019_09_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2019_09_01.models.AccountCredentialDetails] """ _validation = { @@ -1368,6 +1537,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1383,38 +1554,39 @@ class DataBoxJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2019_09_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param destination_account_details: Required. Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype return_package: ~azure.mgmt.databox.v2019_09_01.models.PackageShippingDetails + :ivar destination_account_details: Required. Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] :ivar error_details: Error details for failure. This is optional. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2019_09_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. - :type device_password: str + :vartype copy_progress: list[~azure.mgmt.databox.v2019_09_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox. + :vartype device_password: str """ _validation = { @@ -1433,7 +1605,7 @@ class DataBoxJobDetails(JobDetails): } _attribute_map = { - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, @@ -1456,12 +1628,28 @@ def __init__( contact_details: "ContactDetails", shipping_address: "ShippingAddress", destination_account_details: List["DestinationAccountDetails"], - expected_data_size_in_terabytes: Optional[int] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, preferences: Optional["Preferences"] = None, device_password: Optional[str] = None, **kwargs ): - super(DataBoxJobDetails, self).__init__(expected_data_size_in_terabytes=expected_data_size_in_terabytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) + """ + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress + :keyword destination_account_details: Required. Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2019_09_01.models.Preferences + :keyword device_password: Set Device password for unlocking Databox. + :paramtype device_password: str + """ + super(DataBoxJobDetails, self).__init__(expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, contact_details=contact_details, shipping_address=shipping_address, destination_account_details=destination_account_details, preferences=preferences, **kwargs) self.job_details_type = 'DataBox' # type: str self.copy_progress = None self.device_password = device_password @@ -1472,13 +1660,13 @@ class DataboxJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :type dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2019_09_01.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode + :ivar pod_secrets: Contains the list of secret objects for a job. + :vartype pod_secrets: list[~azure.mgmt.databox.v2019_09_01.models.DataBoxSecret] """ _validation = { @@ -1498,6 +1686,12 @@ def __init__( pod_secrets: Optional[List["DataBoxSecret"]] = None, **kwargs ): + """ + :keyword dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :paramtype dc_access_security_code: ~azure.mgmt.databox.v2019_09_01.models.DcAccessSecurityCode + :keyword pod_secrets: Contains the list of secret objects for a job. + :paramtype pod_secrets: list[~azure.mgmt.databox.v2019_09_01.models.DataBoxSecret] + """ super(DataboxJobSecrets, self).__init__(dc_access_security_code=dc_access_security_code, **kwargs) self.job_secrets_type = 'DataBox' # type: str self.pod_secrets = pod_secrets @@ -1511,13 +1705,13 @@ class ScheduleAvailabilityRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :ivar storage_location: Required. Location for data transfer. + For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName """ _validation = { @@ -1540,6 +1734,12 @@ def __init__( storage_location: str, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. + For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + """ super(ScheduleAvailabilityRequest, self).__init__(**kwargs) self.storage_location = storage_location self.sku_name = None # type: Optional[str] @@ -1550,13 +1750,13 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :ivar storage_location: Required. Location for data transfer. + For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName """ _validation = { @@ -1575,6 +1775,12 @@ def __init__( storage_location: str, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. + For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + """ super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) self.sku_name = 'DataBox' # type: str @@ -1589,12 +1795,14 @@ class DataBoxSecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2019_09_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2019_09_01.models.AccountCredentialDetails] """ _validation = { @@ -1617,6 +1825,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1630,15 +1840,17 @@ class DataDestinationDetailsValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param destination_account_details: Required. Destination account details list. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] - :param location: Required. Location of stamp or geo. - :type location: str + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator + :ivar destination_account_details: Required. Destination account details list. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] + :ivar location: Required. Location of stamp or geo. + :vartype location: str """ _validation = { @@ -1660,6 +1872,13 @@ def __init__( location: str, **kwargs ): + """ + :keyword destination_account_details: Required. Destination account details list. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] + :keyword location: Required. Location of stamp or geo. + :paramtype location: str + """ super(DataDestinationDetailsValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateDataDestinationDetails' # type: str self.destination_account_details = destination_account_details @@ -1673,16 +1892,17 @@ class DataDestinationDetailsValidationResponseProperties(ValidationInputResponse All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error :ivar status: Data destination details validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.ValidationStatus """ _validation = { @@ -1701,6 +1921,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataDestinationDetailsValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateDataDestinationDetails' # type: str self.status = None @@ -1709,15 +1931,15 @@ def __init__( class DcAccessSecurityCode(msrest.serialization.Model): """Dc Access Security code for device. - :param forward_dc_access_code: Dc Access Code for dispatching from DC. - :type forward_dc_access_code: str - :param reverse_dc_access_code: Dc Access code for dropping off at DC. - :type reverse_dc_access_code: str + :ivar forward_dc_access_code: Dc Access Code for dispatching from DC. + :vartype forward_dc_access_code: str + :ivar reverse_dc_access_code: Dc Access code for dropping off at DC. + :vartype reverse_dc_access_code: str """ _attribute_map = { - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDCAccessCode', 'type': 'str'}, + 'reverse_dc_access_code': {'key': 'reverseDCAccessCode', 'type': 'str'}, } def __init__( @@ -1727,6 +1949,12 @@ def __init__( reverse_dc_access_code: Optional[str] = None, **kwargs ): + """ + :keyword forward_dc_access_code: Dc Access Code for dispatching from DC. + :paramtype forward_dc_access_code: str + :keyword reverse_dc_access_code: Dc Access code for dropping off at DC. + :paramtype reverse_dc_access_code: str + """ super(DcAccessSecurityCode, self).__init__(**kwargs) self.forward_dc_access_code = forward_dc_access_code self.reverse_dc_access_code = reverse_dc_access_code @@ -1740,13 +1968,14 @@ class DestinationAccountDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. + :ivar data_destination_type: Required. Data Destination Type.Constant filled by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str + :vartype data_destination_type: str or + ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType + :ivar account_id: Arm Id of the destination where the data has to be moved. + :vartype account_id: str + :ivar share_password: Share password to be shared by all shares in SA. + :vartype share_password: str """ _validation = { @@ -1770,6 +1999,12 @@ def __init__( share_password: Optional[str] = None, **kwargs ): + """ + :keyword account_id: Arm Id of the destination where the data has to be moved. + :paramtype account_id: str + :keyword share_password: Share password to be shared by all shares in SA. + :paramtype share_password: str + """ super(DestinationAccountDetails, self).__init__(**kwargs) self.data_destination_type = None # type: Optional[str] self.account_id = account_id @@ -1781,19 +2016,20 @@ class DestinationManagedDiskDetails(DestinationAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. + :ivar data_destination_type: Required. Data Destination Type.Constant filled by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param resource_group_id: Required. Destination Resource Group Id where the Compute disks - should be created. - :type resource_group_id: str - :param staging_storage_account_id: Required. Arm Id of the storage account that can be used to + :vartype data_destination_type: str or + ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType + :ivar account_id: Arm Id of the destination where the data has to be moved. + :vartype account_id: str + :ivar share_password: Share password to be shared by all shares in SA. + :vartype share_password: str + :ivar resource_group_id: Required. Destination Resource Group Id where the Compute disks should + be created. + :vartype resource_group_id: str + :ivar staging_storage_account_id: Required. Arm Id of the storage account that can be used to copy the vhd for staging. - :type staging_storage_account_id: str + :vartype staging_storage_account_id: str """ _validation = { @@ -1819,6 +2055,18 @@ def __init__( share_password: Optional[str] = None, **kwargs ): + """ + :keyword account_id: Arm Id of the destination where the data has to be moved. + :paramtype account_id: str + :keyword share_password: Share password to be shared by all shares in SA. + :paramtype share_password: str + :keyword resource_group_id: Required. Destination Resource Group Id where the Compute disks + should be created. + :paramtype resource_group_id: str + :keyword staging_storage_account_id: Required. Arm Id of the storage account that can be used + to copy the vhd for staging. + :paramtype staging_storage_account_id: str + """ super(DestinationManagedDiskDetails, self).__init__(account_id=account_id, share_password=share_password, **kwargs) self.data_destination_type = 'ManagedDisk' # type: str self.resource_group_id = resource_group_id @@ -1830,15 +2078,16 @@ class DestinationStorageAccountDetails(DestinationAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_destination_type: Required. Data Destination Type.Constant filled by server. + :ivar data_destination_type: Required. Data Destination Type.Constant filled by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_destination_type: str or ~azure.mgmt.databox.models.DataDestinationType - :param account_id: Arm Id of the destination where the data has to be moved. - :type account_id: str - :param share_password: Share password to be shared by all shares in SA. - :type share_password: str - :param storage_account_id: Required. Destination Storage Account Arm Id. - :type storage_account_id: str + :vartype data_destination_type: str or + ~azure.mgmt.databox.v2019_09_01.models.DataDestinationType + :ivar account_id: Arm Id of the destination where the data has to be moved. + :vartype account_id: str + :ivar share_password: Share password to be shared by all shares in SA. + :vartype share_password: str + :ivar storage_account_id: Required. Destination Storage Account Arm Id. + :vartype storage_account_id: str """ _validation = { @@ -1861,6 +2110,14 @@ def __init__( share_password: Optional[str] = None, **kwargs ): + """ + :keyword account_id: Arm Id of the destination where the data has to be moved. + :paramtype account_id: str + :keyword share_password: Share password to be shared by all shares in SA. + :paramtype share_password: str + :keyword storage_account_id: Required. Destination Storage Account Arm Id. + :paramtype storage_account_id: str + """ super(DestinationStorageAccountDetails, self).__init__(account_id=account_id, share_password=share_password, **kwargs) self.data_destination_type = 'StorageAccount' # type: str self.storage_account_id = storage_account_id @@ -1891,6 +2148,8 @@ def __init__( self, **kwargs ): + """ + """ super(DestinationToServiceLocationMap, self).__init__(**kwargs) self.destination_location = None self.service_location = None @@ -1901,40 +2160,49 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to + :ivar storage_location: Required. Location for data transfer. + For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + :ivar expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int """ _validation = { 'storage_location': {'required': True}, 'sku_name': {'required': True}, - 'expected_data_size_in_terabytes': {'required': True}, + 'expected_data_size_in_tera_bytes': {'required': True}, } _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, } def __init__( self, *, storage_location: str, - expected_data_size_in_terabytes: int, - **kwargs - ): + expected_data_size_in_tera_bytes: int, + **kwargs + ): + """ + :keyword storage_location: Required. Location for data transfer. + For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs + to be transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes class DiskSecret(msrest.serialization.Model): @@ -1963,6 +2231,8 @@ def __init__( self, **kwargs ): + """ + """ super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None @@ -1993,6 +2263,8 @@ def __init__( self, **kwargs ): + """ + """ super(Error, self).__init__(**kwargs) self.code = None self.message = None @@ -2003,13 +2275,13 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. - For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api- - version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :ivar storage_location: Required. Location for data transfer. + For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName """ _validation = { @@ -2028,6 +2300,12 @@ def __init__( storage_location: str, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. + For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + """ super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, **kwargs) self.sku_name = 'DataBoxHeavy' # type: str @@ -2035,8 +2313,8 @@ def __init__( class JobDeliveryInfo(msrest.serialization.Model): """Additional delivery info. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime """ _attribute_map = { @@ -2049,6 +2327,10 @@ def __init__( scheduled_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword scheduled_date_time: Scheduled date time. + :paramtype scheduled_date_time: ~datetime.datetime + """ super(JobDeliveryInfo, self).__init__(**kwargs) self.scheduled_date_time = scheduled_date_time @@ -2086,6 +2368,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobErrorDetails, self).__init__(**kwargs) self.error_message = None self.error_code = None @@ -2098,16 +2382,16 @@ class Resource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2019_09_01.models.Sku """ _validation = { @@ -2129,6 +2413,18 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2019_09_01.models.Sku + """ super(Resource, self).__init__(**kwargs) self.location = location self.tags = tags @@ -2142,16 +2438,16 @@ class JobResource(Resource): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2019_09_01.models.Sku :ivar name: Name of the object. :vartype name: str :ivar id: Id of the object. @@ -2169,20 +2465,20 @@ class JobResource(Resource): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.models.StageName + :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.StageName :ivar start_time: Time at which the job was started in UTC ISO 8601 format. :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.Error - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error + :ivar details: Details of a job run. This field will only be sent for expand details filter. + :vartype details: ~azure.mgmt.databox.v2019_09_01.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo + :ivar delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :vartype delivery_type: str or ~azure.mgmt.databox.v2019_09_01.models.JobDeliveryType + :ivar delivery_info: Delivery Info of Job. + :vartype delivery_info: ~azure.mgmt.databox.v2019_09_01.models.JobDeliveryInfo :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. :vartype is_cancellable_without_fee: bool """ @@ -2230,10 +2526,29 @@ def __init__( sku: "Sku", tags: Optional[Dict[str, str]] = None, details: Optional["JobDetails"] = None, - delivery_type: Optional[Union[str, "JobDeliveryType"]] = None, + delivery_type: Optional[Union[str, "JobDeliveryType"]] = "NonScheduled", delivery_info: Optional["JobDeliveryInfo"] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2019_09_01.models.Sku + :keyword details: Details of a job run. This field will only be sent for expand details filter. + :paramtype details: ~azure.mgmt.databox.v2019_09_01.models.JobDetails + :keyword delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :paramtype delivery_type: str or ~azure.mgmt.databox.v2019_09_01.models.JobDeliveryType + :keyword delivery_info: Delivery Info of Job. + :paramtype delivery_info: ~azure.mgmt.databox.v2019_09_01.models.JobDeliveryInfo + """ super(JobResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) self.name = None self.id = None @@ -2254,10 +2569,10 @@ def __init__( class JobResourceList(msrest.serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :ivar value: List of job resources. + :vartype value: list[~azure.mgmt.databox.v2019_09_01.models.JobResource] + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str """ _attribute_map = { @@ -2272,6 +2587,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of job resources. + :paramtype value: list[~azure.mgmt.databox.v2019_09_01.models.JobResource] + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ super(JobResourceList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -2280,13 +2601,14 @@ def __init__( class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails - :param destination_account_details: Destination account details. - :type destination_account_details: list[~azure.mgmt.databox.models.DestinationAccountDetails] + :vartype tags: dict[str, str] + :ivar details: Details of a job to be updated. + :vartype details: ~azure.mgmt.databox.v2019_09_01.models.UpdateJobDetails + :ivar destination_account_details: Destination account details. + :vartype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] """ _attribute_map = { @@ -2303,6 +2625,16 @@ def __init__( destination_account_details: Optional[List["DestinationAccountDetails"]] = None, **kwargs ): + """ + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword details: Details of a job to be updated. + :paramtype details: ~azure.mgmt.databox.v2019_09_01.models.UpdateJobDetails + :keyword destination_account_details: Destination account details. + :paramtype destination_account_details: + list[~azure.mgmt.databox.v2019_09_01.models.DestinationAccountDetails] + """ super(JobResourceUpdateParameter, self).__init__(**kwargs) self.tags = tags self.details = details @@ -2319,18 +2651,18 @@ class JobStages(msrest.serialization.Model): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :vartype stage_name: str or ~azure.mgmt.databox.v2019_09_01.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :vartype stage_status: str or ~azure.mgmt.databox.v2019_09_01.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. :vartype stage_time: ~datetime.datetime :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object + :vartype job_stage_details: any :ivar error_details: Error details for the stage. - :vartype error_details: list[~azure.mgmt.databox.models.JobErrorDetails] + :vartype error_details: list[~azure.mgmt.databox.v2019_09_01.models.JobErrorDetails] """ _validation = { @@ -2355,6 +2687,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None @@ -2369,11 +2703,11 @@ class NotificationPreference(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + :ivar stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :vartype stage_name: str or ~azure.mgmt.databox.v2019_09_01.models.NotificationStageName + :ivar send_notification: Required. Notification is required or not. + :vartype send_notification: bool """ _validation = { @@ -2390,9 +2724,16 @@ def __init__( self, *, stage_name: Union[str, "NotificationStageName"], - send_notification: bool, + send_notification: bool = True, **kwargs ): + """ + :keyword stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :paramtype stage_name: str or ~azure.mgmt.databox.v2019_09_01.models.NotificationStageName + :keyword send_notification: Required. Notification is required or not. + :paramtype send_notification: bool + """ super(NotificationPreference, self).__init__(**kwargs) self.stage_name = stage_name self.send_notification = send_notification @@ -2407,9 +2748,9 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2019_09_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :vartype properties: any :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str """ @@ -2432,6 +2773,8 @@ def __init__( self, **kwargs ): + """ + """ super(Operation, self).__init__(**kwargs) self.name = None self.display = None @@ -2442,14 +2785,14 @@ def __init__( class OperationDisplay(msrest.serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :ivar provider: Provider name. + :vartype provider: str + :ivar resource: Resource name. + :vartype resource: str + :ivar operation: Localized name of the operation for display purpose. + :vartype operation: str + :ivar description: Localized description of the operation for display purpose. + :vartype description: str """ _attribute_map = { @@ -2468,6 +2811,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Provider name. + :paramtype provider: str + :keyword resource: Resource name. + :paramtype resource: str + :keyword operation: Localized name of the operation for display purpose. + :paramtype operation: str + :keyword description: Localized description of the operation for display purpose. + :paramtype description: str + """ super(OperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -2481,9 +2834,9 @@ class OperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2019_09_01.models.Operation] + :ivar next_link: Link for the next set of operations. + :vartype next_link: str """ _validation = { @@ -2501,6 +2854,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of operations. + :paramtype next_link: str + """ super(OperationList, self).__init__(**kwargs) self.value = None self.next_link = next_link @@ -2535,6 +2892,8 @@ def __init__( self, **kwargs ): + """ + """ super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None @@ -2544,10 +2903,10 @@ def __init__( class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred Data Center Region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :ivar preferred_data_center_region: Preferred Data Center Region. + :vartype preferred_data_center_region: list[str] + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2019_09_01.models.TransportPreferences """ _attribute_map = { @@ -2562,6 +2921,12 @@ def __init__( transport_preferences: Optional["TransportPreferences"] = None, **kwargs ): + """ + :keyword preferred_data_center_region: Preferred Data Center Region. + :paramtype preferred_data_center_region: list[str] + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2019_09_01.models.TransportPreferences + """ super(Preferences, self).__init__(**kwargs) self.preferred_data_center_region = preferred_data_center_region self.transport_preferences = transport_preferences @@ -2572,16 +2937,17 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference requested with respect to transport type and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator + :ivar preference: Preference requested with respect to transport type and data center. + :vartype preference: ~azure.mgmt.databox.v2019_09_01.models.Preferences + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName """ _validation = { @@ -2602,6 +2968,13 @@ def __init__( preference: Optional["Preferences"] = None, **kwargs ): + """ + :keyword preference: Preference requested with respect to transport type and data center. + :paramtype preference: ~azure.mgmt.databox.v2019_09_01.models.Preferences + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + """ super(PreferencesValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str self.preference = preference @@ -2615,16 +2988,17 @@ class PreferencesValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error :ivar status: Validation status of requested data center and transport. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.ValidationStatus """ _validation = { @@ -2643,6 +3017,8 @@ def __init__( self, **kwargs ): + """ + """ super(PreferencesValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str self.status = None @@ -2651,12 +3027,14 @@ def __init__( class RegionConfigurationRequest(msrest.serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability for scheduling + :ivar schedule_availability_request: Request body to get the availability for scheduling orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given + :vartype schedule_availability_request: + ~azure.mgmt.databox.v2019_09_01.models.ScheduleAvailabilityRequest + :ivar transport_availability_request: Request body to get the transport availability for given sku. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest + :vartype transport_availability_request: + ~azure.mgmt.databox.v2019_09_01.models.TransportAvailabilityRequest """ _attribute_map = { @@ -2671,6 +3049,16 @@ def __init__( transport_availability_request: Optional["TransportAvailabilityRequest"] = None, **kwargs ): + """ + :keyword schedule_availability_request: Request body to get the availability for scheduling + orders. + :paramtype schedule_availability_request: + ~azure.mgmt.databox.v2019_09_01.models.ScheduleAvailabilityRequest + :keyword transport_availability_request: Request body to get the transport availability for + given sku. + :paramtype transport_availability_request: + ~azure.mgmt.databox.v2019_09_01.models.TransportAvailabilityRequest + """ super(RegionConfigurationRequest, self).__init__(**kwargs) self.schedule_availability_request = schedule_availability_request self.transport_availability_request = transport_availability_request @@ -2683,10 +3071,10 @@ class RegionConfigurationResponse(msrest.serialization.Model): :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse + ~azure.mgmt.databox.v2019_09_01.models.ScheduleAvailabilityResponse :ivar transport_availability_response: Transport options available for given sku in a region. :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse + ~azure.mgmt.databox.v2019_09_01.models.TransportAvailabilityResponse """ _validation = { @@ -2703,6 +3091,8 @@ def __init__( self, **kwargs ): + """ + """ super(RegionConfigurationResponse, self).__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None @@ -2729,6 +3119,8 @@ def __init__( self, **kwargs ): + """ + """ super(ScheduleAvailabilityResponse, self).__init__(**kwargs) self.available_dates = None @@ -2742,13 +3134,14 @@ class ShareCredentialDetails(msrest.serialization.Model): :vartype share_name: str :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + :vartype share_type: str or ~azure.mgmt.databox.v2019_09_01.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] + :vartype supported_access_protocols: list[str or + ~azure.mgmt.databox.v2019_09_01.models.AccessProtocol] """ _validation = { @@ -2771,6 +3164,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -2784,14 +3179,14 @@ class ShipmentPickUpRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be + :ivar start_time: Required. Minimum date after which the pick up should commence, this must be in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be + :vartype start_time: ~datetime.datetime + :ivar end_time: Required. Maximum date before which the pick up should commence, this must be in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :vartype end_time: ~datetime.datetime + :ivar shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :vartype shipment_location: str """ _validation = { @@ -2814,6 +3209,16 @@ def __init__( shipment_location: str, **kwargs ): + """ + :keyword start_time: Required. Minimum date after which the pick up should commence, this must + be in local time of pick up area. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Required. Maximum date before which the pick up should commence, this must + be in local time of pick up area. + :paramtype end_time: ~datetime.datetime + :keyword shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :paramtype shipment_location: str + """ super(ShipmentPickUpRequest, self).__init__(**kwargs) self.start_time = start_time self.end_time = end_time @@ -2846,6 +3251,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None @@ -2856,27 +3263,27 @@ class ShippingAddress(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :ivar street_address1: Required. Street Address line 1. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: Required. Name of the Country. + :vartype country: str + :ivar postal_code: Required. Postal code. + :vartype postal_code: str + :ivar zip_extended_code: Extended Zip Code. + :vartype zip_extended_code: str + :ivar company_name: Name of the company. + :vartype company_name: str + :ivar address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :vartype address_type: str or ~azure.mgmt.databox.v2019_09_01.models.AddressType """ _validation = { @@ -2910,9 +3317,32 @@ def __init__( state_or_province: Optional[str] = None, zip_extended_code: Optional[str] = None, company_name: Optional[str] = None, - address_type: Optional[Union[str, "AddressType"]] = None, - **kwargs - ): + address_type: Optional[Union[str, "AddressType"]] = "None", + **kwargs + ): + """ + :keyword street_address1: Required. Street Address line 1. + :paramtype street_address1: str + :keyword street_address2: Street Address line 2. + :paramtype street_address2: str + :keyword street_address3: Street Address line 3. + :paramtype street_address3: str + :keyword city: Name of the City. + :paramtype city: str + :keyword state_or_province: Name of the State or Province. + :paramtype state_or_province: str + :keyword country: Required. Name of the Country. + :paramtype country: str + :keyword postal_code: Required. Postal code. + :paramtype postal_code: str + :keyword zip_extended_code: Extended Zip Code. + :paramtype zip_extended_code: str + :keyword company_name: Name of the company. + :paramtype company_name: str + :keyword address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :paramtype address_type: str or ~azure.mgmt.databox.v2019_09_01.models.AddressType + """ super(ShippingAddress, self).__init__(**kwargs) self.street_address1 = street_address1 self.street_address2 = street_address2 @@ -2931,13 +3361,13 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :vartype name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + :ivar display_name: The display name of the sku. + :vartype display_name: str + :ivar family: The sku family. + :vartype family: str """ _validation = { @@ -2958,6 +3388,15 @@ def __init__( family: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + :keyword display_name: The display name of the sku. + :paramtype display_name: str + :keyword family: The sku family. + :paramtype family: str + """ super(Sku, self).__init__(**kwargs) self.name = name self.display_name = display_name @@ -2971,22 +3410,23 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :ivar transfer_type: Required. Type of the transfer. Default value: "ImportToAzure". + :vartype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + :ivar transfer_type: Type of the transfer. Has constant value: "ImportToAzure". :vartype transfer_type: str - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str + :vartype location: str """ _validation = { @@ -3015,6 +3455,17 @@ def __init__( location: str, **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + """ super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str self.device_type = device_type @@ -3029,16 +3480,17 @@ class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.ValidationStatus """ _validation = { @@ -3057,6 +3509,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str self.status = None @@ -3087,6 +3541,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None @@ -3117,6 +3573,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None @@ -3128,21 +3586,21 @@ class SkuInformation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~azure.mgmt.databox.v2019_09_01.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool :ivar destination_to_service_location_map: The map of destination location to service location. :vartype destination_to_service_location_map: - list[~azure.mgmt.databox.models.DestinationToServiceLocationMap] + list[~azure.mgmt.databox.v2019_09_01.models.DestinationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2019_09_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~azure.mgmt.databox.v2019_09_01.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :vartype disabled_reason: str or ~azure.mgmt.databox.v2019_09_01.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -3177,6 +3635,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None @@ -3194,11 +3654,12 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator """ _validation = { @@ -3213,6 +3674,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str @@ -3224,16 +3687,17 @@ class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInp All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.Error + :vartype error: ~azure.mgmt.databox.v2019_09_01.models.Error :ivar status: Validation status of subscription permission to create job. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.ValidationStatus """ _validation = { @@ -3252,6 +3716,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str self.status = None @@ -3264,7 +3730,7 @@ class TransportAvailabilityDetails(msrest.serialization.Model): :ivar shipment_type: Transport Shipment Type supported for given region. Possible values include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype shipment_type: str or ~azure.mgmt.databox.v2019_09_01.models.TransportShipmentTypes """ _validation = { @@ -3279,6 +3745,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityDetails, self).__init__(**kwargs) self.shipment_type = None @@ -3286,9 +3754,9 @@ def __init__( class TransportAvailabilityRequest(msrest.serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + :ivar sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName """ _attribute_map = { @@ -3301,6 +3769,11 @@ def __init__( sku_name: Optional[Union[str, "SkuName"]] = None, **kwargs ): + """ + :keyword sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype sku_name: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + """ super(TransportAvailabilityRequest, self).__init__(**kwargs) self.sku_name = sku_name @@ -3312,7 +3785,7 @@ class TransportAvailabilityResponse(msrest.serialization.Model): :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~azure.mgmt.databox.v2019_09_01.models.TransportAvailabilityDetails] """ _validation = { @@ -3327,6 +3800,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityResponse, self).__init__(**kwargs) self.transport_availability_details = None @@ -3336,9 +3811,10 @@ class TransportPreferences(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + :ivar preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype preferred_shipment_type: str or + ~azure.mgmt.databox.v2019_09_01.models.TransportShipmentTypes """ _validation = { @@ -3355,6 +3831,12 @@ def __init__( preferred_shipment_type: Union[str, "TransportShipmentTypes"], **kwargs ): + """ + :keyword preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :paramtype preferred_shipment_type: str or + ~azure.mgmt.databox.v2019_09_01.models.TransportShipmentTypes + """ super(TransportPreferences, self).__init__(**kwargs) self.preferred_shipment_type = preferred_shipment_type @@ -3367,7 +3849,7 @@ class UnencryptedCredentials(msrest.serialization.Model): :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2019_09_01.models.JobSecrets """ _validation = { @@ -3384,6 +3866,8 @@ def __init__( self, **kwargs ): + """ + """ super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None @@ -3392,10 +3876,10 @@ def __init__( class UnencryptedCredentialsList(msrest.serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :ivar value: List of unencrypted credentials. + :vartype value: list[~azure.mgmt.databox.v2019_09_01.models.UnencryptedCredentials] + :ivar next_link: Link for the next set of unencrypted credentials. + :vartype next_link: str """ _attribute_map = { @@ -3410,6 +3894,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of unencrypted credentials. + :paramtype value: list[~azure.mgmt.databox.v2019_09_01.models.UnencryptedCredentials] + :keyword next_link: Link for the next set of unencrypted credentials. + :paramtype next_link: str + """ super(UnencryptedCredentialsList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -3418,10 +3908,10 @@ def __init__( class UpdateJobDetails(msrest.serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :ivar contact_details: Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress """ _attribute_map = { @@ -3436,6 +3926,12 @@ def __init__( shipping_address: Optional["ShippingAddress"] = None, **kwargs ): + """ + :keyword contact_details: Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2019_09_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress + """ super(UpdateJobDetails, self).__init__(**kwargs) self.contact_details = contact_details self.shipping_address = shipping_address @@ -3446,18 +3942,19 @@ class ValidateAddress(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateDataDestinationDetails", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: + :vartype validation_type: str or + ~azure.mgmt.databox.v2019_09_01.models.ValidationInputDiscriminator + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :vartype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2019_09_01.models.TransportPreferences """ _validation = { @@ -3481,6 +3978,15 @@ def __init__( transport_preferences: Optional["TransportPreferences"] = None, **kwargs ): + """ + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2019_09_01.models.ShippingAddress + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2019_09_01.models.SkuName + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2019_09_01.models.TransportPreferences + """ super(ValidateAddress, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str self.shipping_address = shipping_address @@ -3495,10 +4001,11 @@ class ValidationResponse(msrest.serialization.Model): :ivar status: Overall validation status. Possible values include: "AllValidToProceed", "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2019_09_01.models.OverallValidationStatus :ivar individual_response_details: List of response details contain validationType and its response as key and value respectively. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] + :vartype individual_response_details: + list[~azure.mgmt.databox.v2019_09_01.models.ValidationInputResponse] """ _validation = { @@ -3515,6 +4022,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationResponse, self).__init__(**kwargs) self.status = None self.individual_response_details = None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_jobs_operations.py index e984b83e43a5..c0c545c1fc03 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_jobs_operations.py @@ -5,25 +5,388 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_book_shipment_pick_up_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_credentials_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class JobsOperations(object): """JobsOperations operations. @@ -32,7 +395,7 @@ class JobsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2019_09_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -47,12 +410,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: """Lists all the jobs available under the subscription. :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in @@ -60,7 +423,7 @@ def list( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -68,36 +431,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,18 +473,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: """Lists all the jobs available under the given resource group. :param resource_group_name: The Resource Group Name. @@ -136,7 +495,7 @@ def list_by_resource_group( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -144,37 +503,33 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -192,19 +547,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - job_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.JobResource" + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": """Gets information about the specified job. :param resource_group_name: The Resource Group Name. @@ -217,7 +573,7 @@ def get( :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource + :rtype: ~azure.mgmt.databox.v2019_09_01.models.JobResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] @@ -225,29 +581,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -261,47 +606,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + def _create_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,16 +653,18 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_create( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: """Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. @@ -336,18 +674,22 @@ def begin_create( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource: Job details from request body. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :type job_resource: ~azure.mgmt.databox.v2019_09_01.models.JobResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2019_09_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -359,27 +701,21 @@ def begin_create( resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -391,41 +727,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -438,13 +764,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a job. :param resource_group_name: The Resource Group Name. @@ -454,15 +781,17 @@ def begin_delete( :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -476,21 +805,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -502,50 +824,39 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _update_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -561,17 +872,19 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_update( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: """Updates the properties of an existing job. :param resource_group_name: The Resource Group Name. @@ -580,21 +893,26 @@ def begin_update( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2019_09_01.models.JobResourceUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2019_09_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -607,27 +925,21 @@ def begin_update( job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -639,16 +951,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + @distributed_trace def book_shipment_pick_up( self, - resource_group_name, # type: str - job_name, # type: str - shipment_pick_up_request, # type: "_models.ShipmentPickUpRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ShipmentPickUpResponse" + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": """Book shipment pick up. :param resource_group_name: The Resource Group Name. @@ -657,10 +970,10 @@ def book_shipment_pick_up( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :type shipment_pick_up_request: ~azure.mgmt.databox.v2019_09_01.models.ShipmentPickUpRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.v2019_09_01.models.ShipmentPickUpResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] @@ -668,32 +981,22 @@ def book_shipment_pick_up( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -707,16 +1010,18 @@ def book_shipment_pick_up( return cls(pipeline_response, deserialized, {}) return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + @distributed_trace def cancel( self, - resource_group_name, # type: str - job_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: """CancelJob. :param resource_group_name: The Resource Group Name. @@ -725,7 +1030,7 @@ def cancel( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :type cancellation_reason: ~azure.mgmt.databox.v2019_09_01.models.CancellationReason :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 @@ -736,32 +1041,22 @@ def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -774,13 +1069,14 @@ def cancel( cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + @distributed_trace def list_credentials( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UnencryptedCredentialsList"] + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentialsList"]: """This method gets the unencrypted secrets related to the job. :param resource_group_name: The Resource Group Name. @@ -789,8 +1085,10 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.UnencryptedCredentialsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] @@ -798,36 +1096,33 @@ def list_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -845,6 +1140,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_operations.py index cc8b34833627..d4c8fbd14a88 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_operations.py @@ -5,23 +5,50 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +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: + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.DataBox/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -30,7 +57,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2019_09_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,16 +72,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationList"] + **kwargs: Any + ) -> Iterable["_models.OperationList"]: """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 OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.OperationList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -62,30 +89,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + 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) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +127,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_service_operations.py index f8cf7bdbaa34..e156df6d82cf 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2019_09_01/operations/_service_operations.py @@ -5,23 +5,282 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_available_skus_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_available_skus_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_address_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2019-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ServiceOperations(object): """ServiceOperations operations. @@ -30,7 +289,7 @@ class ServiceOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2019_09_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,66 +304,63 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_available_skus( self, - location, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> Iterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription and location. :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,19 +378,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_available_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + @distributed_trace def list_available_skus_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + resource_group_name: str, + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> Iterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription, resource group and location. @@ -143,55 +400,53 @@ def list_available_skus_by_resource_group( :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2019_09_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2019_09_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -209,28 +464,29 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + @distributed_trace def validate_address( self, - location, # type: str - validate_address, # type: "_models.ValidateAddress" - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressValidationOutput" + location: str, + validate_address: "_models.ValidateAddress", + **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. :type location: str :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :type validate_address: ~azure.mgmt.databox.v2019_09_01.models.ValidateAddress :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.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.v2019_09_01.models.AddressValidationOutput :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] @@ -238,31 +494,21 @@ def validate_address( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,16 +522,18 @@ def validate_address( return cls(pipeline_response, deserialized, {}) return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + @distributed_trace def validate_inputs_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + resource_group_name: str, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under resource group. :param resource_group_name: The Resource Group Name. @@ -293,10 +541,10 @@ def validate_inputs_by_resource_group( :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -304,32 +552,22 @@ def validate_inputs_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,24 +581,26 @@ def validate_inputs_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace def validate_inputs( self, - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under subscription. :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2019_09_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2019_09_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -368,31 +608,21 @@ def validate_inputs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,24 +636,27 @@ def validate_inputs( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace def region_configuration( self, - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location. :param location: The location of the resource. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2019_09_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -431,31 +664,21 @@ def region_configuration( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -469,4 +692,6 @@ def region_configuration( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/__init__.py index ae972ed54f84..72afe00aa0a1 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['DataBoxManagementClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_configuration.py index 733f2f37acb5..0f428ed66dd6 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_configuration.py @@ -6,18 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential @@ -35,16 +33,15 @@ class DataBoxManagementClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) 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 @@ -68,4 +65,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_data_box_management_client.py index e696cb06a780..5f86292abb77 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_data_box_management_client.py @@ -6,65 +6,84 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import JobsOperations, Operations, ServiceOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from . import models - - -class DataBoxManagementClient(object): +class DataBoxManagementClient: """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations + :vartype operations: azure.mgmt.databox.v2020_04_01.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2020_04_01.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations + :vartype service: azure.mgmt.databox.v2020_04_01.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + 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(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._serialize.client_side_validation = False 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, # type: 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/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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 + """ - 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) + 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): # type: () -> None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_metadata.json index 1cbb00da5e15..bd7e36428652 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_metadata.json +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_metadata.json @@ -5,11 +5,13 @@ "name": "DataBoxManagementClient", "filename": "_data_box_management_client", "description": "The DataBox Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The Subscription Id.", "docstring_type": "str", "required": true @@ -42,22 +44,61 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "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" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_version.py index eae7c95b6fbd..e5754a47ce68 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_version.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0b1" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/__init__.py index bb6b75a72db8..c57c5574bdd0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._data_box_management_client import DataBoxManagementClient __all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_configuration.py index c07f020ff27a..ffd0a9379f57 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -37,11 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) 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 @@ -64,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_data_box_management_client.py index b192ff7cd771..4d52816b6c8d 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_data_box_management_client.py @@ -6,62 +6,84 @@ # 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, Optional, TYPE_CHECKING +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +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 -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from .. import models - - -class DataBoxManagementClient(object): +class DataBoxManagementClient: """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.aio.operations.Operations + :vartype operations: azure.mgmt.databox.v2020_04_01.aio.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2020_04_01.aio.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.aio.operations.ServiceOperations + :vartype service: azure.mgmt.databox.v2020_04_01.aio.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataBoxManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False 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/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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 + """ - 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) + 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() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_jobs_operations.py index c4130aabaa87..1bd3038ec917 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_jobs_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._jobs_operations import build_book_shipment_pick_up_request, build_cancel_request, build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_credentials_request, build_list_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -28,7 +33,7 @@ class JobsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_04_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -43,10 +48,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResourceList"]: """Lists all the jobs available under the subscription. @@ -55,7 +61,8 @@ def list( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -63,36 +70,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -105,22 +107,24 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResourceList"]: """Lists all the jobs available under the given resource group. @@ -131,7 +135,8 @@ def list_by_resource_group( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -139,37 +144,33 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,23 +183,25 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, job_name: str, expand: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.JobResource": """Gets information about the specified job. @@ -212,7 +215,7 @@ async def get( :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource + :rtype: ~azure.mgmt.databox.v2020_04_01.models.JobResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] @@ -220,35 +223,24 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('JobResource', pipeline_response) @@ -257,53 +249,44 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + async def _create_initial( self, resource_group_name: str, job_name: str, job_resource: "_models.JobResource", - **kwargs + **kwargs: Any ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource, 'JobResource') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -313,14 +296,17 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, resource_group_name: str, job_name: str, job_resource: "_models.JobResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.JobResource"]: """Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. @@ -331,18 +317,22 @@ async def begin_create( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource: Job details from request body. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :type job_resource: ~azure.mgmt.databox.v2020_04_01.models.JobResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_04_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -354,27 +344,21 @@ async def begin_create( resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,58 +370,50 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore async def _delete_initial( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a job. @@ -448,15 +424,17 @@ async def begin_delete( :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -470,21 +448,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -496,6 +467,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore async def _update_initial( @@ -504,48 +476,36 @@ async def _update_initial( job_name: str, job_resource_update_parameter: "_models.JobResourceUpdateParameter", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -555,15 +515,18 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, resource_group_name: str, job_name: str, job_resource_update_parameter: "_models.JobResourceUpdateParameter", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.JobResource"]: """Updates the properties of an existing job. @@ -573,21 +536,26 @@ async def begin_update( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2020_04_01.models.JobResourceUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_04_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -600,27 +568,21 @@ async def begin_update( job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -632,14 +594,16 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + @distributed_trace_async async def book_shipment_pick_up( self, resource_group_name: str, job_name: str, shipment_pick_up_request: "_models.ShipmentPickUpRequest", - **kwargs + **kwargs: Any ) -> "_models.ShipmentPickUpResponse": """Book shipment pick up. @@ -649,10 +613,10 @@ async def book_shipment_pick_up( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :type shipment_pick_up_request: ~azure.mgmt.databox.v2020_04_01.models.ShipmentPickUpRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.ShipmentPickUpResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] @@ -660,38 +624,28 @@ async def book_shipment_pick_up( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) @@ -700,14 +654,17 @@ async def book_shipment_pick_up( return cls(pipeline_response, deserialized, {}) return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + @distributed_trace_async async def cancel( self, resource_group_name: str, job_name: str, cancellation_reason: "_models.CancellationReason", - **kwargs + **kwargs: Any ) -> None: """CancelJob. @@ -717,7 +674,7 @@ async def cancel( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :type cancellation_reason: ~azure.mgmt.databox.v2020_04_01.models.CancellationReason :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 @@ -728,38 +685,28 @@ async def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -767,11 +714,13 @@ async def cancel( cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + @distributed_trace def list_credentials( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: """This method gets the unencrypted secrets related to the job. @@ -781,8 +730,10 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.UnencryptedCredentialsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] @@ -790,36 +741,33 @@ def list_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -832,12 +780,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_operations.py index 9447a0929058..91c029765a87 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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]] @@ -26,7 +31,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_04_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,15 +46,17 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationList"]: """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 OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.OperationList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + 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) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -93,12 +97,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_service_operations.py index 102a614814c9..feacecd3439a 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/aio/operations/_service_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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, 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]] @@ -26,7 +31,7 @@ class ServiceOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_04_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,12 +46,13 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_available_skus_by_resource_group( self, resource_group_name: str, location: str, available_sku_request: "_models.AvailableSkuRequest", - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription, resource group and location. @@ -56,55 +62,53 @@ def list_available_skus_by_resource_group( :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2020_04_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_04_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,22 +121,24 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, 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'} # type: ignore + @distributed_trace_async async def validate_address( self, location: str, validate_address: "_models.ValidateAddress", - **kwargs + **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. @@ -140,10 +146,10 @@ async def validate_address( :param location: The location of the resource. :type location: str :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :type validate_address: ~azure.mgmt.databox.v2020_04_01.models.ValidateAddress :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.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] @@ -151,37 +157,27 @@ async def validate_address( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AddressValidationOutput', pipeline_response) @@ -190,14 +186,17 @@ async def validate_address( return cls(pipeline_response, deserialized, {}) return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + @distributed_trace_async async def validate_inputs_by_resource_group( self, resource_group_name: str, location: str, validation_request: "_models.ValidationRequest", - **kwargs + **kwargs: Any ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under resource group. @@ -206,10 +205,10 @@ async def validate_inputs_by_resource_group( :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -217,38 +216,28 @@ async def validate_inputs_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidationResponse', pipeline_response) @@ -257,23 +246,26 @@ async def validate_inputs_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace_async async def validate_inputs( self, location: str, validation_request: "_models.ValidationRequest", - **kwargs + **kwargs: Any ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under subscription. :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -281,37 +273,27 @@ async def validate_inputs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidationResponse', pipeline_response) @@ -320,13 +302,16 @@ async def validate_inputs( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace_async async def region_configuration( self, location: str, region_configuration_request: "_models.RegionConfigurationRequest", - **kwargs + **kwargs: Any ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location at Subscription level. @@ -334,10 +319,11 @@ async def region_configuration( :param location: The location of the resource. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -345,37 +331,27 @@ async def region_configuration( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) @@ -384,14 +360,17 @@ async def region_configuration( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + @distributed_trace_async async def region_configuration_by_resource_group( self, resource_group_name: str, location: str, region_configuration_request: "_models.RegionConfigurationRequest", - **kwargs + **kwargs: Any ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location at Resource group level. @@ -402,10 +381,11 @@ async def region_configuration_by_resource_group( :type location: str :param region_configuration_request: Request body to get the configuration for the region at resource group level. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -413,38 +393,28 @@ async def region_configuration_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) @@ -453,4 +423,6 @@ async def region_configuration_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/__init__.py index 03df95cdedfc..6fa1aa1c2c1d 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/__init__.py @@ -6,204 +6,105 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - 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 -except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails # type: ignore - from ._models import AdditionalErrorInfo # type: ignore - from ._models import AddressValidationOutput # type: ignore - from ._models import AddressValidationProperties # type: ignore - from ._models import ApiError # type: ignore - from ._models import ApplianceNetworkConfiguration # type: ignore - from ._models import ArmBaseObject # type: ignore - from ._models import AvailableSkuRequest # type: ignore - from ._models import AvailableSkusResult # type: ignore - from ._models import AzureFileFilterDetails # type: ignore - from ._models import BlobFilterDetails # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import CloudError # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CopyLogDetails # type: ignore - from ._models import CopyProgress # type: ignore - from ._models import CreateJobValidations # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationRequest # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties # type: ignore - from ._models import DataAccountDetails # type: ignore - from ._models import DataBoxAccountCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyProgress # type: ignore - from ._models import DataBoxDiskJobDetails # type: ignore - from ._models import DataBoxDiskJobSecrets # type: ignore - from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore - from ._models import DataBoxHeavyJobDetails # type: ignore - from ._models import DataBoxHeavyJobSecrets # type: ignore - from ._models import DataBoxHeavySecret # type: ignore - from ._models import DataBoxJobDetails # type: ignore - from ._models import DataBoxScheduleAvailabilityRequest # type: ignore - from ._models import DataBoxSecret # type: ignore - from ._models import DataExportDetails # type: ignore - from ._models import DataImportDetails # type: ignore - from ._models import DataLocationToServiceLocationMap # type: ignore - from ._models import DataTransferDetailsValidationRequest # type: ignore - from ._models import DataTransferDetailsValidationResponseProperties # type: ignore - from ._models import DataboxJobSecrets # type: ignore - from ._models import DcAccessSecurityCode # type: ignore - from ._models import Details # type: ignore - from ._models import DiskScheduleAvailabilityRequest # type: ignore - from ._models import DiskSecret # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import FilterFileDetails # type: ignore - from ._models import HeavyScheduleAvailabilityRequest # type: ignore - from ._models import JobDeliveryInfo # type: ignore - from ._models import JobDetails # type: ignore - from ._models import JobResource # type: ignore - from ._models import JobResourceList # type: ignore - from ._models import JobResourceUpdateParameter # type: ignore - from ._models import JobSecrets # type: ignore - from ._models import JobStages # type: ignore - from ._models import KeyEncryptionKey # type: ignore - from ._models import ManagedDiskDetails # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import PackageShippingDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import PreferencesValidationRequest # type: ignore - from ._models import PreferencesValidationResponseProperties # type: ignore - from ._models import RegionConfigurationRequest # type: ignore - from ._models import RegionConfigurationResponse # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceIdentity # type: ignore - from ._models import ScheduleAvailabilityRequest # type: ignore - from ._models import ScheduleAvailabilityResponse # type: ignore - from ._models import ShareCredentialDetails # type: ignore - from ._models import ShipmentPickUpRequest # type: ignore - from ._models import ShipmentPickUpResponse # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuAvailabilityValidationRequest # type: ignore - from ._models import SkuAvailabilityValidationResponseProperties # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuCost # type: ignore - from ._models import SkuInformation # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationRequest # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties # type: ignore - from ._models import TransferAllDetails # type: ignore - from ._models import TransferConfiguration # type: ignore - from ._models import TransferConfigurationTransferAllDetails # type: ignore - from ._models import TransferConfigurationTransferFilterDetails # type: ignore - from ._models import TransferFilterDetails # type: ignore - from ._models import TransportAvailabilityDetails # type: ignore - from ._models import TransportAvailabilityRequest # type: ignore - from ._models import TransportAvailabilityResponse # type: ignore - from ._models import TransportPreferences # type: ignore - from ._models import UnencryptedCredentials # type: ignore - from ._models import UnencryptedCredentialsList # type: ignore - from ._models import UpdateJobDetails # type: ignore - from ._models import ValidateAddress # type: ignore - from ._models import ValidationInputRequest # type: ignore - from ._models import ValidationInputResponse # type: ignore - from ._models import ValidationRequest # type: ignore - from ._models import ValidationResponse # type: ignore +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, diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_data_box_management_client_enums.py index 88bd323185f7..f5dd422ae1b5 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_data_box_management_client_enums.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_data_box_management_client_enums.py @@ -6,224 +6,306 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) +class AccessProtocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" -class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - SMB = "SMB" #: Server Message Block protocol(SMB). - NFS = "NFS" #: Network File System protocol(NFS). - -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AddressType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of address. """ - NONE = "None" #: Address type not known. - RESIDENTIAL = "Residential" #: Residential Address. - COMMERCIAL = "Commercial" #: Commercial Address. + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" -class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AddressValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" -class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ClassDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" -class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CopyStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + +class DataAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of the account. """ - STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . - MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" -class FilterFileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class FilterFileType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" -class JobDeliveryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class JobDeliveryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Delivery type of Job. """ - NON_SCHEDULED = "NonScheduled" #: Non Scheduled job. - SCHEDULED = "Scheduled" #: Scheduled job. + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" -class KekType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KekType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" -class LogCollectionLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LogCollectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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). + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NotificationStageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + +class OverallValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" -class ShareDestinationFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ShareDestinationFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + +class SkuDisabledReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - DATA_BOX = "DataBox" #: Data Box. - DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk. - DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy. - -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + +class StageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + +class StageStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + +class TransferConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of the configuration for transfer. """ - TRANSFER_ALL = "TransferAll" #: Transfer all the data. - TRANSFER_USING_FILTER = "TransferUsingFilter" #: Transfer using filter. + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" -class TransferType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TransferType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of the transfer. """ - IMPORT_TO_AZURE = "ImportToAzure" #: Import data to azure. - EXPORT_FROM_AZURE = "ExportFromAzure" #: Export data from azure. + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" -class TransportShipmentTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TransportShipmentTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" -class ValidationInputDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ValidationInputDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + +class ValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Create order limit validation status. """ - VALID = "Valid" #: Validation is successful. - INVALID = "Invalid" #: Validation is not successful. - SKIPPED = "Skipped" #: Validation is skipped. + #: Validation is successful. + VALID = "Valid" + #: Validation is not successful. + INVALID = "Invalid" + #: Validation is skipped. + SKIPPED = "Skipped" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models_py3.py index 379d6ab99393..3c615234cea9 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models_py3.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -24,12 +24,13 @@ class AccountCredentialDetails(msrest.serialization.Model): :vartype account_name: str :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.models.DataAccountType :ivar account_connection_string: Connection string of the account endpoint to use the account as a storage endpoint on the device. :vartype account_connection_string: str :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] + :vartype share_credential_details: + list[~azure.mgmt.databox.v2020_04_01.models.ShareCredentialDetails] """ _validation = { @@ -50,6 +51,8 @@ def __init__( self, **kwargs ): + """ + """ super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None self.data_account_type = None @@ -60,10 +63,10 @@ def __init__( class AdditionalErrorInfo(msrest.serialization.Model): """Additional error info. - :param type: Additional error type. - :type type: str - :param info: Additional error info. - :type info: object + :ivar type: Additional error type. + :vartype type: str + :ivar info: Additional error info. + :vartype info: any """ _attribute_map = { @@ -75,9 +78,15 @@ def __init__( self, *, type: Optional[str] = None, - info: Optional[object] = None, + info: Optional[Any] = None, **kwargs ): + """ + :keyword type: Additional error type. + :paramtype type: str + :keyword info: Additional error info. + :paramtype info: any + """ super(AdditionalErrorInfo, self).__init__(**kwargs) self.type = type self.info = info @@ -88,18 +97,20 @@ class AddressValidationOutput(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param validation_type: Identifies the type of validation response.Constant filled by server. + :ivar validation_type: Identifies the type of validation response.Constant filled by server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2020_04_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_04_01.models.ShippingAddress] """ _validation = { @@ -119,6 +130,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationOutput, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -136,13 +149,14 @@ class ValidationInputResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError """ _validation = { @@ -163,6 +177,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputResponse, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -175,18 +191,20 @@ class AddressValidationProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2020_04_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_04_01.models.ShippingAddress] """ _validation = { @@ -207,6 +225,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationProperties, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str self.validation_status = None @@ -218,8 +238,8 @@ class ApiError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. - :type error: ~azure.mgmt.databox.models.ErrorDetail + :ivar error: Required. + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.ErrorDetail """ _validation = { @@ -236,6 +256,10 @@ def __init__( error: "ErrorDetail", **kwargs ): + """ + :keyword error: Required. + :paramtype error: ~azure.mgmt.databox.v2020_04_01.models.ErrorDetail + """ super(ApiError, self).__init__(**kwargs) self.error = error @@ -265,6 +289,8 @@ def __init__( self, **kwargs ): + """ + """ super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None @@ -299,6 +325,8 @@ def __init__( self, **kwargs ): + """ + """ super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None @@ -310,17 +338,17 @@ class AvailableSkuRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :vartype location: str + :ivar sku_names: Sku Names to filter for available skus. + :vartype sku_names: list[str or ~azure.mgmt.databox.v2020_04_01.models.SkuName] """ _validation = { @@ -345,6 +373,19 @@ def __init__( sku_names: Optional[List[Union[str, "SkuName"]]] = None, **kwargs ): + """ + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + :keyword sku_names: Sku Names to filter for available skus. + :paramtype sku_names: list[str or ~azure.mgmt.databox.v2020_04_01.models.SkuName] + """ super(AvailableSkuRequest, self).__init__(**kwargs) self.transfer_type = transfer_type self.country = country @@ -358,9 +399,9 @@ class AvailableSkusResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2020_04_01.models.SkuInformation] + :ivar next_link: Link for the next set of skus. + :vartype next_link: str """ _validation = { @@ -378,6 +419,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of skus. + :paramtype next_link: str + """ super(AvailableSkusResult, self).__init__(**kwargs) self.value = None self.next_link = next_link @@ -386,12 +431,12 @@ def __init__( class AzureFileFilterDetails(msrest.serialization.Model): """Filter details to transfer Azure files. - :param file_prefix_list: Prefix list of the Azure files to be transferred. - :type file_prefix_list: list[str] - :param file_path_list: List of full path of the files to be transferred. - :type file_path_list: list[str] - :param file_share_list: List of file shares to be transferred. - :type file_share_list: list[str] + :ivar file_prefix_list: Prefix list of the Azure files to be transferred. + :vartype file_prefix_list: list[str] + :ivar file_path_list: List of full path of the files to be transferred. + :vartype file_path_list: list[str] + :ivar file_share_list: List of file shares to be transferred. + :vartype file_share_list: list[str] """ _attribute_map = { @@ -408,6 +453,14 @@ def __init__( file_share_list: Optional[List[str]] = None, **kwargs ): + """ + :keyword file_prefix_list: Prefix list of the Azure files to be transferred. + :paramtype file_prefix_list: list[str] + :keyword file_path_list: List of full path of the files to be transferred. + :paramtype file_path_list: list[str] + :keyword file_share_list: List of file shares to be transferred. + :paramtype file_share_list: list[str] + """ super(AzureFileFilterDetails, self).__init__(**kwargs) self.file_prefix_list = file_prefix_list self.file_path_list = file_path_list @@ -417,12 +470,12 @@ def __init__( class BlobFilterDetails(msrest.serialization.Model): """Filter details to transfer Azure Blobs. - :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :type blob_prefix_list: list[str] - :param blob_path_list: List of full path of the blobs to be transferred. - :type blob_path_list: list[str] - :param container_list: List of blob containers to be transferred. - :type container_list: list[str] + :ivar blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :vartype blob_prefix_list: list[str] + :ivar blob_path_list: List of full path of the blobs to be transferred. + :vartype blob_path_list: list[str] + :ivar container_list: List of blob containers to be transferred. + :vartype container_list: list[str] """ _attribute_map = { @@ -439,6 +492,14 @@ def __init__( container_list: Optional[List[str]] = None, **kwargs ): + """ + :keyword blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :paramtype blob_prefix_list: list[str] + :keyword blob_path_list: List of full path of the blobs to be transferred. + :paramtype blob_path_list: list[str] + :keyword container_list: List of blob containers to be transferred. + :paramtype container_list: list[str] + """ super(BlobFilterDetails, self).__init__(**kwargs) self.blob_prefix_list = blob_prefix_list self.blob_path_list = blob_path_list @@ -450,8 +511,8 @@ class CancellationReason(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Required. Reason for cancellation. + :vartype reason: str """ _validation = { @@ -468,6 +529,10 @@ def __init__( reason: str, **kwargs ): + """ + :keyword reason: Required. Reason for cancellation. + :paramtype reason: str + """ super(CancellationReason, self).__init__(**kwargs) self.reason = reason @@ -477,16 +542,16 @@ class CloudError(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: Cloud error code. - :type code: str - :param message: Cloud error message. - :type message: str - :param target: Cloud error target. - :type target: str + :ivar code: Cloud error code. + :vartype code: str + :ivar message: Cloud error message. + :vartype message: str + :ivar target: Cloud error target. + :vartype target: str :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.models.CloudError] + :vartype details: list[~azure.mgmt.databox.v2020_04_01.models.CloudError] :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.models.AdditionalErrorInfo] + :vartype additional_info: list[~azure.mgmt.databox.v2020_04_01.models.AdditionalErrorInfo] """ _validation = { @@ -510,6 +575,14 @@ def __init__( target: Optional[str] = None, **kwargs ): + """ + :keyword code: Cloud error code. + :paramtype code: str + :keyword message: Cloud error message. + :paramtype message: str + :keyword target: Cloud error target. + :paramtype target: str + """ super(CloudError, self).__init__(**kwargs) self.code = code self.message = message @@ -523,18 +596,19 @@ class ContactDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :ivar contact_name: Required. Contact name of the person. + :vartype contact_name: str + :ivar phone: Required. Phone number of the contact person. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: Required. List of Email-ids to be notified about job progress. + :vartype email_list: list[str] + :ivar notification_preference: Notification preference for a job stage. + :vartype notification_preference: + list[~azure.mgmt.databox.v2020_04_01.models.NotificationPreference] """ _validation = { @@ -563,6 +637,21 @@ def __init__( notification_preference: Optional[List["NotificationPreference"]] = None, **kwargs ): + """ + :keyword contact_name: Required. Contact name of the person. + :paramtype contact_name: str + :keyword phone: Required. Phone number of the contact person. + :paramtype phone: str + :keyword phone_extension: Phone extension number of the contact person. + :paramtype phone_extension: str + :keyword mobile: Mobile number of the contact person. + :paramtype mobile: str + :keyword email_list: Required. List of Email-ids to be notified about job progress. + :paramtype email_list: list[str] + :keyword notification_preference: Notification preference for a job stage. + :paramtype notification_preference: + list[~azure.mgmt.databox.v2020_04_01.models.NotificationPreference] + """ super(ContactDetails, self).__init__(**kwargs) self.contact_name = contact_name self.phone = phone @@ -580,9 +669,10 @@ class CopyLogDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator """ _validation = { @@ -601,6 +691,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] @@ -615,10 +707,10 @@ class CopyProgress(msrest.serialization.Model): :vartype storage_account_name: str :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.models.DataAccountType :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str :ivar bytes_processed: To indicate bytes transferred. @@ -689,6 +781,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None self.transfer_type = None @@ -715,12 +809,13 @@ class ValidationRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :vartype individual_request_details: + list[~azure.mgmt.databox.v2020_04_01.models.ValidationInputRequest] """ _validation = { @@ -743,6 +838,12 @@ def __init__( individual_request_details: List["ValidationInputRequest"], **kwargs ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2020_04_01.models.ValidationInputRequest] + """ super(ValidationRequest, self).__init__(**kwargs) self.validation_category = None # type: Optional[str] self.individual_request_details = individual_request_details @@ -753,12 +854,13 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :vartype individual_request_details: + list[~azure.mgmt.databox.v2020_04_01.models.ValidationInputRequest] """ _validation = { @@ -777,6 +879,12 @@ def __init__( individual_request_details: List["ValidationInputRequest"], **kwargs ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2020_04_01.models.ValidationInputRequest] + """ super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) self.validation_category = 'JobCreationValidation' # type: str @@ -789,11 +897,12 @@ class ValidationInputRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator """ _validation = { @@ -812,6 +921,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputRequest, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] @@ -821,14 +932,15 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName """ _validation = { @@ -847,6 +959,11 @@ def __init__( device_type: Union[str, "SkuName"], **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + """ super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str self.device_type = device_type @@ -859,16 +976,17 @@ class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInpu All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError :ivar status: Create order limit validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.ValidationStatus """ _validation = { @@ -887,6 +1005,8 @@ def __init__( self, **kwargs ): + """ + """ super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str self.status = None @@ -900,16 +1020,16 @@ class DataAccountDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str + :vartype share_password: str """ _validation = { @@ -931,6 +1051,15 @@ def __init__( share_password: Optional[str] = None, **kwargs ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + """ super(DataAccountDetails, self).__init__(**kwargs) self.data_account_type = None # type: Optional[str] self.share_password = share_password @@ -943,9 +1072,10 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -973,6 +1103,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBox' # type: str self.account_name = None @@ -987,9 +1119,10 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -1016,6 +1149,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None @@ -1037,7 +1172,7 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.CopyStatus """ _validation = { @@ -1058,6 +1193,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -1076,35 +1213,35 @@ class JobDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2020_04_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2020_04_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int """ _validation = { @@ -1133,7 +1270,7 @@ class JobDetails(msrest.serialization.Model): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, } _subtype_map = { @@ -1148,9 +1285,24 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, data_export_details: Optional[List["DataExportDetails"]] = None, preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, **kwargs ): + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ super(JobDetails, self).__init__(**kwargs) self.job_stages = None self.contact_details = contact_details @@ -1165,7 +1317,7 @@ def __init__( self.reverse_shipment_label_sas_key = None self.chain_of_custody_sas_key = None self.key_encryption_key = None - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes class DataBoxDiskJobDetails(JobDetails): @@ -1176,46 +1328,46 @@ class DataBoxDiskJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2020_04_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2020_04_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :vartype expected_data_size_in_tera_bytes: int + :ivar preferred_disks: User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :vartype copy_progress: list[~azure.mgmt.databox.v2020_04_01.models.DataBoxDiskCopyProgress] :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str + :ivar passkey: User entered passkey for DataBox Disk job. + :vartype passkey: str """ _validation = { @@ -1246,7 +1398,7 @@ class DataBoxDiskJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, @@ -1261,12 +1413,33 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, data_export_details: Optional[List["DataExportDetails"]] = None, preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, preferred_disks: Optional[Dict[str, int]] = None, passkey: Optional[str] = None, **kwargs ): - super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. + :paramtype preferred_disks: dict[str, int] + :keyword passkey: User entered passkey for DataBox Disk job. + :paramtype passkey: str + """ + super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBoxDisk' # type: str self.preferred_disks = preferred_disks self.copy_progress = None @@ -1284,13 +1457,13 @@ class JobSecrets(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_04_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError """ _validation = { @@ -1313,6 +1486,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobSecrets, self).__init__(**kwargs) self.job_secrets_type = None # type: Optional[str] self.dc_access_security_code = None @@ -1326,15 +1501,15 @@ class DataBoxDiskJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_04_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~azure.mgmt.databox.v2020_04_01.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -1363,6 +1538,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None @@ -1377,9 +1554,10 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -1407,6 +1585,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None @@ -1422,44 +1602,44 @@ class DataBoxHeavyJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2020_04_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2020_04_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + :vartype copy_progress: list[~azure.mgmt.databox.v2020_04_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox Heavy. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str + :vartype device_password: str """ _validation = { @@ -1489,7 +1669,7 @@ class DataBoxHeavyJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } @@ -1502,11 +1682,33 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, data_export_details: Optional[List["DataExportDetails"]] = None, preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, device_password: Optional[str] = None, **kwargs ): - super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None self.device_password = device_password @@ -1519,15 +1721,15 @@ class DataBoxHeavyJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_04_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2020_04_01.models.DataBoxHeavySecret] """ _validation = { @@ -1548,6 +1750,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None @@ -1563,12 +1767,14 @@ class DataBoxHeavySecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2020_04_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2020_04_01.models.AccountCredentialDetails] """ _validation = { @@ -1591,6 +1797,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1607,44 +1815,44 @@ class DataBoxJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2020_04_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2020_04_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2020_04_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. Should not be passed for + :vartype copy_progress: list[~azure.mgmt.databox.v2020_04_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str + :vartype device_password: str """ _validation = { @@ -1674,7 +1882,7 @@ class DataBoxJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } @@ -1687,11 +1895,33 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, data_export_details: Optional[List["DataExportDetails"]] = None, preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, device_password: Optional[str] = None, **kwargs ): - super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2020_04_01.models.Preferences + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBox' # type: str self.copy_progress = None self.device_password = device_password @@ -1704,15 +1934,15 @@ class DataboxJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_04_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_04_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError + :ivar pod_secrets: Contains the list of secret objects for a job. + :vartype pod_secrets: list[~azure.mgmt.databox.v2020_04_01.models.DataBoxSecret] """ _validation = { @@ -1734,6 +1964,10 @@ def __init__( pod_secrets: Optional[List["DataBoxSecret"]] = None, **kwargs ): + """ + :keyword pod_secrets: Contains the list of secret objects for a job. + :paramtype pod_secrets: list[~azure.mgmt.databox.v2020_04_01.models.DataBoxSecret] + """ super(DataboxJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBox' # type: str self.pod_secrets = pod_secrets @@ -1747,14 +1981,14 @@ class ScheduleAvailabilityRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -1779,6 +2013,13 @@ def __init__( country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ super(ScheduleAvailabilityRequest, self).__init__(**kwargs) self.storage_location = storage_location self.sku_name = None # type: Optional[str] @@ -1790,14 +2031,14 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -1818,6 +2059,13 @@ def __init__( country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBox' # type: str @@ -1832,12 +2080,14 @@ class DataBoxSecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2020_04_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2020_04_01.models.AccountCredentialDetails] """ _validation = { @@ -1860,6 +2110,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1873,13 +2125,13 @@ class DataExportDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_configuration: Required. Configuration for the data transfer. - :type transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :param log_collection_level: Level of the logs to be collected. Possible values include: - "Error", "Verbose". - :type log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :ivar transfer_configuration: Required. Configuration for the data transfer. + :vartype transfer_configuration: ~azure.mgmt.databox.v2020_04_01.models.TransferConfiguration + :ivar log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". Default value: "Error". + :vartype log_collection_level: str or ~azure.mgmt.databox.v2020_04_01.models.LogCollectionLevel + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2020_04_01.models.DataAccountDetails """ _validation = { @@ -1898,9 +2150,19 @@ def __init__( *, transfer_configuration: "TransferConfiguration", account_details: "DataAccountDetails", - log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = None, + log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = "Error", **kwargs ): + """ + :keyword transfer_configuration: Required. Configuration for the data transfer. + :paramtype transfer_configuration: ~azure.mgmt.databox.v2020_04_01.models.TransferConfiguration + :keyword log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". Default value: "Error". + :paramtype log_collection_level: str or + ~azure.mgmt.databox.v2020_04_01.models.LogCollectionLevel + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2020_04_01.models.DataAccountDetails + """ super(DataExportDetails, self).__init__(**kwargs) self.transfer_configuration = transfer_configuration self.log_collection_level = log_collection_level @@ -1912,8 +2174,8 @@ class DataImportDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2020_04_01.models.DataAccountDetails """ _validation = { @@ -1930,6 +2192,10 @@ def __init__( account_details: "DataAccountDetails", **kwargs ): + """ + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2020_04_01.models.DataAccountDetails + """ super(DataImportDetails, self).__init__(**kwargs) self.account_details = account_details @@ -1959,6 +2225,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataLocationToServiceLocationMap, self).__init__(**kwargs) self.data_location = None self.service_location = None @@ -1969,21 +2237,22 @@ class DataTransferDetailsValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param data_export_details: List of DataTransfer details to be used to export data from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param data_import_details: List of DataTransfer details to be used to import data to azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator + :ivar data_export_details: List of DataTransfer details to be used to export data from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :ivar data_import_details: List of DataTransfer details to be used to import data to azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :ivar device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType """ _validation = { @@ -2009,6 +2278,19 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, **kwargs ): + """ + :keyword data_export_details: List of DataTransfer details to be used to export data from + azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_04_01.models.DataExportDetails] + :keyword data_import_details: List of DataTransfer details to be used to import data to azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_04_01.models.DataImportDetails] + :keyword device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType + """ super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateDataTransferDetails' # type: str self.data_export_details = data_export_details @@ -2024,16 +2306,17 @@ class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError :ivar status: Data transfer details validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.ValidationStatus """ _validation = { @@ -2052,6 +2335,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateDataTransferDetails' # type: str self.status = None @@ -2060,15 +2345,15 @@ def __init__( class DcAccessSecurityCode(msrest.serialization.Model): """Dc access security code. - :param reverse_dc_access_code: Reverse Dc access security code. - :type reverse_dc_access_code: str - :param forward_dc_access_code: Forward Dc access security code. - :type forward_dc_access_code: str + :ivar reverse_dc_access_code: Reverse Dc access security code. + :vartype reverse_dc_access_code: str + :ivar forward_dc_access_code: Forward Dc access security code. + :vartype forward_dc_access_code: str """ _attribute_map = { - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, + 'reverse_dc_access_code': {'key': 'reverseDCAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDCAccessCode', 'type': 'str'}, } def __init__( @@ -2078,6 +2363,12 @@ def __init__( forward_dc_access_code: Optional[str] = None, **kwargs ): + """ + :keyword reverse_dc_access_code: Reverse Dc access security code. + :paramtype reverse_dc_access_code: str + :keyword forward_dc_access_code: Forward Dc access security code. + :paramtype forward_dc_access_code: str + """ super(DcAccessSecurityCode, self).__init__(**kwargs) self.reverse_dc_access_code = reverse_dc_access_code self.forward_dc_access_code = forward_dc_access_code @@ -2088,10 +2379,10 @@ class Details(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str """ _validation = { @@ -2111,6 +2402,12 @@ def __init__( message: str, **kwargs ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + """ super(Details, self).__init__(**kwargs) self.code = code self.message = message @@ -2121,43 +2418,53 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int """ _validation = { 'storage_location': {'required': True}, 'sku_name': {'required': True}, - 'expected_data_size_in_terabytes': {'required': True}, + 'expected_data_size_in_tera_bytes': {'required': True}, } _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, } def __init__( self, *, storage_location: str, - expected_data_size_in_terabytes: int, + expected_data_size_in_tera_bytes: int, country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + :keyword expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs + to be transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes class DiskSecret(msrest.serialization.Model): @@ -2186,6 +2493,8 @@ def __init__( self, **kwargs ): + """ + """ super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None @@ -2196,14 +2505,14 @@ class ErrorDetail(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str - :param details: - :type details: list[~azure.mgmt.databox.models.Details] - :param target: - :type target: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar details: + :vartype details: list[~azure.mgmt.databox.v2020_04_01.models.Details] + :ivar target: + :vartype target: str """ _validation = { @@ -2227,6 +2536,16 @@ def __init__( target: Optional[str] = None, **kwargs ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + :keyword details: + :paramtype details: list[~azure.mgmt.databox.v2020_04_01.models.Details] + :keyword target: + :paramtype target: str + """ super(ErrorDetail, self).__init__(**kwargs) self.code = code self.message = message @@ -2239,12 +2558,12 @@ class FilterFileDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param filter_file_type: Required. Type of the filter file. Possible values include: + :ivar filter_file_type: Required. Type of the filter file. Possible values include: "AzureBlob", "AzureFile". - :type filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :param filter_file_path: Required. Path of the file that contains the details of all items to + :vartype filter_file_type: str or ~azure.mgmt.databox.v2020_04_01.models.FilterFileType + :ivar filter_file_path: Required. Path of the file that contains the details of all items to transfer. - :type filter_file_path: str + :vartype filter_file_path: str """ _validation = { @@ -2264,6 +2583,14 @@ def __init__( filter_file_path: str, **kwargs ): + """ + :keyword filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :paramtype filter_file_type: str or ~azure.mgmt.databox.v2020_04_01.models.FilterFileType + :keyword filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :paramtype filter_file_path: str + """ super(FilterFileDetails, self).__init__(**kwargs) self.filter_file_type = filter_file_type self.filter_file_path = filter_file_path @@ -2274,14 +2601,14 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -2302,6 +2629,13 @@ def __init__( country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBoxHeavy' # type: str @@ -2309,8 +2643,8 @@ def __init__( class JobDeliveryInfo(msrest.serialization.Model): """Additional delivery info. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime """ _attribute_map = { @@ -2323,6 +2657,10 @@ def __init__( scheduled_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword scheduled_date_time: Scheduled date time. + :paramtype scheduled_date_time: ~datetime.datetime + """ super(JobDeliveryInfo, self).__init__(**kwargs) self.scheduled_date_time = scheduled_date_time @@ -2332,18 +2670,18 @@ class Resource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2020_04_01.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2020_04_01.models.ResourceIdentity """ _validation = { @@ -2367,6 +2705,20 @@ def __init__( identity: Optional["ResourceIdentity"] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2020_04_01.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2020_04_01.models.ResourceIdentity + """ super(Resource, self).__init__(**kwargs) self.location = location self.tags = tags @@ -2381,27 +2733,27 @@ class JobResource(Resource): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2020_04_01.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2020_04_01.models.ResourceIdentity :ivar name: Name of the object. :vartype name: str :ivar id: Id of the object. :vartype id: str :ivar type: Type of the object. :vartype type: str - :param transfer_type: Required. Type of the data transfer. Possible values include: + :ivar transfer_type: Required. Type of the data transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType :ivar is_cancellable: Describes whether the job is cancellable or not. :vartype is_cancellable: bool :ivar is_deletable: Describes whether the job is deletable or not. @@ -2415,20 +2767,20 @@ class JobResource(Resource): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.models.StageName + :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.StageName :ivar start_time: Time at which the job was started in UTC ISO 8601 format. :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError + :ivar details: Details of a job run. This field will only be sent for expand details filter. + :vartype details: ~azure.mgmt.databox.v2020_04_01.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo + :ivar delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :vartype delivery_type: str or ~azure.mgmt.databox.v2020_04_01.models.JobDeliveryType + :ivar delivery_info: Delivery Info of Job. + :vartype delivery_info: ~azure.mgmt.databox.v2020_04_01.models.JobDeliveryInfo :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. :vartype is_cancellable_without_fee: bool """ @@ -2483,10 +2835,34 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["ResourceIdentity"] = None, details: Optional["JobDetails"] = None, - delivery_type: Optional[Union[str, "JobDeliveryType"]] = None, + delivery_type: Optional[Union[str, "JobDeliveryType"]] = "NonScheduled", delivery_info: Optional["JobDeliveryInfo"] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2020_04_01.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2020_04_01.models.ResourceIdentity + :keyword transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType + :keyword details: Details of a job run. This field will only be sent for expand details filter. + :paramtype details: ~azure.mgmt.databox.v2020_04_01.models.JobDetails + :keyword delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :paramtype delivery_type: str or ~azure.mgmt.databox.v2020_04_01.models.JobDeliveryType + :keyword delivery_info: Delivery Info of Job. + :paramtype delivery_info: ~azure.mgmt.databox.v2020_04_01.models.JobDeliveryInfo + """ super(JobResource, self).__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) self.name = None self.id = None @@ -2509,10 +2885,10 @@ def __init__( class JobResourceList(msrest.serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :ivar value: List of job resources. + :vartype value: list[~azure.mgmt.databox.v2020_04_01.models.JobResource] + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str """ _attribute_map = { @@ -2527,6 +2903,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of job resources. + :paramtype value: list[~azure.mgmt.databox.v2020_04_01.models.JobResource] + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ super(JobResourceList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -2535,13 +2917,13 @@ def __init__( class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails + :vartype tags: dict[str, str] + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2020_04_01.models.ResourceIdentity + :ivar details: Details of a job to be updated. + :vartype details: ~azure.mgmt.databox.v2020_04_01.models.UpdateJobDetails """ _attribute_map = { @@ -2558,6 +2940,15 @@ def __init__( details: Optional["UpdateJobDetails"] = None, **kwargs ): + """ + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2020_04_01.models.ResourceIdentity + :keyword details: Details of a job to be updated. + :paramtype details: ~azure.mgmt.databox.v2020_04_01.models.UpdateJobDetails + """ super(JobResourceUpdateParameter, self).__init__(**kwargs) self.tags = tags self.identity = identity @@ -2574,17 +2965,17 @@ class JobStages(msrest.serialization.Model): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :vartype stage_name: str or ~azure.mgmt.databox.v2020_04_01.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", "WaitingForCustomerAction", "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :vartype stage_status: str or ~azure.mgmt.databox.v2020_04_01.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. :vartype stage_time: ~datetime.datetime :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object + :vartype job_stage_details: any """ _validation = { @@ -2607,6 +2998,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None @@ -2620,14 +3013,14 @@ class KeyEncryptionKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kek_type: Required. Type of encryption key used for key encryption. Possible values - include: "MicrosoftManaged", "CustomerManaged". - :type kek_type: str or ~azure.mgmt.databox.models.KekType - :param kek_url: Key encryption key. It is required in case of Customer managed KekType. - :type kek_url: str - :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + :ivar kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :vartype kek_type: str or ~azure.mgmt.databox.v2020_04_01.models.KekType + :ivar kek_url: Key encryption key. It is required in case of Customer managed KekType. + :vartype kek_url: str + :ivar kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed KekType. - :type kek_vault_resource_id: str + :vartype kek_vault_resource_id: str """ _validation = { @@ -2643,11 +3036,21 @@ class KeyEncryptionKey(msrest.serialization.Model): def __init__( self, *, - kek_type: Union[str, "KekType"], + kek_type: Union[str, "KekType"] = "MicrosoftManaged", kek_url: Optional[str] = None, kek_vault_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :paramtype kek_type: str or ~azure.mgmt.databox.v2020_04_01.models.KekType + :keyword kek_url: Key encryption key. It is required in case of Customer managed KekType. + :paramtype kek_url: str + :keyword kek_vault_resource_id: Kek vault resource id. It is required in case of Customer + managed KekType. + :paramtype kek_vault_resource_id: str + """ super(KeyEncryptionKey, self).__init__(**kwargs) self.kek_type = kek_type self.kek_url = kek_url @@ -2659,21 +3062,21 @@ class ManagedDiskDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param resource_group_id: Required. Resource Group Id of the compute disks. - :type resource_group_id: str - :param staging_storage_account_id: Required. Resource Id of the storage account that can be - used to copy the vhd for staging. - :type staging_storage_account_id: str + :vartype share_password: str + :ivar resource_group_id: Required. Resource Group Id of the compute disks. + :vartype resource_group_id: str + :ivar staging_storage_account_id: Required. Resource Id of the storage account that can be used + to copy the vhd for staging. + :vartype staging_storage_account_id: str """ _validation = { @@ -2697,6 +3100,20 @@ def __init__( share_password: Optional[str] = None, **kwargs ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword resource_group_id: Required. Resource Group Id of the compute disks. + :paramtype resource_group_id: str + :keyword staging_storage_account_id: Required. Resource Id of the storage account that can be + used to copy the vhd for staging. + :paramtype staging_storage_account_id: str + """ super(ManagedDiskDetails, self).__init__(share_password=share_password, **kwargs) self.data_account_type = 'ManagedDisk' # type: str self.resource_group_id = resource_group_id @@ -2708,11 +3125,11 @@ class NotificationPreference(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + :ivar stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :vartype stage_name: str or ~azure.mgmt.databox.v2020_04_01.models.NotificationStageName + :ivar send_notification: Required. Notification is required or not. + :vartype send_notification: bool """ _validation = { @@ -2729,9 +3146,16 @@ def __init__( self, *, stage_name: Union[str, "NotificationStageName"], - send_notification: bool, + send_notification: bool = True, **kwargs ): + """ + :keyword stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :paramtype stage_name: str or ~azure.mgmt.databox.v2020_04_01.models.NotificationStageName + :keyword send_notification: Required. Notification is required or not. + :paramtype send_notification: bool + """ super(NotificationPreference, self).__init__(**kwargs) self.stage_name = stage_name self.send_notification = send_notification @@ -2746,13 +3170,13 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2020_04_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :vartype properties: any :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool """ _validation = { @@ -2776,6 +3200,10 @@ def __init__( is_data_action: Optional[bool] = None, **kwargs ): + """ + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + """ super(Operation, self).__init__(**kwargs) self.name = None self.display = None @@ -2787,14 +3215,14 @@ def __init__( class OperationDisplay(msrest.serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :ivar provider: Provider name. + :vartype provider: str + :ivar resource: Resource name. + :vartype resource: str + :ivar operation: Localized name of the operation for display purpose. + :vartype operation: str + :ivar description: Localized description of the operation for display purpose. + :vartype description: str """ _attribute_map = { @@ -2813,6 +3241,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Provider name. + :paramtype provider: str + :keyword resource: Resource name. + :paramtype resource: str + :keyword operation: Localized name of the operation for display purpose. + :paramtype operation: str + :keyword description: Localized description of the operation for display purpose. + :paramtype description: str + """ super(OperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -2826,9 +3264,9 @@ class OperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2020_04_01.models.Operation] + :ivar next_link: Link for the next set of operations. + :vartype next_link: str """ _validation = { @@ -2846,6 +3284,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of operations. + :paramtype next_link: str + """ super(OperationList, self).__init__(**kwargs) self.value = None self.next_link = next_link @@ -2880,6 +3322,8 @@ def __init__( self, **kwargs ): + """ + """ super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None @@ -2889,10 +3333,10 @@ def __init__( class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred data center region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :ivar preferred_data_center_region: Preferred data center region. + :vartype preferred_data_center_region: list[str] + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2020_04_01.models.TransportPreferences """ _attribute_map = { @@ -2907,6 +3351,12 @@ def __init__( transport_preferences: Optional["TransportPreferences"] = None, **kwargs ): + """ + :keyword preferred_data_center_region: Preferred data center region. + :paramtype preferred_data_center_region: list[str] + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2020_04_01.models.TransportPreferences + """ super(Preferences, self).__init__(**kwargs) self.preferred_data_center_region = preferred_data_center_region self.transport_preferences = transport_preferences @@ -2917,16 +3367,17 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference of transport and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator + :ivar preference: Preference of transport and data center. + :vartype preference: ~azure.mgmt.databox.v2020_04_01.models.Preferences + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName """ _validation = { @@ -2947,6 +3398,13 @@ def __init__( preference: Optional["Preferences"] = None, **kwargs ): + """ + :keyword preference: Preference of transport and data center. + :paramtype preference: ~azure.mgmt.databox.v2020_04_01.models.Preferences + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + """ super(PreferencesValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str self.preference = preference @@ -2960,16 +3418,17 @@ class PreferencesValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError :ivar status: Validation status of requested data center and transport. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.ValidationStatus """ _validation = { @@ -2988,6 +3447,8 @@ def __init__( self, **kwargs ): + """ + """ super(PreferencesValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str self.status = None @@ -2996,12 +3457,14 @@ def __init__( class RegionConfigurationRequest(msrest.serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability for scheduling + :ivar schedule_availability_request: Request body to get the availability for scheduling orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given + :vartype schedule_availability_request: + ~azure.mgmt.databox.v2020_04_01.models.ScheduleAvailabilityRequest + :ivar transport_availability_request: Request body to get the transport availability for given sku. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest + :vartype transport_availability_request: + ~azure.mgmt.databox.v2020_04_01.models.TransportAvailabilityRequest """ _attribute_map = { @@ -3016,6 +3479,16 @@ def __init__( transport_availability_request: Optional["TransportAvailabilityRequest"] = None, **kwargs ): + """ + :keyword schedule_availability_request: Request body to get the availability for scheduling + orders. + :paramtype schedule_availability_request: + ~azure.mgmt.databox.v2020_04_01.models.ScheduleAvailabilityRequest + :keyword transport_availability_request: Request body to get the transport availability for + given sku. + :paramtype transport_availability_request: + ~azure.mgmt.databox.v2020_04_01.models.TransportAvailabilityRequest + """ super(RegionConfigurationRequest, self).__init__(**kwargs) self.schedule_availability_request = schedule_availability_request self.transport_availability_request = transport_availability_request @@ -3028,10 +3501,10 @@ class RegionConfigurationResponse(msrest.serialization.Model): :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse + ~azure.mgmt.databox.v2020_04_01.models.ScheduleAvailabilityResponse :ivar transport_availability_response: Transport options available for given sku in a region. :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse + ~azure.mgmt.databox.v2020_04_01.models.TransportAvailabilityResponse """ _validation = { @@ -3048,6 +3521,8 @@ def __init__( self, **kwargs ): + """ + """ super(RegionConfigurationResponse, self).__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None @@ -3058,8 +3533,8 @@ class ResourceIdentity(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param type: Identity type. - :type type: str + :ivar type: Identity type. + :vartype type: str :ivar principal_id: Service Principal Id backing the Msi. :vartype principal_id: str :ivar tenant_id: Home Tenant Id. @@ -3083,6 +3558,10 @@ def __init__( type: Optional[str] = None, **kwargs ): + """ + :keyword type: Identity type. + :paramtype type: str + """ super(ResourceIdentity, self).__init__(**kwargs) self.type = type self.principal_id = None @@ -3110,6 +3589,8 @@ def __init__( self, **kwargs ): + """ + """ super(ScheduleAvailabilityResponse, self).__init__(**kwargs) self.available_dates = None @@ -3123,13 +3604,14 @@ class ShareCredentialDetails(msrest.serialization.Model): :vartype share_name: str :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + :vartype share_type: str or ~azure.mgmt.databox.v2020_04_01.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] + :vartype supported_access_protocols: list[str or + ~azure.mgmt.databox.v2020_04_01.models.AccessProtocol] """ _validation = { @@ -3152,6 +3634,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -3165,14 +3649,14 @@ class ShipmentPickUpRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be + :ivar start_time: Required. Minimum date after which the pick up should commence, this must be in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be + :vartype start_time: ~datetime.datetime + :ivar end_time: Required. Maximum date before which the pick up should commence, this must be in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :vartype end_time: ~datetime.datetime + :ivar shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :vartype shipment_location: str """ _validation = { @@ -3195,6 +3679,16 @@ def __init__( shipment_location: str, **kwargs ): + """ + :keyword start_time: Required. Minimum date after which the pick up should commence, this must + be in local time of pick up area. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Required. Maximum date before which the pick up should commence, this must + be in local time of pick up area. + :paramtype end_time: ~datetime.datetime + :keyword shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :paramtype shipment_location: str + """ super(ShipmentPickUpRequest, self).__init__(**kwargs) self.start_time = start_time self.end_time = end_time @@ -3227,6 +3721,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None @@ -3237,27 +3733,27 @@ class ShippingAddress(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :ivar street_address1: Required. Street Address line 1. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: Required. Name of the Country. + :vartype country: str + :ivar postal_code: Required. Postal code. + :vartype postal_code: str + :ivar zip_extended_code: Extended Zip Code. + :vartype zip_extended_code: str + :ivar company_name: Name of the company. + :vartype company_name: str + :ivar address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :vartype address_type: str or ~azure.mgmt.databox.v2020_04_01.models.AddressType """ _validation = { @@ -3291,9 +3787,32 @@ def __init__( state_or_province: Optional[str] = None, zip_extended_code: Optional[str] = None, company_name: Optional[str] = None, - address_type: Optional[Union[str, "AddressType"]] = None, + address_type: Optional[Union[str, "AddressType"]] = "None", **kwargs ): + """ + :keyword street_address1: Required. Street Address line 1. + :paramtype street_address1: str + :keyword street_address2: Street Address line 2. + :paramtype street_address2: str + :keyword street_address3: Street Address line 3. + :paramtype street_address3: str + :keyword city: Name of the City. + :paramtype city: str + :keyword state_or_province: Name of the State or Province. + :paramtype state_or_province: str + :keyword country: Required. Name of the Country. + :paramtype country: str + :keyword postal_code: Required. Postal code. + :paramtype postal_code: str + :keyword zip_extended_code: Extended Zip Code. + :paramtype zip_extended_code: str + :keyword company_name: Name of the company. + :paramtype company_name: str + :keyword address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :paramtype address_type: str or ~azure.mgmt.databox.v2020_04_01.models.AddressType + """ super(ShippingAddress, self).__init__(**kwargs) self.street_address1 = street_address1 self.street_address2 = street_address2 @@ -3312,13 +3831,13 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :vartype name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :ivar display_name: The display name of the sku. + :vartype display_name: str + :ivar family: The sku family. + :vartype family: str """ _validation = { @@ -3339,6 +3858,15 @@ def __init__( family: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :keyword display_name: The display name of the sku. + :paramtype display_name: str + :keyword family: The sku family. + :paramtype family: str + """ super(Sku, self).__init__(**kwargs) self.name = name self.display_name = display_name @@ -3350,23 +3878,24 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str + :vartype location: str """ _validation = { @@ -3394,6 +3923,20 @@ def __init__( location: str, **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + """ super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str self.device_type = device_type @@ -3409,16 +3952,17 @@ class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.ValidationStatus """ _validation = { @@ -3437,6 +3981,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str self.status = None @@ -3467,6 +4013,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None @@ -3503,6 +4051,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None @@ -3515,21 +4065,21 @@ class SkuInformation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~azure.mgmt.databox.v2020_04_01.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool :ivar data_location_to_service_location_map: The map of data location to service location. :vartype data_location_to_service_location_map: - list[~azure.mgmt.databox.models.DataLocationToServiceLocationMap] + list[~azure.mgmt.databox.v2020_04_01.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2020_04_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~azure.mgmt.databox.v2020_04_01.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :vartype disabled_reason: str or ~azure.mgmt.databox.v2020_04_01.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -3564,6 +4114,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None @@ -3581,18 +4133,18 @@ class StorageAccountDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param storage_account_id: Required. Storage Account Resource Id. - :type storage_account_id: str + :vartype share_password: str + :ivar storage_account_id: Required. Storage Account Resource Id. + :vartype storage_account_id: str """ _validation = { @@ -3613,6 +4165,17 @@ def __init__( share_password: Optional[str] = None, **kwargs ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword storage_account_id: Required. Storage Account Resource Id. + :paramtype storage_account_id: str + """ super(StorageAccountDetails, self).__init__(share_password=share_password, **kwargs) self.data_account_type = 'StorageAccount' # type: str self.storage_account_id = storage_account_id @@ -3623,11 +4186,12 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator """ _validation = { @@ -3642,6 +4206,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str @@ -3653,16 +4219,17 @@ class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInp All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_04_01.models.CloudError :ivar status: Validation status of subscription permission to create job. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.ValidationStatus """ _validation = { @@ -3681,6 +4248,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str self.status = None @@ -3691,13 +4260,13 @@ class TransferAllDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: + :ivar data_account_type: Required. Type of the account of data. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :type transfer_all_blobs: bool - :param transfer_all_files: To indicate if all Azure Files have to be transferred. - :type transfer_all_files: bool + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.models.DataAccountType + :ivar transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :vartype transfer_all_blobs: bool + :ivar transfer_all_files: To indicate if all Azure Files have to be transferred. + :vartype transfer_all_files: bool """ _validation = { @@ -3718,6 +4287,15 @@ def __init__( transfer_all_files: Optional[bool] = None, **kwargs ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.models.DataAccountType + :keyword transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :paramtype transfer_all_blobs: bool + :keyword transfer_all_files: To indicate if all Azure Files have to be transferred. + :paramtype transfer_all_files: bool + """ super(TransferAllDetails, self).__init__(**kwargs) self.data_account_type = data_account_type self.transfer_all_blobs = transfer_all_blobs @@ -3729,16 +4307,18 @@ class TransferConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible + :ivar transfer_configuration_type: Required. Type of the configuration for transfer. Possible values include: "TransferAll", "TransferUsingFilter". - :type transfer_configuration_type: str or ~azure.mgmt.databox.models.TransferConfigurationType - :param transfer_filter_details: Map of filter type and the details to filter. This field is + :vartype transfer_configuration_type: str or + ~azure.mgmt.databox.v2020_04_01.models.TransferConfigurationType + :ivar transfer_filter_details: Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - :type transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :param transfer_all_details: Map of filter type and the details to transfer all data. This - field is required only if the TransferConfigurationType is given as TransferAll. - :type transfer_all_details: ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails + :vartype transfer_filter_details: + ~azure.mgmt.databox.v2020_04_01.models.TransferConfigurationTransferFilterDetails + :ivar transfer_all_details: Map of filter type and the details to transfer all data. This field + is required only if the TransferConfigurationType is given as TransferAll. + :vartype transfer_all_details: + ~azure.mgmt.databox.v2020_04_01.models.TransferConfigurationTransferAllDetails """ _validation = { @@ -3759,6 +4339,20 @@ def __init__( transfer_all_details: Optional["TransferConfigurationTransferAllDetails"] = None, **kwargs ): + """ + :keyword transfer_configuration_type: Required. Type of the configuration for transfer. + Possible values include: "TransferAll", "TransferUsingFilter". + :paramtype transfer_configuration_type: str or + ~azure.mgmt.databox.v2020_04_01.models.TransferConfigurationType + :keyword transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :paramtype transfer_filter_details: + ~azure.mgmt.databox.v2020_04_01.models.TransferConfigurationTransferFilterDetails + :keyword transfer_all_details: Map of filter type and the details to transfer all data. This + field is required only if the TransferConfigurationType is given as TransferAll. + :paramtype transfer_all_details: + ~azure.mgmt.databox.v2020_04_01.models.TransferConfigurationTransferAllDetails + """ super(TransferConfiguration, self).__init__(**kwargs) self.transfer_configuration_type = transfer_configuration_type self.transfer_filter_details = transfer_filter_details @@ -3768,8 +4362,8 @@ def __init__( class TransferConfigurationTransferAllDetails(msrest.serialization.Model): """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. - :param include: Details to transfer all data. - :type include: ~azure.mgmt.databox.models.TransferAllDetails + :ivar include: Details to transfer all data. + :vartype include: ~azure.mgmt.databox.v2020_04_01.models.TransferAllDetails """ _attribute_map = { @@ -3782,6 +4376,10 @@ def __init__( include: Optional["TransferAllDetails"] = None, **kwargs ): + """ + :keyword include: Details to transfer all data. + :paramtype include: ~azure.mgmt.databox.v2020_04_01.models.TransferAllDetails + """ super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) self.include = include @@ -3789,8 +4387,8 @@ def __init__( class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - :param include: Details of the filtering the transfer of data. - :type include: ~azure.mgmt.databox.models.TransferFilterDetails + :ivar include: Details of the filtering the transfer of data. + :vartype include: ~azure.mgmt.databox.v2020_04_01.models.TransferFilterDetails """ _attribute_map = { @@ -3803,6 +4401,10 @@ def __init__( include: Optional["TransferFilterDetails"] = None, **kwargs ): + """ + :keyword include: Details of the filtering the transfer of data. + :paramtype include: ~azure.mgmt.databox.v2020_04_01.models.TransferFilterDetails + """ super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) self.include = include @@ -3812,15 +4414,16 @@ class TransferFilterDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: + :ivar data_account_type: Required. Type of the account of data. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param blob_filter_details: Filter details to transfer blobs. - :type blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :param azure_file_filter_details: Filter details to transfer Azure files. - :type azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :param filter_file_details: Details of the filter files to be used for data transfer. - :type filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.models.DataAccountType + :ivar blob_filter_details: Filter details to transfer blobs. + :vartype blob_filter_details: ~azure.mgmt.databox.v2020_04_01.models.BlobFilterDetails + :ivar azure_file_filter_details: Filter details to transfer Azure files. + :vartype azure_file_filter_details: + ~azure.mgmt.databox.v2020_04_01.models.AzureFileFilterDetails + :ivar filter_file_details: Details of the filter files to be used for data transfer. + :vartype filter_file_details: list[~azure.mgmt.databox.v2020_04_01.models.FilterFileDetails] """ _validation = { @@ -3843,6 +4446,18 @@ def __init__( filter_file_details: Optional[List["FilterFileDetails"]] = None, **kwargs ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or ~azure.mgmt.databox.v2020_04_01.models.DataAccountType + :keyword blob_filter_details: Filter details to transfer blobs. + :paramtype blob_filter_details: ~azure.mgmt.databox.v2020_04_01.models.BlobFilterDetails + :keyword azure_file_filter_details: Filter details to transfer Azure files. + :paramtype azure_file_filter_details: + ~azure.mgmt.databox.v2020_04_01.models.AzureFileFilterDetails + :keyword filter_file_details: Details of the filter files to be used for data transfer. + :paramtype filter_file_details: list[~azure.mgmt.databox.v2020_04_01.models.FilterFileDetails] + """ super(TransferFilterDetails, self).__init__(**kwargs) self.data_account_type = data_account_type self.blob_filter_details = blob_filter_details @@ -3857,7 +4472,7 @@ class TransportAvailabilityDetails(msrest.serialization.Model): :ivar shipment_type: Transport Shipment Type supported for given region. Possible values include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype shipment_type: str or ~azure.mgmt.databox.v2020_04_01.models.TransportShipmentTypes """ _validation = { @@ -3872,6 +4487,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityDetails, self).__init__(**kwargs) self.shipment_type = None @@ -3879,9 +4496,9 @@ def __init__( class TransportAvailabilityRequest(msrest.serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + :ivar sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName """ _attribute_map = { @@ -3894,6 +4511,11 @@ def __init__( sku_name: Optional[Union[str, "SkuName"]] = None, **kwargs ): + """ + :keyword sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype sku_name: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + """ super(TransportAvailabilityRequest, self).__init__(**kwargs) self.sku_name = sku_name @@ -3905,7 +4527,7 @@ class TransportAvailabilityResponse(msrest.serialization.Model): :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~azure.mgmt.databox.v2020_04_01.models.TransportAvailabilityDetails] """ _validation = { @@ -3920,6 +4542,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityResponse, self).__init__(**kwargs) self.transport_availability_details = None @@ -3929,9 +4553,10 @@ class TransportPreferences(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + :ivar preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype preferred_shipment_type: str or + ~azure.mgmt.databox.v2020_04_01.models.TransportShipmentTypes """ _validation = { @@ -3948,6 +4573,12 @@ def __init__( preferred_shipment_type: Union[str, "TransportShipmentTypes"], **kwargs ): + """ + :keyword preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :paramtype preferred_shipment_type: str or + ~azure.mgmt.databox.v2020_04_01.models.TransportShipmentTypes + """ super(TransportPreferences, self).__init__(**kwargs) self.preferred_shipment_type = preferred_shipment_type @@ -3960,7 +4591,7 @@ class UnencryptedCredentials(msrest.serialization.Model): :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2020_04_01.models.JobSecrets """ _validation = { @@ -3977,6 +4608,8 @@ def __init__( self, **kwargs ): + """ + """ super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None @@ -3985,10 +4618,10 @@ def __init__( class UnencryptedCredentialsList(msrest.serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :ivar value: List of unencrypted credentials. + :vartype value: list[~azure.mgmt.databox.v2020_04_01.models.UnencryptedCredentials] + :ivar next_link: Link for the next set of unencrypted credentials. + :vartype next_link: str """ _attribute_map = { @@ -4003,6 +4636,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of unencrypted credentials. + :paramtype value: list[~azure.mgmt.databox.v2020_04_01.models.UnencryptedCredentials] + :keyword next_link: Link for the next set of unencrypted credentials. + :paramtype next_link: str + """ super(UnencryptedCredentialsList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -4011,12 +4650,12 @@ def __init__( class UpdateJobDetails(msrest.serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param key_encryption_key: Key encryption key for the job. - :type key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar contact_details: Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress + :ivar key_encryption_key: Key encryption key for the job. + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.models.KeyEncryptionKey """ _attribute_map = { @@ -4033,6 +4672,14 @@ def __init__( key_encryption_key: Optional["KeyEncryptionKey"] = None, **kwargs ): + """ + :keyword contact_details: Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_04_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress + :keyword key_encryption_key: Key encryption key for the job. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_04_01.models.KeyEncryptionKey + """ super(UpdateJobDetails, self).__init__(**kwargs) self.contact_details = contact_details self.shipping_address = shipping_address @@ -4044,18 +4691,19 @@ class ValidateAddress(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_04_01.models.ValidationInputDiscriminator + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :vartype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2020_04_01.models.TransportPreferences """ _validation = { @@ -4079,6 +4727,15 @@ def __init__( transport_preferences: Optional["TransportPreferences"] = None, **kwargs ): + """ + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_04_01.models.ShippingAddress + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_04_01.models.SkuName + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2020_04_01.models.TransportPreferences + """ super(ValidateAddress, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str self.shipping_address = shipping_address @@ -4093,10 +4750,11 @@ class ValidationResponse(msrest.serialization.Model): :ivar status: Overall validation status. Possible values include: "AllValidToProceed", "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_04_01.models.OverallValidationStatus :ivar individual_response_details: List of response details contain validationType and its response as key and value respectively. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] + :vartype individual_response_details: + list[~azure.mgmt.databox.v2020_04_01.models.ValidationInputResponse] """ _validation = { @@ -4113,6 +4771,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationResponse, self).__init__(**kwargs) self.status = None self.individual_response_details = None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_jobs_operations.py index f6529e974c09..fe194af982a8 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_jobs_operations.py @@ -5,25 +5,388 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_book_shipment_pick_up_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_credentials_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class JobsOperations(object): """JobsOperations operations. @@ -32,7 +395,7 @@ class JobsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_04_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -47,12 +410,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: """Lists all the jobs available under the subscription. :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in @@ -60,7 +423,7 @@ def list( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -68,36 +431,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,24 +468,25 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: """Lists all the jobs available under the given resource group. :param resource_group_name: The Resource Group Name. @@ -137,7 +496,7 @@ def list_by_resource_group( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -145,37 +504,33 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -188,25 +543,26 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - job_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.JobResource" + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": """Gets information about the specified job. :param resource_group_name: The Resource Group Name. @@ -219,7 +575,7 @@ def get( :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource + :rtype: ~azure.mgmt.databox.v2020_04_01.models.JobResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] @@ -227,35 +583,24 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('JobResource', pipeline_response) @@ -264,54 +609,44 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + def _create_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -321,16 +656,18 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_create( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: """Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. @@ -340,18 +677,22 @@ def begin_create( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource: Job details from request body. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :type job_resource: ~azure.mgmt.databox.v2020_04_01.models.JobResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_04_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -363,27 +704,21 @@ def begin_create( resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,61 +730,51 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a job. :param resource_group_name: The Resource Group Name. @@ -459,15 +784,17 @@ def begin_delete( :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -481,21 +808,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -507,57 +827,45 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _update_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -567,17 +875,19 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_update( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: """Updates the properties of an existing job. :param resource_group_name: The Resource Group Name. @@ -586,21 +896,26 @@ def begin_update( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2020_04_01.models.JobResourceUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_04_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -613,27 +928,21 @@ def begin_update( job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -645,16 +954,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + @distributed_trace def book_shipment_pick_up( self, - resource_group_name, # type: str - job_name, # type: str - shipment_pick_up_request, # type: "_models.ShipmentPickUpRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ShipmentPickUpResponse" + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": """Book shipment pick up. :param resource_group_name: The Resource Group Name. @@ -663,10 +973,10 @@ def book_shipment_pick_up( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :type shipment_pick_up_request: ~azure.mgmt.databox.v2020_04_01.models.ShipmentPickUpRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.ShipmentPickUpResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] @@ -674,38 +984,28 @@ def book_shipment_pick_up( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) @@ -714,16 +1014,18 @@ def book_shipment_pick_up( return cls(pipeline_response, deserialized, {}) return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + @distributed_trace def cancel( self, - resource_group_name, # type: str - job_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: """CancelJob. :param resource_group_name: The Resource Group Name. @@ -732,7 +1034,7 @@ def cancel( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :type cancellation_reason: ~azure.mgmt.databox.v2020_04_01.models.CancellationReason :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 @@ -743,38 +1045,28 @@ def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(cancellation_reason, 'CancellationReason') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -782,13 +1074,14 @@ def cancel( cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + @distributed_trace def list_credentials( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UnencryptedCredentialsList"] + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentialsList"]: """This method gets the unencrypted secrets related to the job. :param resource_group_name: The Resource Group Name. @@ -797,8 +1090,10 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.models.UnencryptedCredentialsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] @@ -806,36 +1101,33 @@ def list_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -848,12 +1140,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_operations.py index 85d48f01c117..dafdc3d04f08 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_operations.py @@ -5,23 +5,50 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +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: + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.DataBox/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -30,7 +57,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_04_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,16 +72,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationList"] + **kwargs: Any + ) -> Iterable["_models.OperationList"]: """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 OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.OperationList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -62,30 +89,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + 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) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,12 +122,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_service_operations.py index 409bd7a9a99d..7c545dcf7c36 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/operations/_service_operations.py @@ -5,23 +5,284 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_available_skus_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_address_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-04-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ServiceOperations(object): """ServiceOperations operations. @@ -30,7 +291,7 @@ class ServiceOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_04_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,14 +306,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_available_skus_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + resource_group_name: str, + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> Iterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription, resource group and location. @@ -61,55 +322,53 @@ def list_available_skus_by_resource_group( :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2020_04_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_04_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,34 +381,35 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + @distributed_trace def validate_address( self, - location, # type: str - validate_address, # type: "_models.ValidateAddress" - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressValidationOutput" + location: str, + validate_address: "_models.ValidateAddress", + **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. :type location: str :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :type validate_address: ~azure.mgmt.databox.v2020_04_01.models.ValidateAddress :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.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.v2020_04_01.models.AddressValidationOutput :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] @@ -157,37 +417,27 @@ def validate_address( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(validate_address, 'ValidateAddress') + + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AddressValidationOutput', pipeline_response) @@ -196,16 +446,18 @@ def validate_address( return cls(pipeline_response, deserialized, {}) return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + @distributed_trace def validate_inputs_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + resource_group_name: str, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under resource group. :param resource_group_name: The Resource Group Name. @@ -213,10 +465,10 @@ def validate_inputs_by_resource_group( :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -224,38 +476,28 @@ def validate_inputs_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidationResponse', pipeline_response) @@ -264,24 +506,26 @@ def validate_inputs_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace def validate_inputs( self, - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under subscription. :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2020_04_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -289,37 +533,27 @@ def validate_inputs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidationResponse', pipeline_response) @@ -328,25 +562,28 @@ def validate_inputs( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace def region_configuration( self, - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location at Subscription level. :param location: The location of the resource. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -354,37 +591,27 @@ def region_configuration( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) @@ -393,16 +620,18 @@ def region_configuration( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + @distributed_trace def region_configuration_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + resource_group_name: str, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location at Resource group level. @@ -412,10 +641,11 @@ def region_configuration_by_resource_group( :type location: str :param region_configuration_request: Request body to get the configuration for the region at resource group level. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2020_04_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -423,38 +653,28 @@ def region_configuration_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) @@ -463,4 +683,6 @@ def region_configuration_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/__init__.py index ae972ed54f84..72afe00aa0a1 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['DataBoxManagementClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_configuration.py index 10fdfd792e62..e15c4bbee3fc 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_configuration.py @@ -6,18 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential @@ -35,16 +33,15 @@ class DataBoxManagementClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) 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 @@ -68,4 +65,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_data_box_management_client.py index e696cb06a780..7584f8f4e2e2 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_data_box_management_client.py @@ -6,65 +6,84 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import JobsOperations, Operations, ServiceOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from . import models - - -class DataBoxManagementClient(object): +class DataBoxManagementClient: """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.operations.Operations + :vartype operations: azure.mgmt.databox.v2020_11_01.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2020_11_01.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.operations.ServiceOperations + :vartype service: azure.mgmt.databox.v2020_11_01.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + 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(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._serialize.client_side_validation = False 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, # type: 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/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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 + """ - 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) + 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): # type: () -> None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_metadata.json index add87dd6b287..1355b3265314 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_metadata.json +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_metadata.json @@ -5,11 +5,13 @@ "name": "DataBoxManagementClient", "filename": "_data_box_management_client", "description": "The DataBox Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The Subscription Id.", "docstring_type": "str", "required": true @@ -42,22 +44,61 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "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" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_version.py index eae7c95b6fbd..e5754a47ce68 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_version.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0b1" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/__init__.py index bb6b75a72db8..c57c5574bdd0 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/__init__.py @@ -8,3 +8,8 @@ from ._data_box_management_client import DataBoxManagementClient __all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_configuration.py index 9287b4a36561..73756b735645 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_configuration.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -37,11 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) 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 @@ -64,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_data_box_management_client.py index b192ff7cd771..0b9f49d2ba42 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_data_box_management_client.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_data_box_management_client.py @@ -6,62 +6,84 @@ # 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, Optional, TYPE_CHECKING +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +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 -from ._configuration import DataBoxManagementClientConfiguration -from .operations import Operations -from .operations import JobsOperations -from .operations import ServiceOperations -from .. import models - - -class DataBoxManagementClient(object): +class DataBoxManagementClient: """The DataBox Client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.databox.aio.operations.Operations + :vartype operations: azure.mgmt.databox.v2020_11_01.aio.operations.Operations :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databox.aio.operations.JobsOperations + :vartype jobs: azure.mgmt.databox.v2020_11_01.aio.operations.JobsOperations :ivar service: ServiceOperations operations - :vartype service: azure.mgmt.databox.aio.operations.ServiceOperations + :vartype service: azure.mgmt.databox.v2020_11_01.aio.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = DataBoxManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataBoxManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False 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/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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 + """ - 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) + 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() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_jobs_operations.py index 37298e86749d..7098391cce8f 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_jobs_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._jobs_operations import build_book_shipment_pick_up_request, build_cancel_request, build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_credentials_request, build_list_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -28,7 +33,7 @@ class JobsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_11_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -43,10 +48,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResourceList"]: """Lists all the jobs available under the subscription. @@ -55,7 +61,8 @@ def list( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -63,36 +70,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -105,22 +107,24 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobResourceList"]: """Lists all the jobs available under the given resource group. @@ -131,7 +135,8 @@ def list_by_resource_group( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -139,37 +144,33 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,23 +183,25 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, job_name: str, expand: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.JobResource": """Gets information about the specified job. @@ -212,7 +215,7 @@ async def get( :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource + :rtype: ~azure.mgmt.databox.v2020_11_01.models.JobResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] @@ -220,35 +223,24 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('JobResource', pipeline_response) @@ -257,53 +249,44 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + async def _create_initial( self, resource_group_name: str, job_name: str, job_resource: "_models.JobResource", - **kwargs + **kwargs: Any ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource, 'JobResource') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -313,14 +296,17 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, resource_group_name: str, job_name: str, job_resource: "_models.JobResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.JobResource"]: """Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. @@ -331,18 +317,22 @@ async def begin_create( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource: Job details from request body. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :type job_resource: ~azure.mgmt.databox.v2020_11_01.models.JobResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_11_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -354,27 +344,21 @@ async def begin_create( resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -386,58 +370,50 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore async def _delete_initial( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a job. @@ -448,15 +424,17 @@ async def begin_delete( :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -470,21 +448,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -496,6 +467,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore async def _update_initial( @@ -504,48 +476,36 @@ async def _update_initial( job_name: str, job_resource_update_parameter: "_models.JobResourceUpdateParameter", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -555,15 +515,18 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, resource_group_name: str, job_name: str, job_resource_update_parameter: "_models.JobResourceUpdateParameter", if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.JobResource"]: """Updates the properties of an existing job. @@ -573,21 +536,26 @@ async def begin_update( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2020_11_01.models.JobResourceUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2020_11_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -600,27 +568,21 @@ async def begin_update( job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -632,14 +594,16 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + @distributed_trace_async async def book_shipment_pick_up( self, resource_group_name: str, job_name: str, shipment_pick_up_request: "_models.ShipmentPickUpRequest", - **kwargs + **kwargs: Any ) -> "_models.ShipmentPickUpResponse": """Book shipment pick up. @@ -649,10 +613,10 @@ async def book_shipment_pick_up( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :type shipment_pick_up_request: ~azure.mgmt.databox.v2020_11_01.models.ShipmentPickUpRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.ShipmentPickUpResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] @@ -660,38 +624,28 @@ async def book_shipment_pick_up( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) @@ -700,14 +654,17 @@ async def book_shipment_pick_up( return cls(pipeline_response, deserialized, {}) return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + @distributed_trace_async async def cancel( self, resource_group_name: str, job_name: str, cancellation_reason: "_models.CancellationReason", - **kwargs + **kwargs: Any ) -> None: """CancelJob. @@ -717,7 +674,7 @@ async def cancel( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :type cancellation_reason: ~azure.mgmt.databox.v2020_11_01.models.CancellationReason :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 @@ -728,38 +685,28 @@ async def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -767,11 +714,13 @@ async def cancel( cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + @distributed_trace def list_credentials( self, resource_group_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: """This method gets the unencrypted secrets related to the job. @@ -781,8 +730,10 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.models.UnencryptedCredentialsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] @@ -790,36 +741,33 @@ def list_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -832,12 +780,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_operations.py index e59616bb0771..621eafca23a6 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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]] @@ -26,7 +31,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_11_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,15 +46,17 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationList"]: """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 OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.OperationList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -57,30 +64,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + 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) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -93,12 +97,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_service_operations.py index f15eb76d17f1..751a60fe02ae 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_service_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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, 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]] @@ -26,7 +31,7 @@ class ServiceOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_11_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,12 +46,13 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_available_skus_by_resource_group( self, resource_group_name: str, location: str, available_sku_request: "_models.AvailableSkuRequest", - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription, resource group and location. @@ -56,55 +62,53 @@ def list_available_skus_by_resource_group( :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2020_11_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2020_11_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,22 +121,24 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, 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'} # type: ignore + @distributed_trace_async async def validate_address( self, location: str, validate_address: "_models.ValidateAddress", - **kwargs + **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. @@ -140,10 +146,10 @@ async def validate_address( :param location: The location of the resource. :type location: str :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :type validate_address: ~azure.mgmt.databox.v2020_11_01.models.ValidateAddress :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.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] @@ -151,37 +157,27 @@ async def validate_address( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AddressValidationOutput', pipeline_response) @@ -190,14 +186,17 @@ async def validate_address( return cls(pipeline_response, deserialized, {}) return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + @distributed_trace_async async def validate_inputs_by_resource_group( self, resource_group_name: str, location: str, validation_request: "_models.ValidationRequest", - **kwargs + **kwargs: Any ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under resource group. @@ -206,10 +205,10 @@ async def validate_inputs_by_resource_group( :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2020_11_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -217,38 +216,28 @@ async def validate_inputs_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidationResponse', pipeline_response) @@ -257,23 +246,26 @@ async def validate_inputs_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace_async async def validate_inputs( self, location: str, validation_request: "_models.ValidationRequest", - **kwargs + **kwargs: Any ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under subscription. :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2020_11_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -281,37 +273,27 @@ async def validate_inputs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidationResponse', pipeline_response) @@ -320,13 +302,16 @@ async def validate_inputs( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace_async async def region_configuration( self, location: str, region_configuration_request: "_models.RegionConfigurationRequest", - **kwargs + **kwargs: Any ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location at Subscription level. @@ -334,10 +319,11 @@ async def region_configuration( :param location: The location of the resource. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -345,37 +331,27 @@ async def region_configuration( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) @@ -384,14 +360,17 @@ async def region_configuration( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + @distributed_trace_async async def region_configuration_by_resource_group( self, resource_group_name: str, location: str, region_configuration_request: "_models.RegionConfigurationRequest", - **kwargs + **kwargs: Any ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location at Resource group level. @@ -402,10 +381,11 @@ async def region_configuration_by_resource_group( :type location: str :param region_configuration_request: Request body to get the configuration for the region at resource group level. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -413,38 +393,28 @@ async def region_configuration_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) @@ -453,4 +423,6 @@ async def region_configuration_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/__init__.py index 14f8f8c755cb..addd688bd373 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/__init__.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/__init__.py @@ -6,212 +6,110 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - 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 EncryptionPreferences - from ._models_py3 import ErrorDetail - from ._models_py3 import FilterFileDetails - from ._models_py3 import HeavyScheduleAvailabilityRequest - from ._models_py3 import IdentityProperties - 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 UserAssignedIdentity - from ._models_py3 import UserAssignedProperties - 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 -except (SyntaxError, ImportError): - from ._models import AccountCredentialDetails # type: ignore - from ._models import AdditionalErrorInfo # type: ignore - from ._models import AddressValidationOutput # type: ignore - from ._models import AddressValidationProperties # type: ignore - from ._models import ApiError # type: ignore - from ._models import ApplianceNetworkConfiguration # type: ignore - from ._models import ArmBaseObject # type: ignore - from ._models import AvailableSkuRequest # type: ignore - from ._models import AvailableSkusResult # type: ignore - from ._models import AzureFileFilterDetails # type: ignore - from ._models import BlobFilterDetails # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import CloudError # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CopyLogDetails # type: ignore - from ._models import CopyProgress # type: ignore - from ._models import CreateJobValidations # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationRequest # type: ignore - from ._models import CreateOrderLimitForSubscriptionValidationResponseProperties # type: ignore - from ._models import DataAccountDetails # type: ignore - from ._models import DataBoxAccountCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyLogDetails # type: ignore - from ._models import DataBoxDiskCopyProgress # type: ignore - from ._models import DataBoxDiskJobDetails # type: ignore - from ._models import DataBoxDiskJobSecrets # type: ignore - from ._models import DataBoxHeavyAccountCopyLogDetails # type: ignore - from ._models import DataBoxHeavyJobDetails # type: ignore - from ._models import DataBoxHeavyJobSecrets # type: ignore - from ._models import DataBoxHeavySecret # type: ignore - from ._models import DataBoxJobDetails # type: ignore - from ._models import DataBoxScheduleAvailabilityRequest # type: ignore - from ._models import DataBoxSecret # type: ignore - from ._models import DataExportDetails # type: ignore - from ._models import DataImportDetails # type: ignore - from ._models import DataLocationToServiceLocationMap # type: ignore - from ._models import DataTransferDetailsValidationRequest # type: ignore - from ._models import DataTransferDetailsValidationResponseProperties # type: ignore - from ._models import DataboxJobSecrets # type: ignore - from ._models import DcAccessSecurityCode # type: ignore - from ._models import Details # type: ignore - from ._models import DiskScheduleAvailabilityRequest # type: ignore - from ._models import DiskSecret # type: ignore - from ._models import EncryptionPreferences # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import FilterFileDetails # type: ignore - from ._models import HeavyScheduleAvailabilityRequest # type: ignore - from ._models import IdentityProperties # type: ignore - from ._models import JobDeliveryInfo # type: ignore - from ._models import JobDetails # type: ignore - from ._models import JobResource # type: ignore - from ._models import JobResourceList # type: ignore - from ._models import JobResourceUpdateParameter # type: ignore - from ._models import JobSecrets # type: ignore - from ._models import JobStages # type: ignore - from ._models import KeyEncryptionKey # type: ignore - from ._models import ManagedDiskDetails # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import PackageShippingDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import PreferencesValidationRequest # type: ignore - from ._models import PreferencesValidationResponseProperties # type: ignore - from ._models import RegionConfigurationRequest # type: ignore - from ._models import RegionConfigurationResponse # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceIdentity # type: ignore - from ._models import ScheduleAvailabilityRequest # type: ignore - from ._models import ScheduleAvailabilityResponse # type: ignore - from ._models import ShareCredentialDetails # type: ignore - from ._models import ShipmentPickUpRequest # type: ignore - from ._models import ShipmentPickUpResponse # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import Sku # type: ignore - from ._models import SkuAvailabilityValidationRequest # type: ignore - from ._models import SkuAvailabilityValidationResponseProperties # type: ignore - from ._models import SkuCapacity # type: ignore - from ._models import SkuCost # type: ignore - from ._models import SkuInformation # type: ignore - from ._models import StorageAccountDetails # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationRequest # type: ignore - from ._models import SubscriptionIsAllowedToCreateJobValidationResponseProperties # type: ignore - from ._models import TransferAllDetails # type: ignore - from ._models import TransferConfiguration # type: ignore - from ._models import TransferConfigurationTransferAllDetails # type: ignore - from ._models import TransferConfigurationTransferFilterDetails # type: ignore - from ._models import TransferFilterDetails # type: ignore - from ._models import TransportAvailabilityDetails # type: ignore - from ._models import TransportAvailabilityRequest # type: ignore - from ._models import TransportAvailabilityResponse # type: ignore - from ._models import TransportPreferences # type: ignore - from ._models import UnencryptedCredentials # type: ignore - from ._models import UnencryptedCredentialsList # type: ignore - from ._models import UpdateJobDetails # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import UserAssignedProperties # type: ignore - from ._models import ValidateAddress # type: ignore - from ._models import ValidationInputRequest # type: ignore - from ._models import ValidationInputResponse # type: ignore - from ._models import ValidationRequest # type: ignore - from ._models import ValidationResponse # type: ignore +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 EncryptionPreferences +from ._models_py3 import ErrorDetail +from ._models_py3 import FilterFileDetails +from ._models_py3 import HeavyScheduleAvailabilityRequest +from ._models_py3 import IdentityProperties +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 SystemData +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 UserAssignedIdentity +from ._models_py3 import UserAssignedProperties +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, @@ -323,6 +221,7 @@ 'StorageAccountDetails', 'SubscriptionIsAllowedToCreateJobValidationRequest', 'SubscriptionIsAllowedToCreateJobValidationResponseProperties', + 'SystemData', 'TransferAllDetails', 'TransferConfiguration', 'TransferConfigurationTransferAllDetails', diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_data_box_management_client_enums.py index 7d1d81567b85..ed785dc7cc04 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_data_box_management_client_enums.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_data_box_management_client_enums.py @@ -6,232 +6,315 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) +class AccessProtocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" -class AccessProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - SMB = "SMB" #: Server Message Block protocol(SMB). - NFS = "NFS" #: Network File System protocol(NFS). - -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AddressType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of address. """ - NONE = "None" #: Address type not known. - RESIDENTIAL = "Residential" #: Residential Address. - COMMERCIAL = "Commercial" #: Commercial Address. + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" -class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AddressValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" -class ClassDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ClassDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" -class CopyStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CopyStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + +class DataAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of the account. """ - STORAGE_ACCOUNT = "StorageAccount" #: Storage Accounts . - MANAGED_DISK = "ManagedDisk" #: Azure Managed disk storage. + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" -class DoubleEncryption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DoubleEncryption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines secondary layer of software-based encryption enablement. """ - ENABLED = "Enabled" #: Software-based encryption is enabled. - DISABLED = "Disabled" #: Software-based encryption is disabled. + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" -class FilterFileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class FilterFileType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" -class JobDeliveryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class JobDeliveryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Delivery type of Job. """ - NON_SCHEDULED = "NonScheduled" #: Non Scheduled job. - SCHEDULED = "Scheduled" #: Scheduled job. + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" -class KekType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KekType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" -class LogCollectionLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LogCollectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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). + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class NotificationStageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + +class OverallValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" -class ShareDestinationFormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ShareDestinationFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. - AZURE_PREMIUM_FILES = "AzurePremiumFiles" #: Azure storage Premium Files format. - -class SkuDisabledReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + +class SkuDisabledReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - DATA_BOX = "DataBox" #: Data Box. - DATA_BOX_DISK = "DataBoxDisk" #: Data Box Disk. - DATA_BOX_HEAVY = "DataBoxHeavy" #: Data Box Heavy. - -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + +class StageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + +class StageStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + +class TransferConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of the configuration for transfer. """ - TRANSFER_ALL = "TransferAll" #: Transfer all the data. - TRANSFER_USING_FILTER = "TransferUsingFilter" #: Transfer using filter. + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" -class TransferType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TransferType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of the transfer. """ - IMPORT_TO_AZURE = "ImportToAzure" #: Import data to azure. - EXPORT_FROM_AZURE = "ExportFromAzure" #: Export data from azure. + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" -class TransportShipmentTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TransportShipmentTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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. + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" -class ValidationInputDiscriminator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ValidationInputDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + +class ValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Create order limit validation status. """ - VALID = "Valid" #: Validation is successful. - INVALID = "Invalid" #: Validation is not successful. - SKIPPED = "Skipped" #: Validation is skipped. + #: Validation is successful. + VALID = "Valid" + #: Validation is not successful. + INVALID = "Invalid" + #: Validation is skipped. + SKIPPED = "Skipped" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models_py3.py index 133ebb9c5cd3..01c75aa727fc 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models_py3.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -24,12 +24,13 @@ class AccountCredentialDetails(msrest.serialization.Model): :vartype account_name: str :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.models.DataAccountType :ivar account_connection_string: Connection string of the account endpoint to use the account as a storage endpoint on the device. :vartype account_connection_string: str :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] + :vartype share_credential_details: + list[~azure.mgmt.databox.v2020_11_01.models.ShareCredentialDetails] """ _validation = { @@ -50,6 +51,8 @@ def __init__( self, **kwargs ): + """ + """ super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None self.data_account_type = None @@ -60,10 +63,10 @@ def __init__( class AdditionalErrorInfo(msrest.serialization.Model): """Additional error info. - :param type: Additional error type. - :type type: str - :param info: Additional error info. - :type info: object + :ivar type: Additional error type. + :vartype type: str + :ivar info: Additional error info. + :vartype info: any """ _attribute_map = { @@ -75,9 +78,15 @@ def __init__( self, *, type: Optional[str] = None, - info: Optional[object] = None, + info: Optional[Any] = None, **kwargs ): + """ + :keyword type: Additional error type. + :paramtype type: str + :keyword info: Additional error info. + :paramtype info: any + """ super(AdditionalErrorInfo, self).__init__(**kwargs) self.type = type self.info = info @@ -88,18 +97,20 @@ class AddressValidationOutput(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param validation_type: Identifies the type of validation response.Constant filled by server. + :ivar validation_type: Identifies the type of validation response.Constant filled by server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2020_11_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_11_01.models.ShippingAddress] """ _validation = { @@ -119,6 +130,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationOutput, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -136,13 +149,14 @@ class ValidationInputResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError """ _validation = { @@ -163,6 +177,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputResponse, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -175,18 +191,20 @@ class AddressValidationProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2020_11_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2020_11_01.models.ShippingAddress] """ _validation = { @@ -207,6 +225,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationProperties, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str self.validation_status = None @@ -218,8 +238,8 @@ class ApiError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. - :type error: ~azure.mgmt.databox.models.ErrorDetail + :ivar error: Required. + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.ErrorDetail """ _validation = { @@ -236,6 +256,10 @@ def __init__( error: "ErrorDetail", **kwargs ): + """ + :keyword error: Required. + :paramtype error: ~azure.mgmt.databox.v2020_11_01.models.ErrorDetail + """ super(ApiError, self).__init__(**kwargs) self.error = error @@ -265,6 +289,8 @@ def __init__( self, **kwargs ): + """ + """ super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None @@ -299,6 +325,8 @@ def __init__( self, **kwargs ): + """ + """ super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None @@ -310,17 +338,17 @@ class AvailableSkuRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :vartype location: str + :ivar sku_names: Sku Names to filter for available skus. + :vartype sku_names: list[str or ~azure.mgmt.databox.v2020_11_01.models.SkuName] """ _validation = { @@ -345,6 +373,19 @@ def __init__( sku_names: Optional[List[Union[str, "SkuName"]]] = None, **kwargs ): + """ + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + :keyword sku_names: Sku Names to filter for available skus. + :paramtype sku_names: list[str or ~azure.mgmt.databox.v2020_11_01.models.SkuName] + """ super(AvailableSkuRequest, self).__init__(**kwargs) self.transfer_type = transfer_type self.country = country @@ -358,9 +399,9 @@ class AvailableSkusResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2020_11_01.models.SkuInformation] + :ivar next_link: Link for the next set of skus. + :vartype next_link: str """ _validation = { @@ -378,6 +419,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of skus. + :paramtype next_link: str + """ super(AvailableSkusResult, self).__init__(**kwargs) self.value = None self.next_link = next_link @@ -386,12 +431,12 @@ def __init__( class AzureFileFilterDetails(msrest.serialization.Model): """Filter details to transfer Azure files. - :param file_prefix_list: Prefix list of the Azure files to be transferred. - :type file_prefix_list: list[str] - :param file_path_list: List of full path of the files to be transferred. - :type file_path_list: list[str] - :param file_share_list: List of file shares to be transferred. - :type file_share_list: list[str] + :ivar file_prefix_list: Prefix list of the Azure files to be transferred. + :vartype file_prefix_list: list[str] + :ivar file_path_list: List of full path of the files to be transferred. + :vartype file_path_list: list[str] + :ivar file_share_list: List of file shares to be transferred. + :vartype file_share_list: list[str] """ _attribute_map = { @@ -408,6 +453,14 @@ def __init__( file_share_list: Optional[List[str]] = None, **kwargs ): + """ + :keyword file_prefix_list: Prefix list of the Azure files to be transferred. + :paramtype file_prefix_list: list[str] + :keyword file_path_list: List of full path of the files to be transferred. + :paramtype file_path_list: list[str] + :keyword file_share_list: List of file shares to be transferred. + :paramtype file_share_list: list[str] + """ super(AzureFileFilterDetails, self).__init__(**kwargs) self.file_prefix_list = file_prefix_list self.file_path_list = file_path_list @@ -417,12 +470,12 @@ def __init__( class BlobFilterDetails(msrest.serialization.Model): """Filter details to transfer Azure Blobs. - :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :type blob_prefix_list: list[str] - :param blob_path_list: List of full path of the blobs to be transferred. - :type blob_path_list: list[str] - :param container_list: List of blob containers to be transferred. - :type container_list: list[str] + :ivar blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :vartype blob_prefix_list: list[str] + :ivar blob_path_list: List of full path of the blobs to be transferred. + :vartype blob_path_list: list[str] + :ivar container_list: List of blob containers to be transferred. + :vartype container_list: list[str] """ _attribute_map = { @@ -439,6 +492,14 @@ def __init__( container_list: Optional[List[str]] = None, **kwargs ): + """ + :keyword blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :paramtype blob_prefix_list: list[str] + :keyword blob_path_list: List of full path of the blobs to be transferred. + :paramtype blob_path_list: list[str] + :keyword container_list: List of blob containers to be transferred. + :paramtype container_list: list[str] + """ super(BlobFilterDetails, self).__init__(**kwargs) self.blob_prefix_list = blob_prefix_list self.blob_path_list = blob_path_list @@ -450,8 +511,8 @@ class CancellationReason(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Required. Reason for cancellation. + :vartype reason: str """ _validation = { @@ -468,6 +529,10 @@ def __init__( reason: str, **kwargs ): + """ + :keyword reason: Required. Reason for cancellation. + :paramtype reason: str + """ super(CancellationReason, self).__init__(**kwargs) self.reason = reason @@ -477,16 +542,16 @@ class CloudError(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: Cloud error code. - :type code: str - :param message: Cloud error message. - :type message: str - :param target: Cloud error target. - :type target: str + :ivar code: Cloud error code. + :vartype code: str + :ivar message: Cloud error message. + :vartype message: str + :ivar target: Cloud error target. + :vartype target: str :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.models.CloudError] + :vartype details: list[~azure.mgmt.databox.v2020_11_01.models.CloudError] :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.models.AdditionalErrorInfo] + :vartype additional_info: list[~azure.mgmt.databox.v2020_11_01.models.AdditionalErrorInfo] """ _validation = { @@ -510,6 +575,14 @@ def __init__( target: Optional[str] = None, **kwargs ): + """ + :keyword code: Cloud error code. + :paramtype code: str + :keyword message: Cloud error message. + :paramtype message: str + :keyword target: Cloud error target. + :paramtype target: str + """ super(CloudError, self).__init__(**kwargs) self.code = code self.message = message @@ -523,18 +596,19 @@ class ContactDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :ivar contact_name: Required. Contact name of the person. + :vartype contact_name: str + :ivar phone: Required. Phone number of the contact person. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: Required. List of Email-ids to be notified about job progress. + :vartype email_list: list[str] + :ivar notification_preference: Notification preference for a job stage. + :vartype notification_preference: + list[~azure.mgmt.databox.v2020_11_01.models.NotificationPreference] """ _validation = { @@ -563,6 +637,21 @@ def __init__( notification_preference: Optional[List["NotificationPreference"]] = None, **kwargs ): + """ + :keyword contact_name: Required. Contact name of the person. + :paramtype contact_name: str + :keyword phone: Required. Phone number of the contact person. + :paramtype phone: str + :keyword phone_extension: Phone extension number of the contact person. + :paramtype phone_extension: str + :keyword mobile: Mobile number of the contact person. + :paramtype mobile: str + :keyword email_list: Required. List of Email-ids to be notified about job progress. + :paramtype email_list: list[str] + :keyword notification_preference: Notification preference for a job stage. + :paramtype notification_preference: + list[~azure.mgmt.databox.v2020_11_01.models.NotificationPreference] + """ super(ContactDetails, self).__init__(**kwargs) self.contact_name = contact_name self.phone = phone @@ -580,9 +669,10 @@ class CopyLogDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator """ _validation = { @@ -601,6 +691,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] @@ -615,10 +707,10 @@ class CopyProgress(msrest.serialization.Model): :vartype storage_account_name: str :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.models.DataAccountType :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str :ivar bytes_processed: To indicate bytes transferred. @@ -689,6 +781,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None self.transfer_type = None @@ -715,12 +809,13 @@ class ValidationRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :vartype individual_request_details: + list[~azure.mgmt.databox.v2020_11_01.models.ValidationInputRequest] """ _validation = { @@ -743,6 +838,12 @@ def __init__( individual_request_details: List["ValidationInputRequest"], **kwargs ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2020_11_01.models.ValidationInputRequest] + """ super(ValidationRequest, self).__init__(**kwargs) self.validation_category = None # type: Optional[str] self.individual_request_details = individual_request_details @@ -753,12 +854,13 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :vartype individual_request_details: + list[~azure.mgmt.databox.v2020_11_01.models.ValidationInputRequest] """ _validation = { @@ -777,6 +879,12 @@ def __init__( individual_request_details: List["ValidationInputRequest"], **kwargs ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2020_11_01.models.ValidationInputRequest] + """ super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) self.validation_category = 'JobCreationValidation' # type: str @@ -789,11 +897,12 @@ class ValidationInputRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator """ _validation = { @@ -812,6 +921,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputRequest, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] @@ -821,14 +932,15 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName """ _validation = { @@ -847,6 +959,11 @@ def __init__( device_type: Union[str, "SkuName"], **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + """ super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str self.device_type = device_type @@ -859,16 +976,17 @@ class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInpu All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError :ivar status: Create order limit validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.ValidationStatus """ _validation = { @@ -887,6 +1005,8 @@ def __init__( self, **kwargs ): + """ + """ super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str self.status = None @@ -900,16 +1020,16 @@ class DataAccountDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str + :vartype share_password: str """ _validation = { @@ -931,6 +1051,15 @@ def __init__( share_password: Optional[str] = None, **kwargs ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + """ super(DataAccountDetails, self).__init__(**kwargs) self.data_account_type = None # type: Optional[str] self.share_password = share_password @@ -943,9 +1072,10 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -973,6 +1103,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBox' # type: str self.account_name = None @@ -987,9 +1119,10 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -1016,6 +1149,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None @@ -1037,7 +1172,7 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.CopyStatus """ _validation = { @@ -1058,6 +1193,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -1076,35 +1213,35 @@ class JobDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2020_11_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2020_11_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int """ _validation = { @@ -1116,7 +1253,6 @@ class JobDetails(msrest.serialization.Model): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, } _attribute_map = { @@ -1133,7 +1269,7 @@ class JobDetails(msrest.serialization.Model): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, } _subtype_map = { @@ -1148,9 +1284,27 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, data_export_details: Optional[List["DataExportDetails"]] = None, preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, **kwargs ): + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ super(JobDetails, self).__init__(**kwargs) self.job_stages = None self.contact_details = contact_details @@ -1164,8 +1318,8 @@ def __init__( self.copy_log_details = None self.reverse_shipment_label_sas_key = None self.chain_of_custody_sas_key = None - self.key_encryption_key = None - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes + self.key_encryption_key = key_encryption_key + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes class DataBoxDiskJobDetails(JobDetails): @@ -1176,46 +1330,46 @@ class DataBoxDiskJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2020_11_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2020_11_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :vartype expected_data_size_in_tera_bytes: int + :ivar preferred_disks: User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :vartype copy_progress: list[~azure.mgmt.databox.v2020_11_01.models.DataBoxDiskCopyProgress] :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str + :ivar passkey: User entered passkey for DataBox Disk job. + :vartype passkey: str """ _validation = { @@ -1227,7 +1381,6 @@ class DataBoxDiskJobDetails(JobDetails): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, 'copy_progress': {'readonly': True}, 'disks_and_size_details': {'readonly': True}, } @@ -1246,7 +1399,7 @@ class DataBoxDiskJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, @@ -1261,12 +1414,36 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, data_export_details: Optional[List["DataExportDetails"]] = None, preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, preferred_disks: Optional[Dict[str, int]] = None, passkey: Optional[str] = None, **kwargs ): - super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. + :paramtype preferred_disks: dict[str, int] + :keyword passkey: User entered passkey for DataBox Disk job. + :paramtype passkey: str + """ + super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBoxDisk' # type: str self.preferred_disks = preferred_disks self.copy_progress = None @@ -1284,13 +1461,13 @@ class JobSecrets(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_11_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError """ _validation = { @@ -1313,6 +1490,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobSecrets, self).__init__(**kwargs) self.job_secrets_type = None # type: Optional[str] self.dc_access_security_code = None @@ -1326,15 +1505,15 @@ class DataBoxDiskJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_11_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~azure.mgmt.databox.v2020_11_01.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -1363,6 +1542,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None @@ -1377,9 +1558,10 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -1407,6 +1589,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None @@ -1422,44 +1606,44 @@ class DataBoxHeavyJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2020_11_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2020_11_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + :vartype copy_progress: list[~azure.mgmt.databox.v2020_11_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox Heavy. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str + :vartype device_password: str """ _validation = { @@ -1471,7 +1655,6 @@ class DataBoxHeavyJobDetails(JobDetails): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, 'copy_progress': {'readonly': True}, } @@ -1489,7 +1672,7 @@ class DataBoxHeavyJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } @@ -1502,11 +1685,36 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, data_export_details: Optional[List["DataExportDetails"]] = None, preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, device_password: Optional[str] = None, **kwargs ): - super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None self.device_password = device_password @@ -1519,15 +1727,15 @@ class DataBoxHeavyJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_11_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2020_11_01.models.DataBoxHeavySecret] """ _validation = { @@ -1548,6 +1756,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None @@ -1563,12 +1773,14 @@ class DataBoxHeavySecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2020_11_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2020_11_01.models.AccountCredentialDetails] """ _validation = { @@ -1591,6 +1803,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1607,44 +1821,44 @@ class DataBoxJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2020_11_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2020_11_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2020_11_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. Should not be passed for + :vartype copy_progress: list[~azure.mgmt.databox.v2020_11_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str + :vartype device_password: str """ _validation = { @@ -1656,7 +1870,6 @@ class DataBoxJobDetails(JobDetails): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, 'copy_progress': {'readonly': True}, } @@ -1674,7 +1887,7 @@ class DataBoxJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } @@ -1687,11 +1900,36 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, data_export_details: Optional[List["DataExportDetails"]] = None, preferences: Optional["Preferences"] = None, - expected_data_size_in_terabytes: Optional[int] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, device_password: Optional[str] = None, **kwargs ): - super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, expected_data_size_in_terabytes=expected_data_size_in_terabytes, **kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2020_11_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBox' # type: str self.copy_progress = None self.device_password = device_password @@ -1704,15 +1942,15 @@ class DataboxJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2020_11_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2020_11_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError + :ivar pod_secrets: Contains the list of secret objects for a job. + :vartype pod_secrets: list[~azure.mgmt.databox.v2020_11_01.models.DataBoxSecret] """ _validation = { @@ -1734,6 +1972,10 @@ def __init__( pod_secrets: Optional[List["DataBoxSecret"]] = None, **kwargs ): + """ + :keyword pod_secrets: Contains the list of secret objects for a job. + :paramtype pod_secrets: list[~azure.mgmt.databox.v2020_11_01.models.DataBoxSecret] + """ super(DataboxJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBox' # type: str self.pod_secrets = pod_secrets @@ -1747,14 +1989,14 @@ class ScheduleAvailabilityRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -1779,6 +2021,13 @@ def __init__( country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ super(ScheduleAvailabilityRequest, self).__init__(**kwargs) self.storage_location = storage_location self.sku_name = None # type: Optional[str] @@ -1790,14 +2039,14 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -1818,6 +2067,13 @@ def __init__( country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBox' # type: str @@ -1832,12 +2088,14 @@ class DataBoxSecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2020_11_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2020_11_01.models.AccountCredentialDetails] """ _validation = { @@ -1860,6 +2118,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1873,13 +2133,13 @@ class DataExportDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_configuration: Required. Configuration for the data transfer. - :type transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :param log_collection_level: Level of the logs to be collected. Possible values include: - "Error", "Verbose". - :type log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :ivar transfer_configuration: Required. Configuration for the data transfer. + :vartype transfer_configuration: ~azure.mgmt.databox.v2020_11_01.models.TransferConfiguration + :ivar log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". Default value: "Error". + :vartype log_collection_level: str or ~azure.mgmt.databox.v2020_11_01.models.LogCollectionLevel + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2020_11_01.models.DataAccountDetails """ _validation = { @@ -1898,9 +2158,19 @@ def __init__( *, transfer_configuration: "TransferConfiguration", account_details: "DataAccountDetails", - log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = None, + log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = "Error", **kwargs ): + """ + :keyword transfer_configuration: Required. Configuration for the data transfer. + :paramtype transfer_configuration: ~azure.mgmt.databox.v2020_11_01.models.TransferConfiguration + :keyword log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". Default value: "Error". + :paramtype log_collection_level: str or + ~azure.mgmt.databox.v2020_11_01.models.LogCollectionLevel + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2020_11_01.models.DataAccountDetails + """ super(DataExportDetails, self).__init__(**kwargs) self.transfer_configuration = transfer_configuration self.log_collection_level = log_collection_level @@ -1912,8 +2182,8 @@ class DataImportDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2020_11_01.models.DataAccountDetails """ _validation = { @@ -1930,6 +2200,10 @@ def __init__( account_details: "DataAccountDetails", **kwargs ): + """ + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2020_11_01.models.DataAccountDetails + """ super(DataImportDetails, self).__init__(**kwargs) self.account_details = account_details @@ -1959,6 +2233,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataLocationToServiceLocationMap, self).__init__(**kwargs) self.data_location = None self.service_location = None @@ -1969,21 +2245,22 @@ class DataTransferDetailsValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param data_export_details: List of DataTransfer details to be used to export data from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param data_import_details: List of DataTransfer details to be used to import data to azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator + :ivar data_export_details: List of DataTransfer details to be used to export data from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :ivar data_import_details: List of DataTransfer details to be used to import data to azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :ivar device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType """ _validation = { @@ -2009,6 +2286,19 @@ def __init__( data_import_details: Optional[List["DataImportDetails"]] = None, **kwargs ): + """ + :keyword data_export_details: List of DataTransfer details to be used to export data from + azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2020_11_01.models.DataExportDetails] + :keyword data_import_details: List of DataTransfer details to be used to import data to azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2020_11_01.models.DataImportDetails] + :keyword device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType + """ super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateDataTransferDetails' # type: str self.data_export_details = data_export_details @@ -2024,16 +2314,17 @@ class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError :ivar status: Data transfer details validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.ValidationStatus """ _validation = { @@ -2052,6 +2343,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateDataTransferDetails' # type: str self.status = None @@ -2060,15 +2353,15 @@ def __init__( class DcAccessSecurityCode(msrest.serialization.Model): """Dc access security code. - :param reverse_dc_access_code: Reverse Dc access security code. - :type reverse_dc_access_code: str - :param forward_dc_access_code: Forward Dc access security code. - :type forward_dc_access_code: str + :ivar reverse_dc_access_code: Reverse Dc access security code. + :vartype reverse_dc_access_code: str + :ivar forward_dc_access_code: Forward Dc access security code. + :vartype forward_dc_access_code: str """ _attribute_map = { - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, + 'reverse_dc_access_code': {'key': 'reverseDCAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDCAccessCode', 'type': 'str'}, } def __init__( @@ -2078,6 +2371,12 @@ def __init__( forward_dc_access_code: Optional[str] = None, **kwargs ): + """ + :keyword reverse_dc_access_code: Reverse Dc access security code. + :paramtype reverse_dc_access_code: str + :keyword forward_dc_access_code: Forward Dc access security code. + :paramtype forward_dc_access_code: str + """ super(DcAccessSecurityCode, self).__init__(**kwargs) self.reverse_dc_access_code = reverse_dc_access_code self.forward_dc_access_code = forward_dc_access_code @@ -2088,10 +2387,10 @@ class Details(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str """ _validation = { @@ -2111,6 +2410,12 @@ def __init__( message: str, **kwargs ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + """ super(Details, self).__init__(**kwargs) self.code = code self.message = message @@ -2121,43 +2426,53 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int """ _validation = { 'storage_location': {'required': True}, 'sku_name': {'required': True}, - 'expected_data_size_in_terabytes': {'required': True}, + 'expected_data_size_in_tera_bytes': {'required': True}, } _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, } def __init__( self, *, storage_location: str, - expected_data_size_in_terabytes: int, + expected_data_size_in_tera_bytes: int, country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + :keyword expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs + to be transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = expected_data_size_in_terabytes + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes class DiskSecret(msrest.serialization.Model): @@ -2186,6 +2501,8 @@ def __init__( self, **kwargs ): + """ + """ super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None @@ -2194,9 +2511,9 @@ def __init__( class EncryptionPreferences(msrest.serialization.Model): """Preferences related to the Encryption. - :param double_encryption: Defines secondary layer of software-based encryption enablement. - Possible values include: "Enabled", "Disabled". - :type double_encryption: str or ~azure.mgmt.databox.models.DoubleEncryption + :ivar double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :vartype double_encryption: str or ~azure.mgmt.databox.v2020_11_01.models.DoubleEncryption """ _attribute_map = { @@ -2206,9 +2523,14 @@ class EncryptionPreferences(msrest.serialization.Model): def __init__( self, *, - double_encryption: Optional[Union[str, "DoubleEncryption"]] = None, + double_encryption: Optional[Union[str, "DoubleEncryption"]] = "Disabled", **kwargs ): + """ + :keyword double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :paramtype double_encryption: str or ~azure.mgmt.databox.v2020_11_01.models.DoubleEncryption + """ super(EncryptionPreferences, self).__init__(**kwargs) self.double_encryption = double_encryption @@ -2218,14 +2540,14 @@ class ErrorDetail(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str - :param details: - :type details: list[~azure.mgmt.databox.models.Details] - :param target: - :type target: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar details: + :vartype details: list[~azure.mgmt.databox.v2020_11_01.models.Details] + :ivar target: + :vartype target: str """ _validation = { @@ -2249,6 +2571,16 @@ def __init__( target: Optional[str] = None, **kwargs ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + :keyword details: + :paramtype details: list[~azure.mgmt.databox.v2020_11_01.models.Details] + :keyword target: + :paramtype target: str + """ super(ErrorDetail, self).__init__(**kwargs) self.code = code self.message = message @@ -2261,12 +2593,12 @@ class FilterFileDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param filter_file_type: Required. Type of the filter file. Possible values include: + :ivar filter_file_type: Required. Type of the filter file. Possible values include: "AzureBlob", "AzureFile". - :type filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :param filter_file_path: Required. Path of the file that contains the details of all items to + :vartype filter_file_type: str or ~azure.mgmt.databox.v2020_11_01.models.FilterFileType + :ivar filter_file_path: Required. Path of the file that contains the details of all items to transfer. - :type filter_file_path: str + :vartype filter_file_path: str """ _validation = { @@ -2286,6 +2618,14 @@ def __init__( filter_file_path: str, **kwargs ): + """ + :keyword filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :paramtype filter_file_type: str or ~azure.mgmt.databox.v2020_11_01.models.FilterFileType + :keyword filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :paramtype filter_file_path: str + """ super(FilterFileDetails, self).__init__(**kwargs) self.filter_file_type = filter_file_type self.filter_file_path = filter_file_path @@ -2296,14 +2636,14 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -2324,6 +2664,13 @@ def __init__( country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBoxHeavy' # type: str @@ -2331,10 +2678,10 @@ def __init__( class IdentityProperties(msrest.serialization.Model): """Managed identity properties. - :param type: Managed service identity type. - :type type: str - :param user_assigned: User assigned identity properties. - :type user_assigned: ~azure.mgmt.databox.models.UserAssignedProperties + :ivar type: Managed service identity type. + :vartype type: str + :ivar user_assigned: User assigned identity properties. + :vartype user_assigned: ~azure.mgmt.databox.v2020_11_01.models.UserAssignedProperties """ _attribute_map = { @@ -2349,6 +2696,12 @@ def __init__( user_assigned: Optional["UserAssignedProperties"] = None, **kwargs ): + """ + :keyword type: Managed service identity type. + :paramtype type: str + :keyword user_assigned: User assigned identity properties. + :paramtype user_assigned: ~azure.mgmt.databox.v2020_11_01.models.UserAssignedProperties + """ super(IdentityProperties, self).__init__(**kwargs) self.type = type self.user_assigned = user_assigned @@ -2357,8 +2710,8 @@ def __init__( class JobDeliveryInfo(msrest.serialization.Model): """Additional delivery info. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime """ _attribute_map = { @@ -2371,6 +2724,10 @@ def __init__( scheduled_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword scheduled_date_time: Scheduled date time. + :paramtype scheduled_date_time: ~datetime.datetime + """ super(JobDeliveryInfo, self).__init__(**kwargs) self.scheduled_date_time = scheduled_date_time @@ -2380,18 +2737,18 @@ class Resource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2020_11_01.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2020_11_01.models.ResourceIdentity """ _validation = { @@ -2415,6 +2772,20 @@ def __init__( identity: Optional["ResourceIdentity"] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2020_11_01.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2020_11_01.models.ResourceIdentity + """ super(Resource, self).__init__(**kwargs) self.location = location self.tags = tags @@ -2429,27 +2800,29 @@ class JobResource(Resource): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2020_11_01.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2020_11_01.models.ResourceIdentity :ivar name: Name of the object. :vartype name: str :ivar id: Id of the object. :vartype id: str :ivar type: Type of the object. :vartype type: str - :param transfer_type: Required. Type of the data transfer. Possible values include: + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.databox.v2020_11_01.models.SystemData + :ivar transfer_type: Required. Type of the data transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType :ivar is_cancellable: Describes whether the job is cancellable or not. :vartype is_cancellable: bool :ivar is_deletable: Describes whether the job is deletable or not. @@ -2463,20 +2836,20 @@ class JobResource(Resource): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.models.StageName + :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.StageName :ivar start_time: Time at which the job was started in UTC ISO 8601 format. :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError + :ivar details: Details of a job run. This field will only be sent for expand details filter. + :vartype details: ~azure.mgmt.databox.v2020_11_01.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo + :ivar delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :vartype delivery_type: str or ~azure.mgmt.databox.v2020_11_01.models.JobDeliveryType + :ivar delivery_info: Delivery Info of Job. + :vartype delivery_info: ~azure.mgmt.databox.v2020_11_01.models.JobDeliveryInfo :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. :vartype is_cancellable_without_fee: bool """ @@ -2487,6 +2860,7 @@ class JobResource(Resource): 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'transfer_type': {'required': True}, 'is_cancellable': {'readonly': True}, 'is_deletable': {'readonly': True}, @@ -2507,6 +2881,7 @@ class JobResource(Resource): 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'transfer_type': {'key': 'properties.transferType', 'type': 'str'}, 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, @@ -2531,14 +2906,39 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["ResourceIdentity"] = None, details: Optional["JobDetails"] = None, - delivery_type: Optional[Union[str, "JobDeliveryType"]] = None, + delivery_type: Optional[Union[str, "JobDeliveryType"]] = "NonScheduled", delivery_info: Optional["JobDeliveryInfo"] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2020_11_01.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2020_11_01.models.ResourceIdentity + :keyword transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType + :keyword details: Details of a job run. This field will only be sent for expand details filter. + :paramtype details: ~azure.mgmt.databox.v2020_11_01.models.JobDetails + :keyword delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :paramtype delivery_type: str or ~azure.mgmt.databox.v2020_11_01.models.JobDeliveryType + :keyword delivery_info: Delivery Info of Job. + :paramtype delivery_info: ~azure.mgmt.databox.v2020_11_01.models.JobDeliveryInfo + """ super(JobResource, self).__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) self.name = None self.id = None self.type = None + self.system_data = None self.transfer_type = transfer_type self.is_cancellable = None self.is_deletable = None @@ -2557,10 +2957,10 @@ def __init__( class JobResourceList(msrest.serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :ivar value: List of job resources. + :vartype value: list[~azure.mgmt.databox.v2020_11_01.models.JobResource] + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str """ _attribute_map = { @@ -2575,6 +2975,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of job resources. + :paramtype value: list[~azure.mgmt.databox.v2020_11_01.models.JobResource] + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ super(JobResourceList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -2583,13 +2989,13 @@ def __init__( class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails + :vartype tags: dict[str, str] + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2020_11_01.models.ResourceIdentity + :ivar details: Details of a job to be updated. + :vartype details: ~azure.mgmt.databox.v2020_11_01.models.UpdateJobDetails """ _attribute_map = { @@ -2606,6 +3012,15 @@ def __init__( details: Optional["UpdateJobDetails"] = None, **kwargs ): + """ + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2020_11_01.models.ResourceIdentity + :keyword details: Details of a job to be updated. + :paramtype details: ~azure.mgmt.databox.v2020_11_01.models.UpdateJobDetails + """ super(JobResourceUpdateParameter, self).__init__(**kwargs) self.tags = tags self.identity = identity @@ -2622,17 +3037,17 @@ class JobStages(msrest.serialization.Model): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :vartype stage_name: str or ~azure.mgmt.databox.v2020_11_01.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", "WaitingForCustomerAction", "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :vartype stage_status: str or ~azure.mgmt.databox.v2020_11_01.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. :vartype stage_time: ~datetime.datetime :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object + :vartype job_stage_details: any """ _validation = { @@ -2655,6 +3070,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None @@ -2668,16 +3085,16 @@ class KeyEncryptionKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kek_type: Required. Type of encryption key used for key encryption. Possible values - include: "MicrosoftManaged", "CustomerManaged". - :type kek_type: str or ~azure.mgmt.databox.models.KekType - :param identity_properties: Managed identity properties used for key encryption. - :type identity_properties: ~azure.mgmt.databox.models.IdentityProperties - :param kek_url: Key encryption key. It is required in case of Customer managed KekType. - :type kek_url: str - :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + :ivar kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :vartype kek_type: str or ~azure.mgmt.databox.v2020_11_01.models.KekType + :ivar identity_properties: Managed identity properties used for key encryption. + :vartype identity_properties: ~azure.mgmt.databox.v2020_11_01.models.IdentityProperties + :ivar kek_url: Key encryption key. It is required in case of Customer managed KekType. + :vartype kek_url: str + :ivar kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed KekType. - :type kek_vault_resource_id: str + :vartype kek_vault_resource_id: str """ _validation = { @@ -2694,12 +3111,24 @@ class KeyEncryptionKey(msrest.serialization.Model): def __init__( self, *, - kek_type: Union[str, "KekType"], + kek_type: Union[str, "KekType"] = "MicrosoftManaged", identity_properties: Optional["IdentityProperties"] = None, kek_url: Optional[str] = None, kek_vault_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :paramtype kek_type: str or ~azure.mgmt.databox.v2020_11_01.models.KekType + :keyword identity_properties: Managed identity properties used for key encryption. + :paramtype identity_properties: ~azure.mgmt.databox.v2020_11_01.models.IdentityProperties + :keyword kek_url: Key encryption key. It is required in case of Customer managed KekType. + :paramtype kek_url: str + :keyword kek_vault_resource_id: Kek vault resource id. It is required in case of Customer + managed KekType. + :paramtype kek_vault_resource_id: str + """ super(KeyEncryptionKey, self).__init__(**kwargs) self.kek_type = kek_type self.identity_properties = identity_properties @@ -2712,21 +3141,21 @@ class ManagedDiskDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param resource_group_id: Required. Resource Group Id of the compute disks. - :type resource_group_id: str - :param staging_storage_account_id: Required. Resource Id of the storage account that can be - used to copy the vhd for staging. - :type staging_storage_account_id: str + :vartype share_password: str + :ivar resource_group_id: Required. Resource Group Id of the compute disks. + :vartype resource_group_id: str + :ivar staging_storage_account_id: Required. Resource Id of the storage account that can be used + to copy the vhd for staging. + :vartype staging_storage_account_id: str """ _validation = { @@ -2750,6 +3179,20 @@ def __init__( share_password: Optional[str] = None, **kwargs ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword resource_group_id: Required. Resource Group Id of the compute disks. + :paramtype resource_group_id: str + :keyword staging_storage_account_id: Required. Resource Id of the storage account that can be + used to copy the vhd for staging. + :paramtype staging_storage_account_id: str + """ super(ManagedDiskDetails, self).__init__(share_password=share_password, **kwargs) self.data_account_type = 'ManagedDisk' # type: str self.resource_group_id = resource_group_id @@ -2761,11 +3204,11 @@ class NotificationPreference(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + :ivar stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :vartype stage_name: str or ~azure.mgmt.databox.v2020_11_01.models.NotificationStageName + :ivar send_notification: Required. Notification is required or not. + :vartype send_notification: bool """ _validation = { @@ -2782,9 +3225,16 @@ def __init__( self, *, stage_name: Union[str, "NotificationStageName"], - send_notification: bool, + send_notification: bool = True, **kwargs ): + """ + :keyword stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :paramtype stage_name: str or ~azure.mgmt.databox.v2020_11_01.models.NotificationStageName + :keyword send_notification: Required. Notification is required or not. + :paramtype send_notification: bool + """ super(NotificationPreference, self).__init__(**kwargs) self.stage_name = stage_name self.send_notification = send_notification @@ -2799,13 +3249,13 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2020_11_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :vartype properties: any :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool """ _validation = { @@ -2829,6 +3279,10 @@ def __init__( is_data_action: Optional[bool] = None, **kwargs ): + """ + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + """ super(Operation, self).__init__(**kwargs) self.name = None self.display = None @@ -2840,14 +3294,14 @@ def __init__( class OperationDisplay(msrest.serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :ivar provider: Provider name. + :vartype provider: str + :ivar resource: Resource name. + :vartype resource: str + :ivar operation: Localized name of the operation for display purpose. + :vartype operation: str + :ivar description: Localized description of the operation for display purpose. + :vartype description: str """ _attribute_map = { @@ -2866,6 +3320,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Provider name. + :paramtype provider: str + :keyword resource: Resource name. + :paramtype resource: str + :keyword operation: Localized name of the operation for display purpose. + :paramtype operation: str + :keyword description: Localized description of the operation for display purpose. + :paramtype description: str + """ super(OperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -2879,9 +3343,9 @@ class OperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2020_11_01.models.Operation] + :ivar next_link: Link for the next set of operations. + :vartype next_link: str """ _validation = { @@ -2899,6 +3363,10 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of operations. + :paramtype next_link: str + """ super(OperationList, self).__init__(**kwargs) self.value = None self.next_link = next_link @@ -2933,6 +3401,8 @@ def __init__( self, **kwargs ): + """ + """ super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None @@ -2942,12 +3412,12 @@ def __init__( class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred data center region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :param encryption_preferences: Preferences related to the Encryption. - :type encryption_preferences: ~azure.mgmt.databox.models.EncryptionPreferences + :ivar preferred_data_center_region: Preferred data center region. + :vartype preferred_data_center_region: list[str] + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2020_11_01.models.TransportPreferences + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: ~azure.mgmt.databox.v2020_11_01.models.EncryptionPreferences """ _attribute_map = { @@ -2964,6 +3434,14 @@ def __init__( encryption_preferences: Optional["EncryptionPreferences"] = None, **kwargs ): + """ + :keyword preferred_data_center_region: Preferred data center region. + :paramtype preferred_data_center_region: list[str] + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2020_11_01.models.TransportPreferences + :keyword encryption_preferences: Preferences related to the Encryption. + :paramtype encryption_preferences: ~azure.mgmt.databox.v2020_11_01.models.EncryptionPreferences + """ super(Preferences, self).__init__(**kwargs) self.preferred_data_center_region = preferred_data_center_region self.transport_preferences = transport_preferences @@ -2975,16 +3453,17 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference of transport and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator + :ivar preference: Preference of transport and data center. + :vartype preference: ~azure.mgmt.databox.v2020_11_01.models.Preferences + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName """ _validation = { @@ -3005,6 +3484,13 @@ def __init__( preference: Optional["Preferences"] = None, **kwargs ): + """ + :keyword preference: Preference of transport and data center. + :paramtype preference: ~azure.mgmt.databox.v2020_11_01.models.Preferences + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + """ super(PreferencesValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str self.preference = preference @@ -3018,16 +3504,17 @@ class PreferencesValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError :ivar status: Validation status of requested data center and transport. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.ValidationStatus """ _validation = { @@ -3046,6 +3533,8 @@ def __init__( self, **kwargs ): + """ + """ super(PreferencesValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str self.status = None @@ -3054,12 +3543,14 @@ def __init__( class RegionConfigurationRequest(msrest.serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability for scheduling + :ivar schedule_availability_request: Request body to get the availability for scheduling orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given + :vartype schedule_availability_request: + ~azure.mgmt.databox.v2020_11_01.models.ScheduleAvailabilityRequest + :ivar transport_availability_request: Request body to get the transport availability for given sku. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest + :vartype transport_availability_request: + ~azure.mgmt.databox.v2020_11_01.models.TransportAvailabilityRequest """ _attribute_map = { @@ -3074,6 +3565,16 @@ def __init__( transport_availability_request: Optional["TransportAvailabilityRequest"] = None, **kwargs ): + """ + :keyword schedule_availability_request: Request body to get the availability for scheduling + orders. + :paramtype schedule_availability_request: + ~azure.mgmt.databox.v2020_11_01.models.ScheduleAvailabilityRequest + :keyword transport_availability_request: Request body to get the transport availability for + given sku. + :paramtype transport_availability_request: + ~azure.mgmt.databox.v2020_11_01.models.TransportAvailabilityRequest + """ super(RegionConfigurationRequest, self).__init__(**kwargs) self.schedule_availability_request = schedule_availability_request self.transport_availability_request = transport_availability_request @@ -3086,10 +3587,10 @@ class RegionConfigurationResponse(msrest.serialization.Model): :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse + ~azure.mgmt.databox.v2020_11_01.models.ScheduleAvailabilityResponse :ivar transport_availability_response: Transport options available for given sku in a region. :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse + ~azure.mgmt.databox.v2020_11_01.models.TransportAvailabilityResponse """ _validation = { @@ -3106,6 +3607,8 @@ def __init__( self, **kwargs ): + """ + """ super(RegionConfigurationResponse, self).__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None @@ -3116,14 +3619,15 @@ class ResourceIdentity(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param type: Identity type. - :type type: str + :ivar type: Identity type. + :vartype type: str :ivar principal_id: Service Principal Id backing the Msi. :vartype principal_id: str :ivar tenant_id: Home Tenant Id. :vartype tenant_id: str - :param user_assigned_identities: User Assigned Identities. - :type user_assigned_identities: dict[str, ~azure.mgmt.databox.models.UserAssignedIdentity] + :ivar user_assigned_identities: User Assigned Identities. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.databox.v2020_11_01.models.UserAssignedIdentity] """ _validation = { @@ -3141,10 +3645,17 @@ class ResourceIdentity(msrest.serialization.Model): def __init__( self, *, - type: Optional[str] = None, + type: Optional[str] = "None", user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, **kwargs ): + """ + :keyword type: Identity type. + :paramtype type: str + :keyword user_assigned_identities: User Assigned Identities. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.databox.v2020_11_01.models.UserAssignedIdentity] + """ super(ResourceIdentity, self).__init__(**kwargs) self.type = type self.principal_id = None @@ -3173,6 +3684,8 @@ def __init__( self, **kwargs ): + """ + """ super(ScheduleAvailabilityResponse, self).__init__(**kwargs) self.available_dates = None @@ -3185,14 +3698,15 @@ class ShareCredentialDetails(msrest.serialization.Model): :ivar share_name: Name of the share. :vartype share_name: str :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk", "AzurePremiumFiles". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". + :vartype share_type: str or ~azure.mgmt.databox.v2020_11_01.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] + :vartype supported_access_protocols: list[str or + ~azure.mgmt.databox.v2020_11_01.models.AccessProtocol] """ _validation = { @@ -3215,6 +3729,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -3228,14 +3744,14 @@ class ShipmentPickUpRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be + :ivar start_time: Required. Minimum date after which the pick up should commence, this must be in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be + :vartype start_time: ~datetime.datetime + :ivar end_time: Required. Maximum date before which the pick up should commence, this must be in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :vartype end_time: ~datetime.datetime + :ivar shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :vartype shipment_location: str """ _validation = { @@ -3258,6 +3774,16 @@ def __init__( shipment_location: str, **kwargs ): + """ + :keyword start_time: Required. Minimum date after which the pick up should commence, this must + be in local time of pick up area. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Required. Maximum date before which the pick up should commence, this must + be in local time of pick up area. + :paramtype end_time: ~datetime.datetime + :keyword shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :paramtype shipment_location: str + """ super(ShipmentPickUpRequest, self).__init__(**kwargs) self.start_time = start_time self.end_time = end_time @@ -3290,6 +3816,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None @@ -3300,27 +3828,27 @@ class ShippingAddress(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :ivar street_address1: Required. Street Address line 1. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: Required. Name of the Country. + :vartype country: str + :ivar postal_code: Postal code. + :vartype postal_code: str + :ivar zip_extended_code: Extended Zip Code. + :vartype zip_extended_code: str + :ivar company_name: Name of the company. + :vartype company_name: str + :ivar address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :vartype address_type: str or ~azure.mgmt.databox.v2020_11_01.models.AddressType """ _validation = { @@ -3353,9 +3881,32 @@ def __init__( postal_code: Optional[str] = None, zip_extended_code: Optional[str] = None, company_name: Optional[str] = None, - address_type: Optional[Union[str, "AddressType"]] = None, + address_type: Optional[Union[str, "AddressType"]] = "None", **kwargs ): + """ + :keyword street_address1: Required. Street Address line 1. + :paramtype street_address1: str + :keyword street_address2: Street Address line 2. + :paramtype street_address2: str + :keyword street_address3: Street Address line 3. + :paramtype street_address3: str + :keyword city: Name of the City. + :paramtype city: str + :keyword state_or_province: Name of the State or Province. + :paramtype state_or_province: str + :keyword country: Required. Name of the Country. + :paramtype country: str + :keyword postal_code: Postal code. + :paramtype postal_code: str + :keyword zip_extended_code: Extended Zip Code. + :paramtype zip_extended_code: str + :keyword company_name: Name of the company. + :paramtype company_name: str + :keyword address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :paramtype address_type: str or ~azure.mgmt.databox.v2020_11_01.models.AddressType + """ super(ShippingAddress, self).__init__(**kwargs) self.street_address1 = street_address1 self.street_address2 = street_address2 @@ -3374,13 +3925,13 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :vartype name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :ivar display_name: The display name of the sku. + :vartype display_name: str + :ivar family: The sku family. + :vartype family: str """ _validation = { @@ -3401,6 +3952,15 @@ def __init__( family: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :keyword display_name: The display name of the sku. + :paramtype display_name: str + :keyword family: The sku family. + :paramtype family: str + """ super(Sku, self).__init__(**kwargs) self.name = name self.display_name = display_name @@ -3412,23 +3972,24 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :vartype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str + :vartype location: str """ _validation = { @@ -3456,6 +4017,20 @@ def __init__( location: str, **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + """ super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str self.device_type = device_type @@ -3471,16 +4046,17 @@ class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.ValidationStatus """ _validation = { @@ -3499,6 +4075,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str self.status = None @@ -3529,6 +4107,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None @@ -3565,6 +4145,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None @@ -3577,21 +4159,21 @@ class SkuInformation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~azure.mgmt.databox.v2020_11_01.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool :ivar data_location_to_service_location_map: The map of data location to service location. :vartype data_location_to_service_location_map: - list[~azure.mgmt.databox.models.DataLocationToServiceLocationMap] + list[~azure.mgmt.databox.v2020_11_01.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2020_11_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~azure.mgmt.databox.v2020_11_01.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :vartype disabled_reason: str or ~azure.mgmt.databox.v2020_11_01.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -3626,6 +4208,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None @@ -3643,18 +4227,18 @@ class StorageAccountDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param storage_account_id: Required. Storage Account Resource Id. - :type storage_account_id: str + :vartype share_password: str + :ivar storage_account_id: Required. Storage Account Resource Id. + :vartype storage_account_id: str """ _validation = { @@ -3675,6 +4259,17 @@ def __init__( share_password: Optional[str] = None, **kwargs ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword storage_account_id: Required. Storage Account Resource Id. + :paramtype storage_account_id: str + """ super(StorageAccountDetails, self).__init__(share_password=share_password, **kwargs) self.data_account_type = 'StorageAccount' # type: str self.storage_account_id = storage_account_id @@ -3685,11 +4280,12 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator """ _validation = { @@ -3704,6 +4300,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str @@ -3715,16 +4313,17 @@ class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInp All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2020_11_01.models.CloudError :ivar status: Validation status of subscription permission to create job. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.ValidationStatus """ _validation = { @@ -3743,23 +4342,79 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str self.status = None +class SystemData(msrest.serialization.Model): + """Provides details about resource creation and update time. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_by: A string identifier for the identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource: user, application, + managedIdentity. + :vartype created_by_type: str + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: A string identifier for the identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource: user, + application, managedIdentity. + :vartype last_modified_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None + + class TransferAllDetails(msrest.serialization.Model): """Details to transfer all data. All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: + :ivar data_account_type: Required. Type of the account of data. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :type transfer_all_blobs: bool - :param transfer_all_files: To indicate if all Azure Files have to be transferred. - :type transfer_all_files: bool + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.models.DataAccountType + :ivar transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :vartype transfer_all_blobs: bool + :ivar transfer_all_files: To indicate if all Azure Files have to be transferred. + :vartype transfer_all_files: bool """ _validation = { @@ -3780,6 +4435,15 @@ def __init__( transfer_all_files: Optional[bool] = None, **kwargs ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.models.DataAccountType + :keyword transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :paramtype transfer_all_blobs: bool + :keyword transfer_all_files: To indicate if all Azure Files have to be transferred. + :paramtype transfer_all_files: bool + """ super(TransferAllDetails, self).__init__(**kwargs) self.data_account_type = data_account_type self.transfer_all_blobs = transfer_all_blobs @@ -3791,16 +4455,18 @@ class TransferConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible + :ivar transfer_configuration_type: Required. Type of the configuration for transfer. Possible values include: "TransferAll", "TransferUsingFilter". - :type transfer_configuration_type: str or ~azure.mgmt.databox.models.TransferConfigurationType - :param transfer_filter_details: Map of filter type and the details to filter. This field is + :vartype transfer_configuration_type: str or + ~azure.mgmt.databox.v2020_11_01.models.TransferConfigurationType + :ivar transfer_filter_details: Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - :type transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :param transfer_all_details: Map of filter type and the details to transfer all data. This - field is required only if the TransferConfigurationType is given as TransferAll. - :type transfer_all_details: ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails + :vartype transfer_filter_details: + ~azure.mgmt.databox.v2020_11_01.models.TransferConfigurationTransferFilterDetails + :ivar transfer_all_details: Map of filter type and the details to transfer all data. This field + is required only if the TransferConfigurationType is given as TransferAll. + :vartype transfer_all_details: + ~azure.mgmt.databox.v2020_11_01.models.TransferConfigurationTransferAllDetails """ _validation = { @@ -3821,6 +4487,20 @@ def __init__( transfer_all_details: Optional["TransferConfigurationTransferAllDetails"] = None, **kwargs ): + """ + :keyword transfer_configuration_type: Required. Type of the configuration for transfer. + Possible values include: "TransferAll", "TransferUsingFilter". + :paramtype transfer_configuration_type: str or + ~azure.mgmt.databox.v2020_11_01.models.TransferConfigurationType + :keyword transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :paramtype transfer_filter_details: + ~azure.mgmt.databox.v2020_11_01.models.TransferConfigurationTransferFilterDetails + :keyword transfer_all_details: Map of filter type and the details to transfer all data. This + field is required only if the TransferConfigurationType is given as TransferAll. + :paramtype transfer_all_details: + ~azure.mgmt.databox.v2020_11_01.models.TransferConfigurationTransferAllDetails + """ super(TransferConfiguration, self).__init__(**kwargs) self.transfer_configuration_type = transfer_configuration_type self.transfer_filter_details = transfer_filter_details @@ -3830,8 +4510,8 @@ def __init__( class TransferConfigurationTransferAllDetails(msrest.serialization.Model): """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. - :param include: Details to transfer all data. - :type include: ~azure.mgmt.databox.models.TransferAllDetails + :ivar include: Details to transfer all data. + :vartype include: ~azure.mgmt.databox.v2020_11_01.models.TransferAllDetails """ _attribute_map = { @@ -3844,6 +4524,10 @@ def __init__( include: Optional["TransferAllDetails"] = None, **kwargs ): + """ + :keyword include: Details to transfer all data. + :paramtype include: ~azure.mgmt.databox.v2020_11_01.models.TransferAllDetails + """ super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) self.include = include @@ -3851,8 +4535,8 @@ def __init__( class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - :param include: Details of the filtering the transfer of data. - :type include: ~azure.mgmt.databox.models.TransferFilterDetails + :ivar include: Details of the filtering the transfer of data. + :vartype include: ~azure.mgmt.databox.v2020_11_01.models.TransferFilterDetails """ _attribute_map = { @@ -3865,6 +4549,10 @@ def __init__( include: Optional["TransferFilterDetails"] = None, **kwargs ): + """ + :keyword include: Details of the filtering the transfer of data. + :paramtype include: ~azure.mgmt.databox.v2020_11_01.models.TransferFilterDetails + """ super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) self.include = include @@ -3874,15 +4562,16 @@ class TransferFilterDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: + :ivar data_account_type: Required. Type of the account of data. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param blob_filter_details: Filter details to transfer blobs. - :type blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :param azure_file_filter_details: Filter details to transfer Azure files. - :type azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :param filter_file_details: Details of the filter files to be used for data transfer. - :type filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] + :vartype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.models.DataAccountType + :ivar blob_filter_details: Filter details to transfer blobs. + :vartype blob_filter_details: ~azure.mgmt.databox.v2020_11_01.models.BlobFilterDetails + :ivar azure_file_filter_details: Filter details to transfer Azure files. + :vartype azure_file_filter_details: + ~azure.mgmt.databox.v2020_11_01.models.AzureFileFilterDetails + :ivar filter_file_details: Details of the filter files to be used for data transfer. + :vartype filter_file_details: list[~azure.mgmt.databox.v2020_11_01.models.FilterFileDetails] """ _validation = { @@ -3905,6 +4594,18 @@ def __init__( filter_file_details: Optional[List["FilterFileDetails"]] = None, **kwargs ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or ~azure.mgmt.databox.v2020_11_01.models.DataAccountType + :keyword blob_filter_details: Filter details to transfer blobs. + :paramtype blob_filter_details: ~azure.mgmt.databox.v2020_11_01.models.BlobFilterDetails + :keyword azure_file_filter_details: Filter details to transfer Azure files. + :paramtype azure_file_filter_details: + ~azure.mgmt.databox.v2020_11_01.models.AzureFileFilterDetails + :keyword filter_file_details: Details of the filter files to be used for data transfer. + :paramtype filter_file_details: list[~azure.mgmt.databox.v2020_11_01.models.FilterFileDetails] + """ super(TransferFilterDetails, self).__init__(**kwargs) self.data_account_type = data_account_type self.blob_filter_details = blob_filter_details @@ -3919,7 +4620,7 @@ class TransportAvailabilityDetails(msrest.serialization.Model): :ivar shipment_type: Transport Shipment Type supported for given region. Possible values include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype shipment_type: str or ~azure.mgmt.databox.v2020_11_01.models.TransportShipmentTypes """ _validation = { @@ -3934,6 +4635,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityDetails, self).__init__(**kwargs) self.shipment_type = None @@ -3941,9 +4644,9 @@ def __init__( class TransportAvailabilityRequest(msrest.serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + :ivar sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName """ _attribute_map = { @@ -3956,6 +4659,11 @@ def __init__( sku_name: Optional[Union[str, "SkuName"]] = None, **kwargs ): + """ + :keyword sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype sku_name: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + """ super(TransportAvailabilityRequest, self).__init__(**kwargs) self.sku_name = sku_name @@ -3967,7 +4675,7 @@ class TransportAvailabilityResponse(msrest.serialization.Model): :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~azure.mgmt.databox.v2020_11_01.models.TransportAvailabilityDetails] """ _validation = { @@ -3982,6 +4690,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityResponse, self).__init__(**kwargs) self.transport_availability_details = None @@ -3991,9 +4701,10 @@ class TransportPreferences(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + :ivar preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype preferred_shipment_type: str or + ~azure.mgmt.databox.v2020_11_01.models.TransportShipmentTypes """ _validation = { @@ -4010,6 +4721,12 @@ def __init__( preferred_shipment_type: Union[str, "TransportShipmentTypes"], **kwargs ): + """ + :keyword preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :paramtype preferred_shipment_type: str or + ~azure.mgmt.databox.v2020_11_01.models.TransportShipmentTypes + """ super(TransportPreferences, self).__init__(**kwargs) self.preferred_shipment_type = preferred_shipment_type @@ -4022,7 +4739,7 @@ class UnencryptedCredentials(msrest.serialization.Model): :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2020_11_01.models.JobSecrets """ _validation = { @@ -4039,6 +4756,8 @@ def __init__( self, **kwargs ): + """ + """ super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None @@ -4047,10 +4766,10 @@ def __init__( class UnencryptedCredentialsList(msrest.serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :ivar value: List of unencrypted credentials. + :vartype value: list[~azure.mgmt.databox.v2020_11_01.models.UnencryptedCredentials] + :ivar next_link: Link for the next set of unencrypted credentials. + :vartype next_link: str """ _attribute_map = { @@ -4065,6 +4784,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of unencrypted credentials. + :paramtype value: list[~azure.mgmt.databox.v2020_11_01.models.UnencryptedCredentials] + :keyword next_link: Link for the next set of unencrypted credentials. + :paramtype next_link: str + """ super(UnencryptedCredentialsList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -4073,12 +4798,12 @@ def __init__( class UpdateJobDetails(msrest.serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param key_encryption_key: Key encryption key for the job. - :type key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar contact_details: Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress + :ivar key_encryption_key: Key encryption key for the job. + :vartype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey """ _attribute_map = { @@ -4095,6 +4820,14 @@ def __init__( key_encryption_key: Optional["KeyEncryptionKey"] = None, **kwargs ): + """ + :keyword contact_details: Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2020_11_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress + :keyword key_encryption_key: Key encryption key for the job. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2020_11_01.models.KeyEncryptionKey + """ super(UpdateJobDetails, self).__init__(**kwargs) self.contact_details = contact_details self.shipping_address = shipping_address @@ -4126,6 +4859,8 @@ def __init__( self, **kwargs ): + """ + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -4134,8 +4869,8 @@ def __init__( class UserAssignedProperties(msrest.serialization.Model): """User assigned identity properties. - :param resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. - :type resource_id: str + :ivar resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :vartype resource_id: str """ _attribute_map = { @@ -4148,6 +4883,10 @@ def __init__( resource_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :paramtype resource_id: str + """ super(UserAssignedProperties, self).__init__(**kwargs) self.resource_id = resource_id @@ -4157,18 +4896,19 @@ class ValidateAddress(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2020_11_01.models.ValidationInputDiscriminator + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :vartype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2020_11_01.models.TransportPreferences """ _validation = { @@ -4192,6 +4932,15 @@ def __init__( transport_preferences: Optional["TransportPreferences"] = None, **kwargs ): + """ + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2020_11_01.models.ShippingAddress + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2020_11_01.models.SkuName + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2020_11_01.models.TransportPreferences + """ super(ValidateAddress, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str self.shipping_address = shipping_address @@ -4206,10 +4955,11 @@ class ValidationResponse(msrest.serialization.Model): :ivar status: Overall validation status. Possible values include: "AllValidToProceed", "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2020_11_01.models.OverallValidationStatus :ivar individual_response_details: List of response details contain validationType and its response as key and value respectively. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] + :vartype individual_response_details: + list[~azure.mgmt.databox.v2020_11_01.models.ValidationInputResponse] """ _validation = { @@ -4226,6 +4976,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationResponse, self).__init__(**kwargs) self.status = None self.individual_response_details = None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_jobs_operations.py index 5f8d902f7a40..70be60c2256f 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_jobs_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_jobs_operations.py @@ -5,25 +5,388 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_book_shipment_pick_up_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_credentials_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class JobsOperations(object): """JobsOperations operations. @@ -32,7 +395,7 @@ class JobsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_11_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -47,12 +410,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: """Lists all the jobs available under the subscription. :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in @@ -60,7 +423,7 @@ def list( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -68,36 +431,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,24 +468,25 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobResourceList"] + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: """Lists all the jobs available under the given resource group. :param resource_group_name: The Resource Group Name. @@ -137,7 +496,7 @@ def list_by_resource_group( :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.JobResourceList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.models.JobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] @@ -145,37 +504,33 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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('JobResourceList', pipeline_response) + deserialized = self._deserialize("JobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -188,25 +543,26 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - job_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.JobResource" + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": """Gets information about the specified job. :param resource_group_name: The Resource Group Name. @@ -219,7 +575,7 @@ def get( :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobResource, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.JobResource + :rtype: ~azure.mgmt.databox.v2020_11_01.models.JobResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] @@ -227,35 +583,24 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('JobResource', pipeline_response) @@ -264,54 +609,44 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + def _create_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource, 'JobResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -321,16 +656,18 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_create( self, - resource_group_name, # type: str - job_name, # type: str - job_resource, # type: "_models.JobResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: """Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. @@ -340,18 +677,22 @@ def begin_create( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource: Job details from request body. - :type job_resource: ~azure.mgmt.databox.models.JobResource + :type job_resource: ~azure.mgmt.databox.v2020_11_01.models.JobResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_11_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -363,27 +704,21 @@ def begin_create( resource_group_name=resource_group_name, job_name=job_name, job_resource=job_resource, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -395,61 +730,51 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _delete_initial( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes a job. :param resource_group_name: The Resource Group Name. @@ -459,15 +784,17 @@ def begin_delete( :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -481,21 +808,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -507,57 +827,45 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore def _update_initial( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -567,17 +875,19 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace def begin_update( self, - resource_group_name, # type: str - job_name, # type: str - job_resource_update_parameter, # type: "_models.JobResourceUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.JobResource"] + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: """Updates the properties of an existing job. :param resource_group_name: The Resource Group Name. @@ -586,21 +896,26 @@ def begin_update( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param job_resource_update_parameter: Job update parameters from request body. - :type job_resource_update_parameter: ~azure.mgmt.databox.models.JobResourceUpdateParameter + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2020_11_01.models.JobResourceUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either JobResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.models.JobResource] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2020_11_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -613,27 +928,21 @@ def begin_update( job_name=job_name, job_resource_update_parameter=job_resource_update_parameter, if_match=if_match, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('JobResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -645,16 +954,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + @distributed_trace def book_shipment_pick_up( self, - resource_group_name, # type: str - job_name, # type: str - shipment_pick_up_request, # type: "_models.ShipmentPickUpRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ShipmentPickUpResponse" + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": """Book shipment pick up. :param resource_group_name: The Resource Group Name. @@ -663,10 +973,10 @@ def book_shipment_pick_up( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param shipment_pick_up_request: Details of shipment pick up request. - :type shipment_pick_up_request: ~azure.mgmt.databox.models.ShipmentPickUpRequest + :type shipment_pick_up_request: ~azure.mgmt.databox.v2020_11_01.models.ShipmentPickUpRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ShipmentPickUpResponse, or the result of cls(response) - :rtype: ~azure.mgmt.databox.models.ShipmentPickUpResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.ShipmentPickUpResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] @@ -674,38 +984,28 @@ def book_shipment_pick_up( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.book_shipment_pick_up.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) @@ -714,16 +1014,18 @@ def book_shipment_pick_up( return cls(pipeline_response, deserialized, {}) return deserialized + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + @distributed_trace def cancel( self, - resource_group_name, # type: str - job_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: """CancelJob. :param resource_group_name: The Resource Group Name. @@ -732,7 +1034,7 @@ def cancel( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.databox.models.CancellationReason + :type cancellation_reason: ~azure.mgmt.databox.v2020_11_01.models.CancellationReason :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 @@ -743,38 +1045,28 @@ def cancel( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(cancellation_reason, 'CancellationReason') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cancellation_reason, 'CancellationReason') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -782,13 +1074,14 @@ def cancel( cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + @distributed_trace def list_credentials( self, - resource_group_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UnencryptedCredentialsList"] + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentialsList"]: """This method gets the unencrypted secrets related to the job. :param resource_group_name: The Resource Group Name. @@ -797,8 +1090,10 @@ def list_credentials( must be between 3 and 24 characters in length and use any alphanumeric and underscore only. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UnencryptedCredentialsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.UnencryptedCredentialsList] + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.models.UnencryptedCredentialsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] @@ -806,36 +1101,33 @@ def list_credentials( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_credentials.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.post(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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('UnencryptedCredentialsList', pipeline_response) + deserialized = self._deserialize("UnencryptedCredentialsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -848,12 +1140,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_operations.py index 42d935a9c74e..d2439bcc5d71 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_operations.py @@ -5,23 +5,50 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +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: + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.DataBox/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -30,7 +57,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_11_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,16 +72,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationList"] + **kwargs: Any + ) -> Iterable["_models.OperationList"]: """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 OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.OperationList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -62,30 +89,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + 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) + deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,12 +122,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_service_operations.py index 0d52bed1577f..faa82a1ff825 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_service_operations.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/operations/_service_operations.py @@ -5,23 +5,284 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_available_skus_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_address_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ServiceOperations(object): """ServiceOperations operations. @@ -30,7 +291,7 @@ class ServiceOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.databox.models + :type models: ~azure.mgmt.databox.v2020_11_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,14 +306,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_available_skus_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - available_sku_request, # type: "_models.AvailableSkuRequest" - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AvailableSkusResult"] + resource_group_name: str, + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> Iterable["_models.AvailableSkusResult"]: """This method provides the list of available skus for the given subscription, resource group and location. @@ -61,55 +322,53 @@ def list_available_skus_by_resource_group( :param location: The location of the resource. :type location: str :param available_sku_request: Filters for showing the available skus. - :type available_sku_request: ~azure.mgmt.databox.models.AvailableSkuRequest + :type available_sku_request: ~azure.mgmt.databox.v2020_11_01.models.AvailableSkuRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.models.AvailableSkusResult] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2020_11_01.models.AvailableSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = "application/json" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_available_skus_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(available_sku_request, 'AvailableSkuRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + deserialized = self._deserialize("AvailableSkusResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,34 +381,35 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ApiError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + @distributed_trace def validate_address( self, - location, # type: str - validate_address, # type: "_models.ValidateAddress" - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressValidationOutput" + location: str, + validate_address: "_models.ValidateAddress", + **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. :type location: str :param validate_address: Shipping address of the customer. - :type validate_address: ~azure.mgmt.databox.models.ValidateAddress + :type validate_address: ~azure.mgmt.databox.v2020_11_01.models.ValidateAddress :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.models.AddressValidationOutput + :rtype: ~azure.mgmt.databox.v2020_11_01.models.AddressValidationOutput :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] @@ -157,37 +417,27 @@ def validate_address( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_address.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(validate_address, 'ValidateAddress') + + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validate_address, 'ValidateAddress') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AddressValidationOutput', pipeline_response) @@ -196,16 +446,18 @@ def validate_address( return cls(pipeline_response, deserialized, {}) return deserialized + validate_address.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'} # type: ignore + + @distributed_trace def validate_inputs_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + resource_group_name: str, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under resource group. :param resource_group_name: The Resource Group Name. @@ -213,10 +465,10 @@ def validate_inputs_by_resource_group( :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2020_11_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -224,38 +476,28 @@ def validate_inputs_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidationResponse', pipeline_response) @@ -264,24 +506,26 @@ def validate_inputs_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace def validate_inputs( self, - location, # type: str - validation_request, # type: "_models.ValidationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ValidationResponse" + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": """This method does all necessary pre-job creation validation under subscription. :param location: The location of the resource. :type location: str :param validation_request: Inputs of the customer. - :type validation_request: ~azure.mgmt.databox.models.ValidationRequest + :type validation_request: ~azure.mgmt.databox.v2020_11_01.models.ValidationRequest :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.models.ValidationResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.ValidationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] @@ -289,37 +533,27 @@ def validate_inputs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.validate_inputs.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(validation_request, 'ValidationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ValidationResponse', pipeline_response) @@ -328,25 +562,28 @@ def validate_inputs( return cls(pipeline_response, deserialized, {}) return deserialized + validate_inputs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs'} # type: ignore + + @distributed_trace def region_configuration( self, - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location at Subscription level. :param location: The location of the resource. :type location: str :param region_configuration_request: Request body to get the configuration for the region. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -354,37 +591,27 @@ def region_configuration( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) @@ -393,16 +620,18 @@ def region_configuration( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + + @distributed_trace def region_configuration_by_resource_group( self, - resource_group_name, # type: str - location, # type: str - region_configuration_request, # type: "_models.RegionConfigurationRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.RegionConfigurationResponse" + resource_group_name: str, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": """This API provides configuration details specific to given region/location at Resource group level. @@ -412,10 +641,11 @@ def region_configuration_by_resource_group( :type location: str :param region_configuration_request: Request body to get the configuration for the region at resource group level. - :type region_configuration_request: ~azure.mgmt.databox.models.RegionConfigurationRequest + :type region_configuration_request: + ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationRequest :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.models.RegionConfigurationResponse + :rtype: ~azure.mgmt.databox.v2020_11_01.models.RegionConfigurationResponse :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] @@ -423,38 +653,28 @@ def region_configuration_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.region_configuration_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **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) - error = self._deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) @@ -463,4 +683,6 @@ def region_configuration_by_resource_group( return cls(pipeline_response, deserialized, {}) return deserialized + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/__init__.py new file mode 100644 index 000000000000..72afe00aa0a1 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/__init__.py @@ -0,0 +1,18 @@ +# 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 +__all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_configuration.py new file mode 100644 index 000000000000..8eae775d37e3 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_configuration.py @@ -0,0 +1,68 @@ +# 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): + """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. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + 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 = "2021-03-01" + 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 # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_data_box_management_client.py new file mode 100644 index 000000000000..e6640ab62390 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_data_box_management_client.py @@ -0,0 +1,99 @@ +# 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, Optional, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +from . import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): + """The DataBox Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databox.v2021_03_01.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databox.v2021_03_01.operations.JobsOperations + :ivar service: ServiceOperations operations + :vartype service: azure.mgmt.databox.v2021_03_01.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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(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, # type: 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/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_metadata.json new file mode 100644 index 000000000000..474cb264ecac --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_metadata.json @@ -0,0 +1,122 @@ +{ + "chosen_version": "2021-03-01", + "total_api_version_list": ["2021-03-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": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The Subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The Subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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" + }, + "operation_mixins": { + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "operations": { + "mitigate" : { + "sync": { + "signature": "def mitigate(\n self,\n job_name, # type: str\n resource_group_name, # type: str\n mitigate_job_request, # type: \"_models.MitigateJobRequest\"\n **kwargs # type: Any\n):\n # type: (...) -\u003e None\n", + "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n:type job_name: str\n:param resource_group_name: The Resource Group Name.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def mitigate(\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: \"_models.MitigateJobRequest\",\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n:type job_name: str\n:param resource_group_name: The Resource Group Name.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "job_name, resource_group_name, mitigate_job_request" + } + } + } +} \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/_version.py @@ -0,0 +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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/__init__.py new file mode 100644 index 000000000000..c57c5574bdd0 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/__init__.py @@ -0,0 +1,15 @@ +# 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 +__all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_configuration.py new file mode 100644 index 000000000000..d8b81f86a466 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class DataBoxManagementClientConfiguration(Configuration): + """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. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + 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 = "2021-03-01" + 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) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_data_box_management_client.py new file mode 100644 index 000000000000..b299dfe86f0e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_data_box_management_client.py @@ -0,0 +1,96 @@ +# 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, Optional, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from .. import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): + """The DataBox Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databox.v2021_03_01.aio.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databox.v2021_03_01.aio.operations.JobsOperations + :ivar service: ServiceOperations operations + :vartype service: azure.mgmt.databox.v2021_03_01.aio.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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(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/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/__init__.py new file mode 100644 index 000000000000..bd13cc67afb6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._jobs_operations import JobsOperations +from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin +from ._service_operations import ServiceOperations + +__all__ = [ + 'Operations', + 'JobsOperations', + 'DataBoxManagementClientOperationsMixin', + 'ServiceOperations', +] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_data_box_management_client_operations.py new file mode 100644 index 000000000000..8bb592703ada --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_data_box_management_client_operations.py @@ -0,0 +1,82 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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_async import distributed_trace_async +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 +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DataBoxManagementClientOperationsMixin: + + @distributed_trace_async + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: "_models.MitigateJobRequest", + **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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. + :type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(mitigate_job_request, 'MitigateJobRequest') + + request = build_mitigate_request( + job_name=job_name, + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + content_type=content_type, + json=_json, + template_url=self.mitigate.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + 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'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_jobs_operations.py new file mode 100644 index 000000000000..3eb07db6a8c0 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_jobs_operations.py @@ -0,0 +1,793 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +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.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._jobs_operations import build_book_shipment_pick_up_request, build_cancel_request, build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_credentials_request, build_list_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_03_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.JobResourceList"]: + """Lists all the jobs available under the subscription. + + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.JobResourceList"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": + """Gets information about the specified job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_03_01.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + async def _create_initial( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.JobResource"]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource: Job details from request body. + :type job_resource: ~azure.mgmt.databox.v2021_03_01.models.JobResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_03_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller["_models.JobResource"]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2021_03_01.models.JobResourceUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_03_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + if_match=if_match, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. + :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_03_01.models.ShipmentPickUpRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_03_01.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + + @distributed_trace_async + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param cancellation_reason: Reason for cancellation. + :type cancellation_reason: ~azure.mgmt.databox.v2021_03_01.models.CancellationReason + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + + @distributed_trace + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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("UnencryptedCredentialsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_operations.py new file mode 100644 index 000000000000..ed83f3e0cf28 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_operations.py @@ -0,0 +1,110 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.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: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_03_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationList"]: + """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 OperationList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_service_operations.py new file mode 100644 index 000000000000..951eb72e2fef --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/aio/operations/_service_operations.py @@ -0,0 +1,428 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.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, 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: + """ServiceOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_03_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> AsyncIterable["_models.AvailableSkusResult"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param available_sku_request: Filters for showing the available skus. + :type available_sku_request: ~azure.mgmt.databox.v2021_03_01.models.AvailableSkuRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_03_01.models.AvailableSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + @distributed_trace_async + async def validate_address( + self, + location: str, + validate_address: "_models.ValidateAddress", + **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. + :type location: str + :param validate_address: Shipping address of the customer. + :type validate_address: ~azure.mgmt.databox.v2021_03_01.models.ValidateAddress + :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.v2021_03_01.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') + + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_03_01.models.ValidationRequest + :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.v2021_03_01.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def validate_inputs( + self, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_03_01.models.ValidationRequest + :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.v2021_03_01.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def region_configuration( + self, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationRequest + :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.v2021_03_01.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationRequest + :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.v2021_03_01.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/__init__.py new file mode 100644 index 000000000000..d03afb65c2d7 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/__init__.py @@ -0,0 +1,273 @@ +# 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 EncryptionPreferences +from ._models_py3 import ErrorDetail +from ._models_py3 import FilterFileDetails +from ._models_py3 import HeavyScheduleAvailabilityRequest +from ._models_py3 import IdentityProperties +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 LastMitigationActionOnJob +from ._models_py3 import ManagedDiskDetails +from ._models_py3 import MitigateJobRequest +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 SystemData +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 UserAssignedIdentity +from ._models_py3 import UserAssignedProperties +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, + AddressType, + AddressValidationStatus, + ClassDiscriminator, + CopyStatus, + CustomerResolutionCode, + DataAccountType, + DoubleEncryption, + FilterFileType, + JobDeliveryType, + KekType, + LogCollectionLevel, + NotificationStageName, + OverallValidationStatus, + ShareDestinationFormatType, + SkuDisabledReason, + SkuName, + StageName, + StageStatus, + TransferConfigurationType, + TransferType, + TransportShipmentTypes, + ValidationInputDiscriminator, + ValidationStatus, +) + +__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', + 'EncryptionPreferences', + 'ErrorDetail', + 'FilterFileDetails', + 'HeavyScheduleAvailabilityRequest', + 'IdentityProperties', + 'JobDeliveryInfo', + 'JobDetails', + 'JobResource', + 'JobResourceList', + 'JobResourceUpdateParameter', + 'JobSecrets', + 'JobStages', + 'KeyEncryptionKey', + 'LastMitigationActionOnJob', + 'ManagedDiskDetails', + 'MitigateJobRequest', + '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', + 'SystemData', + 'TransferAllDetails', + 'TransferConfiguration', + 'TransferConfigurationTransferAllDetails', + 'TransferConfigurationTransferFilterDetails', + 'TransferFilterDetails', + 'TransportAvailabilityDetails', + 'TransportAvailabilityRequest', + 'TransportAvailabilityResponse', + 'TransportPreferences', + 'UnencryptedCredentials', + 'UnencryptedCredentialsList', + 'UpdateJobDetails', + 'UserAssignedIdentity', + 'UserAssignedProperties', + 'ValidateAddress', + 'ValidationInputRequest', + 'ValidationInputResponse', + 'ValidationRequest', + 'ValidationResponse', + 'AccessProtocol', + 'AddressType', + 'AddressValidationStatus', + 'ClassDiscriminator', + 'CopyStatus', + 'CustomerResolutionCode', + 'DataAccountType', + 'DoubleEncryption', + 'FilterFileType', + 'JobDeliveryType', + 'KekType', + 'LogCollectionLevel', + 'NotificationStageName', + 'OverallValidationStatus', + 'ShareDestinationFormatType', + 'SkuDisabledReason', + 'SkuName', + 'StageName', + 'StageStatus', + 'TransferConfigurationType', + 'TransferType', + 'TransportShipmentTypes', + 'ValidationInputDiscriminator', + 'ValidationStatus', +] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_data_box_management_client_enums.py new file mode 100644 index 000000000000..56fdb6e95a58 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_data_box_management_client_enums.py @@ -0,0 +1,329 @@ +# 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 six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class AccessProtocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + +class AddressType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of address. + """ + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + +class AddressValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The address validation status. + """ + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + +class ClassDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the type of job details. + """ + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + +class CopyStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The Status of the copy + """ + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + +class CustomerResolutionCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: No Resolution Yet. + NONE = "None" + #: Clean the device. + MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" + #: Resume the job to same stage. + RESUME = "Resume" + +class DataAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the account. + """ + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + +class DoubleEncryption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Defines secondary layer of software-based encryption enablement. + """ + + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" + +class FilterFileType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the filter file. + """ + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + +class JobDeliveryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Delivery type of Job. + """ + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + +class KekType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of encryption key used for key encryption. + """ + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + +class LogCollectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Level of the logs to be collected. + """ + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + +class NotificationStageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage. + """ + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + +class OverallValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Overall validation status. + """ + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + +class ShareDestinationFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the share. + """ + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + +class SkuDisabledReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Reason why the Sku is disabled. + """ + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + +class StageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage which is in progress. + """ + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + +class StageStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Status of the job stage. + """ + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + +class TransferConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the configuration for transfer. + """ + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + +class TransferType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the transfer. + """ + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + +class TransportShipmentTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Transport Shipment Type supported for given region. + """ + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + +class ValidationInputDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Identifies the type of validation request. + """ + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + +class ValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Create order limit validation status. + """ + + #: Validation is successful. + VALID = "Valid" + #: Validation is not successful. + INVALID = "Invalid" + #: Validation is skipped. + SKIPPED = "Skipped" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_models_py3.py similarity index 52% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_models_py3.py index 4da1571b91cc..bd6b4547ff2c 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/models/_models.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/models/_models_py3.py @@ -6,9 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime +from typing import Any, Dict, List, Optional, Union + from azure.core.exceptions import HttpResponseError import msrest.serialization +from ._data_box_management_client_enums import * + class AccountCredentialDetails(msrest.serialization.Model): """Credential details of the account. @@ -19,12 +24,13 @@ class AccountCredentialDetails(msrest.serialization.Model): :vartype account_name: str :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.models.DataAccountType :ivar account_connection_string: Connection string of the account endpoint to use the account as a storage endpoint on the device. :vartype account_connection_string: str :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] + :vartype share_credential_details: + list[~azure.mgmt.databox.v2021_03_01.models.ShareCredentialDetails] """ _validation = { @@ -45,6 +51,8 @@ def __init__( self, **kwargs ): + """ + """ super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None self.data_account_type = None @@ -55,10 +63,10 @@ def __init__( class AdditionalErrorInfo(msrest.serialization.Model): """Additional error info. - :param type: Additional error type. - :type type: str - :param info: Additional error info. - :type info: object + :ivar type: Additional error type. + :vartype type: str + :ivar info: Additional error info. + :vartype info: any """ _attribute_map = { @@ -68,11 +76,20 @@ class AdditionalErrorInfo(msrest.serialization.Model): def __init__( self, + *, + type: Optional[str] = None, + info: Optional[Any] = None, **kwargs ): + """ + :keyword type: Additional error type. + :paramtype type: str + :keyword info: Additional error info. + :paramtype info: any + """ super(AdditionalErrorInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.info = kwargs.get('info', None) + self.type = type + self.info = info class AddressValidationOutput(msrest.serialization.Model): @@ -80,18 +97,20 @@ class AddressValidationOutput(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param validation_type: Identifies the type of validation response.Constant filled by server. + :ivar validation_type: Identifies the type of validation response.Constant filled by server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2021_03_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_03_01.models.ShippingAddress] """ _validation = { @@ -111,6 +130,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationOutput, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -128,13 +149,14 @@ class ValidationInputResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError """ _validation = { @@ -155,6 +177,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputResponse, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -167,18 +191,20 @@ class AddressValidationProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2021_03_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_03_01.models.ShippingAddress] """ _validation = { @@ -199,6 +225,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationProperties, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str self.validation_status = None @@ -210,8 +238,8 @@ class ApiError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. - :type error: ~azure.mgmt.databox.models.ErrorDetail + :ivar error: Required. + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.ErrorDetail """ _validation = { @@ -224,10 +252,16 @@ class ApiError(msrest.serialization.Model): def __init__( self, + *, + error: "ErrorDetail", **kwargs ): + """ + :keyword error: Required. + :paramtype error: ~azure.mgmt.databox.v2021_03_01.models.ErrorDetail + """ super(ApiError, self).__init__(**kwargs) - self.error = kwargs['error'] + self.error = error class ApplianceNetworkConfiguration(msrest.serialization.Model): @@ -255,6 +289,8 @@ def __init__( self, **kwargs ): + """ + """ super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None @@ -289,6 +325,8 @@ def __init__( self, **kwargs ): + """ + """ super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None @@ -300,17 +338,17 @@ class AvailableSkuRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :vartype location: str + :ivar sku_names: Sku Names to filter for available skus. + :vartype sku_names: list[str or ~azure.mgmt.databox.v2021_03_01.models.SkuName] """ _validation = { @@ -328,13 +366,31 @@ class AvailableSkuRequest(msrest.serialization.Model): def __init__( self, + *, + transfer_type: Union[str, "TransferType"], + country: str, + location: str, + sku_names: Optional[List[Union[str, "SkuName"]]] = None, **kwargs ): + """ + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + :keyword sku_names: Sku Names to filter for available skus. + :paramtype sku_names: list[str or ~azure.mgmt.databox.v2021_03_01.models.SkuName] + """ super(AvailableSkuRequest, self).__init__(**kwargs) - self.transfer_type = kwargs['transfer_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] - self.sku_names = kwargs.get('sku_names', None) + self.transfer_type = transfer_type + self.country = country + self.location = location + self.sku_names = sku_names class AvailableSkusResult(msrest.serialization.Model): @@ -343,9 +399,9 @@ class AvailableSkusResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2021_03_01.models.SkuInformation] + :ivar next_link: Link for the next set of skus. + :vartype next_link: str """ _validation = { @@ -359,22 +415,28 @@ class AvailableSkusResult(msrest.serialization.Model): def __init__( self, + *, + next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of skus. + :paramtype next_link: str + """ super(AvailableSkusResult, self).__init__(**kwargs) self.value = None - self.next_link = kwargs.get('next_link', None) + self.next_link = next_link class AzureFileFilterDetails(msrest.serialization.Model): """Filter details to transfer Azure files. - :param file_prefix_list: Prefix list of the Azure files to be transferred. - :type file_prefix_list: list[str] - :param file_path_list: List of full path of the files to be transferred. - :type file_path_list: list[str] - :param file_share_list: List of file shares to be transferred. - :type file_share_list: list[str] + :ivar file_prefix_list: Prefix list of the Azure files to be transferred. + :vartype file_prefix_list: list[str] + :ivar file_path_list: List of full path of the files to be transferred. + :vartype file_path_list: list[str] + :ivar file_share_list: List of file shares to be transferred. + :vartype file_share_list: list[str] """ _attribute_map = { @@ -385,23 +447,35 @@ class AzureFileFilterDetails(msrest.serialization.Model): def __init__( self, + *, + file_prefix_list: Optional[List[str]] = None, + file_path_list: Optional[List[str]] = None, + file_share_list: Optional[List[str]] = None, **kwargs ): + """ + :keyword file_prefix_list: Prefix list of the Azure files to be transferred. + :paramtype file_prefix_list: list[str] + :keyword file_path_list: List of full path of the files to be transferred. + :paramtype file_path_list: list[str] + :keyword file_share_list: List of file shares to be transferred. + :paramtype file_share_list: list[str] + """ super(AzureFileFilterDetails, self).__init__(**kwargs) - self.file_prefix_list = kwargs.get('file_prefix_list', None) - self.file_path_list = kwargs.get('file_path_list', None) - self.file_share_list = kwargs.get('file_share_list', None) + self.file_prefix_list = file_prefix_list + self.file_path_list = file_path_list + self.file_share_list = file_share_list class BlobFilterDetails(msrest.serialization.Model): """Filter details to transfer Azure Blobs. - :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :type blob_prefix_list: list[str] - :param blob_path_list: List of full path of the blobs to be transferred. - :type blob_path_list: list[str] - :param container_list: List of blob containers to be transferred. - :type container_list: list[str] + :ivar blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :vartype blob_prefix_list: list[str] + :ivar blob_path_list: List of full path of the blobs to be transferred. + :vartype blob_path_list: list[str] + :ivar container_list: List of blob containers to be transferred. + :vartype container_list: list[str] """ _attribute_map = { @@ -412,12 +486,24 @@ class BlobFilterDetails(msrest.serialization.Model): def __init__( self, + *, + blob_prefix_list: Optional[List[str]] = None, + blob_path_list: Optional[List[str]] = None, + container_list: Optional[List[str]] = None, **kwargs ): + """ + :keyword blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :paramtype blob_prefix_list: list[str] + :keyword blob_path_list: List of full path of the blobs to be transferred. + :paramtype blob_path_list: list[str] + :keyword container_list: List of blob containers to be transferred. + :paramtype container_list: list[str] + """ super(BlobFilterDetails, self).__init__(**kwargs) - self.blob_prefix_list = kwargs.get('blob_prefix_list', None) - self.blob_path_list = kwargs.get('blob_path_list', None) - self.container_list = kwargs.get('container_list', None) + self.blob_prefix_list = blob_prefix_list + self.blob_path_list = blob_path_list + self.container_list = container_list class CancellationReason(msrest.serialization.Model): @@ -425,8 +511,8 @@ class CancellationReason(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Required. Reason for cancellation. + :vartype reason: str """ _validation = { @@ -439,10 +525,16 @@ class CancellationReason(msrest.serialization.Model): def __init__( self, + *, + reason: str, **kwargs ): + """ + :keyword reason: Required. Reason for cancellation. + :paramtype reason: str + """ super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs['reason'] + self.reason = reason class CloudError(msrest.serialization.Model): @@ -450,16 +542,16 @@ class CloudError(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: Cloud error code. - :type code: str - :param message: Cloud error message. - :type message: str - :param target: Cloud error target. - :type target: str + :ivar code: Cloud error code. + :vartype code: str + :ivar message: Cloud error message. + :vartype message: str + :ivar target: Cloud error target. + :vartype target: str :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.models.CloudError] + :vartype details: list[~azure.mgmt.databox.v2021_03_01.models.CloudError] :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.models.AdditionalErrorInfo] + :vartype additional_info: list[~azure.mgmt.databox.v2021_03_01.models.AdditionalErrorInfo] """ _validation = { @@ -477,12 +569,24 @@ class CloudError(msrest.serialization.Model): def __init__( self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, **kwargs ): + """ + :keyword code: Cloud error code. + :paramtype code: str + :keyword message: Cloud error message. + :paramtype message: str + :keyword target: Cloud error target. + :paramtype target: str + """ super(CloudError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) + self.code = code + self.message = message + self.target = target self.details = None self.additional_info = None @@ -492,18 +596,19 @@ class ContactDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :ivar contact_name: Required. Contact name of the person. + :vartype contact_name: str + :ivar phone: Required. Phone number of the contact person. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: Required. List of Email-ids to be notified about job progress. + :vartype email_list: list[str] + :ivar notification_preference: Notification preference for a job stage. + :vartype notification_preference: + list[~azure.mgmt.databox.v2021_03_01.models.NotificationPreference] """ _validation = { @@ -523,15 +628,37 @@ class ContactDetails(msrest.serialization.Model): def __init__( self, + *, + contact_name: str, + phone: str, + email_list: List[str], + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + notification_preference: Optional[List["NotificationPreference"]] = None, **kwargs ): + """ + :keyword contact_name: Required. Contact name of the person. + :paramtype contact_name: str + :keyword phone: Required. Phone number of the contact person. + :paramtype phone: str + :keyword phone_extension: Phone extension number of the contact person. + :paramtype phone_extension: str + :keyword mobile: Mobile number of the contact person. + :paramtype mobile: str + :keyword email_list: Required. List of Email-ids to be notified about job progress. + :paramtype email_list: list[str] + :keyword notification_preference: Notification preference for a job stage. + :paramtype notification_preference: + list[~azure.mgmt.databox.v2021_03_01.models.NotificationPreference] + """ super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs['contact_name'] - self.phone = kwargs['phone'] - self.phone_extension = kwargs.get('phone_extension', None) - self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs['email_list'] - self.notification_preference = kwargs.get('notification_preference', None) + self.contact_name = contact_name + self.phone = phone + self.phone_extension = phone_extension + self.mobile = mobile + self.email_list = email_list + self.notification_preference = notification_preference class CopyLogDetails(msrest.serialization.Model): @@ -542,9 +669,10 @@ class CopyLogDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator """ _validation = { @@ -563,6 +691,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] @@ -577,10 +707,10 @@ class CopyProgress(msrest.serialization.Model): :vartype storage_account_name: str :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.models.DataAccountType :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str :ivar bytes_processed: To indicate bytes transferred. @@ -651,6 +781,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None self.transfer_type = None @@ -677,12 +809,13 @@ class ValidationRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :vartype individual_request_details: + list[~azure.mgmt.databox.v2021_03_01.models.ValidationInputRequest] """ _validation = { @@ -701,11 +834,19 @@ class ValidationRequest(msrest.serialization.Model): def __init__( self, + *, + individual_request_details: List["ValidationInputRequest"], **kwargs ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2021_03_01.models.ValidationInputRequest] + """ super(ValidationRequest, self).__init__(**kwargs) self.validation_category = None # type: Optional[str] - self.individual_request_details = kwargs['individual_request_details'] + self.individual_request_details = individual_request_details class CreateJobValidations(ValidationRequest): @@ -713,12 +854,13 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :vartype individual_request_details: + list[~azure.mgmt.databox.v2021_03_01.models.ValidationInputRequest] """ _validation = { @@ -733,9 +875,17 @@ class CreateJobValidations(ValidationRequest): def __init__( self, + *, + individual_request_details: List["ValidationInputRequest"], **kwargs ): - super(CreateJobValidations, self).__init__(**kwargs) + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2021_03_01.models.ValidationInputRequest] + """ + super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) self.validation_category = 'JobCreationValidation' # type: str @@ -747,11 +897,12 @@ class ValidationInputRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator """ _validation = { @@ -770,6 +921,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputRequest, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] @@ -779,14 +932,15 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName """ _validation = { @@ -801,11 +955,18 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): def __init__( self, + *, + device_type: Union[str, "SkuName"], **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + """ super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str - self.device_type = kwargs['device_type'] + self.device_type = device_type class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): @@ -815,16 +976,17 @@ class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInpu All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError :ivar status: Create order limit validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_03_01.models.ValidationStatus """ _validation = { @@ -843,6 +1005,8 @@ def __init__( self, **kwargs ): + """ + """ super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str self.status = None @@ -856,16 +1020,16 @@ class DataAccountDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str + :vartype share_password: str """ _validation = { @@ -883,11 +1047,22 @@ class DataAccountDetails(msrest.serialization.Model): def __init__( self, + *, + share_password: Optional[str] = None, **kwargs ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + """ super(DataAccountDetails, self).__init__(**kwargs) self.data_account_type = None # type: Optional[str] - self.share_password = kwargs.get('share_password', None) + self.share_password = share_password class DataBoxAccountCopyLogDetails(CopyLogDetails): @@ -897,9 +1072,10 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -927,6 +1103,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBox' # type: str self.account_name = None @@ -941,9 +1119,10 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -970,6 +1149,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None @@ -991,7 +1172,7 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :vartype status: str or ~azure.mgmt.databox.v2021_03_01.models.CopyStatus """ _validation = { @@ -1012,6 +1193,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -1030,35 +1213,40 @@ class JobDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2021_03_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_03_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_03_01.models.LastMitigationActionOnJob """ _validation = { @@ -1070,7 +1258,8 @@ class JobDetails(msrest.serialization.Model): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, } _attribute_map = { @@ -1087,7 +1276,9 @@ class JobDetails(msrest.serialization.Model): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, } _subtype_map = { @@ -1096,23 +1287,50 @@ class JobDetails(msrest.serialization.Model): def __init__( self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, **kwargs ): + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ super(JobDetails, self).__init__(**kwargs) self.job_stages = None - self.contact_details = kwargs['contact_details'] - self.shipping_address = kwargs.get('shipping_address', None) + self.contact_details = contact_details + self.shipping_address = shipping_address self.delivery_package = None self.return_package = None - self.data_import_details = kwargs.get('data_import_details', None) - self.data_export_details = kwargs.get('data_export_details', None) + self.data_import_details = data_import_details + self.data_export_details = data_export_details self.job_details_type = None # type: Optional[str] - self.preferences = kwargs.get('preferences', None) + self.preferences = preferences self.copy_log_details = None self.reverse_shipment_label_sas_key = None self.chain_of_custody_sas_key = None - self.key_encryption_key = None - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) + self.key_encryption_key = key_encryption_key + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes + self.actions = None + self.last_mitigation_action_on_job = None class DataBoxDiskJobDetails(JobDetails): @@ -1123,46 +1341,51 @@ class DataBoxDiskJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2021_03_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_03_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_03_01.models.LastMitigationActionOnJob + :ivar preferred_disks: User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :vartype copy_progress: list[~azure.mgmt.databox.v2021_03_01.models.DataBoxDiskCopyProgress] :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str + :ivar passkey: User entered passkey for DataBox Disk job. + :vartype passkey: str """ _validation = { @@ -1174,7 +1397,8 @@ class DataBoxDiskJobDetails(JobDetails): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, 'copy_progress': {'readonly': True}, 'disks_and_size_details': {'readonly': True}, } @@ -1193,7 +1417,9 @@ class DataBoxDiskJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, @@ -1202,14 +1428,47 @@ class DataBoxDiskJobDetails(JobDetails): def __init__( self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + preferred_disks: Optional[Dict[str, int]] = None, + passkey: Optional[str] = None, **kwargs ): - super(DataBoxDiskJobDetails, self).__init__(**kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. + :paramtype preferred_disks: dict[str, int] + :keyword passkey: User entered passkey for DataBox Disk job. + :paramtype passkey: str + """ + super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBoxDisk' # type: str - self.preferred_disks = kwargs.get('preferred_disks', None) + self.preferred_disks = preferred_disks self.copy_progress = None self.disks_and_size_details = None - self.passkey = kwargs.get('passkey', None) + self.passkey = passkey class JobSecrets(msrest.serialization.Model): @@ -1222,13 +1481,13 @@ class JobSecrets(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_03_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError """ _validation = { @@ -1251,6 +1510,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobSecrets, self).__init__(**kwargs) self.job_secrets_type = None # type: Optional[str] self.dc_access_security_code = None @@ -1264,15 +1525,15 @@ class DataBoxDiskJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_03_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~azure.mgmt.databox.v2021_03_01.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -1301,6 +1562,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None @@ -1315,9 +1578,10 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -1345,6 +1609,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None @@ -1360,44 +1626,49 @@ class DataBoxHeavyJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2021_03_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_03_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_03_01.models.LastMitigationActionOnJob :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + :vartype copy_progress: list[~azure.mgmt.databox.v2021_03_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox Heavy. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str + :vartype device_password: str """ _validation = { @@ -1409,7 +1680,8 @@ class DataBoxHeavyJobDetails(JobDetails): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, 'copy_progress': {'readonly': True}, } @@ -1427,19 +1699,54 @@ class DataBoxHeavyJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } def __init__( self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + device_password: Optional[str] = None, **kwargs ): - super(DataBoxHeavyJobDetails, self).__init__(**kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None - self.device_password = kwargs.get('device_password', None) + self.device_password = device_password class DataBoxHeavyJobSecrets(JobSecrets): @@ -1449,15 +1756,15 @@ class DataBoxHeavyJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_03_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2021_03_01.models.DataBoxHeavySecret] """ _validation = { @@ -1478,6 +1785,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None @@ -1493,12 +1802,14 @@ class DataBoxHeavySecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2021_03_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2021_03_01.models.AccountCredentialDetails] """ _validation = { @@ -1521,6 +1832,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1537,44 +1850,49 @@ class DataBoxJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2021_03_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2021_03_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_03_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_03_01.models.LastMitigationActionOnJob :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. Should not be passed for + :vartype copy_progress: list[~azure.mgmt.databox.v2021_03_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str + :vartype device_password: str """ _validation = { @@ -1586,7 +1904,8 @@ class DataBoxJobDetails(JobDetails): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, 'copy_progress': {'readonly': True}, } @@ -1604,19 +1923,54 @@ class DataBoxJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } def __init__( self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + device_password: Optional[str] = None, **kwargs ): - super(DataBoxJobDetails, self).__init__(**kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_03_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBox' # type: str self.copy_progress = None - self.device_password = kwargs.get('device_password', None) + self.device_password = device_password class DataboxJobSecrets(JobSecrets): @@ -1626,15 +1980,15 @@ class DataboxJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_03_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_03_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError + :ivar pod_secrets: Contains the list of secret objects for a job. + :vartype pod_secrets: list[~azure.mgmt.databox.v2021_03_01.models.DataBoxSecret] """ _validation = { @@ -1652,11 +2006,17 @@ class DataboxJobSecrets(JobSecrets): def __init__( self, + *, + pod_secrets: Optional[List["DataBoxSecret"]] = None, **kwargs ): + """ + :keyword pod_secrets: Contains the list of secret objects for a job. + :paramtype pod_secrets: list[~azure.mgmt.databox.v2021_03_01.models.DataBoxSecret] + """ super(DataboxJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBox' # type: str - self.pod_secrets = kwargs.get('pod_secrets', None) + self.pod_secrets = pod_secrets class ScheduleAvailabilityRequest(msrest.serialization.Model): @@ -1667,14 +2027,14 @@ class ScheduleAvailabilityRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -1694,12 +2054,22 @@ class ScheduleAvailabilityRequest(msrest.serialization.Model): def __init__( self, + *, + storage_location: str, + country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ super(ScheduleAvailabilityRequest, self).__init__(**kwargs) - self.storage_location = kwargs['storage_location'] + self.storage_location = storage_location self.sku_name = None # type: Optional[str] - self.country = kwargs.get('country', None) + self.country = country class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1707,14 +2077,14 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -1730,9 +2100,19 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): def __init__( self, + *, + storage_location: str, + country: Optional[str] = None, **kwargs ): - super(DataBoxScheduleAvailabilityRequest, self).__init__(**kwargs) + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ + super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBox' # type: str @@ -1746,12 +2126,14 @@ class DataBoxSecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2021_03_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2021_03_01.models.AccountCredentialDetails] """ _validation = { @@ -1774,6 +2156,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1787,13 +2171,13 @@ class DataExportDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_configuration: Required. Configuration for the data transfer. - :type transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :param log_collection_level: Level of the logs to be collected. Possible values include: - "Error", "Verbose". - :type log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :ivar transfer_configuration: Required. Configuration for the data transfer. + :vartype transfer_configuration: ~azure.mgmt.databox.v2021_03_01.models.TransferConfiguration + :ivar log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". Default value: "Error". + :vartype log_collection_level: str or ~azure.mgmt.databox.v2021_03_01.models.LogCollectionLevel + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2021_03_01.models.DataAccountDetails """ _validation = { @@ -1809,12 +2193,26 @@ class DataExportDetails(msrest.serialization.Model): def __init__( self, + *, + transfer_configuration: "TransferConfiguration", + account_details: "DataAccountDetails", + log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = "Error", **kwargs ): + """ + :keyword transfer_configuration: Required. Configuration for the data transfer. + :paramtype transfer_configuration: ~azure.mgmt.databox.v2021_03_01.models.TransferConfiguration + :keyword log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". Default value: "Error". + :paramtype log_collection_level: str or + ~azure.mgmt.databox.v2021_03_01.models.LogCollectionLevel + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2021_03_01.models.DataAccountDetails + """ super(DataExportDetails, self).__init__(**kwargs) - self.transfer_configuration = kwargs['transfer_configuration'] - self.log_collection_level = kwargs.get('log_collection_level', None) - self.account_details = kwargs['account_details'] + self.transfer_configuration = transfer_configuration + self.log_collection_level = log_collection_level + self.account_details = account_details class DataImportDetails(msrest.serialization.Model): @@ -1822,8 +2220,8 @@ class DataImportDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2021_03_01.models.DataAccountDetails """ _validation = { @@ -1836,10 +2234,16 @@ class DataImportDetails(msrest.serialization.Model): def __init__( self, + *, + account_details: "DataAccountDetails", **kwargs ): + """ + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2021_03_01.models.DataAccountDetails + """ super(DataImportDetails, self).__init__(**kwargs) - self.account_details = kwargs['account_details'] + self.account_details = account_details class DataLocationToServiceLocationMap(msrest.serialization.Model): @@ -1867,6 +2271,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataLocationToServiceLocationMap, self).__init__(**kwargs) self.data_location = None self.service_location = None @@ -1877,21 +2283,22 @@ class DataTransferDetailsValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param data_export_details: List of DataTransfer details to be used to export data from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param data_import_details: List of DataTransfer details to be used to import data to azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator + :ivar data_export_details: List of DataTransfer details to be used to export data from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :ivar data_import_details: List of DataTransfer details to be used to import data to azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :ivar device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType """ _validation = { @@ -1910,14 +2317,32 @@ class DataTransferDetailsValidationRequest(ValidationInputRequest): def __init__( self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + data_export_details: Optional[List["DataExportDetails"]] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, **kwargs ): + """ + :keyword data_export_details: List of DataTransfer details to be used to export data from + azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_03_01.models.DataExportDetails] + :keyword data_import_details: List of DataTransfer details to be used to import data to azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_03_01.models.DataImportDetails] + :keyword device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType + """ super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateDataTransferDetails' # type: str - self.data_export_details = kwargs.get('data_export_details', None) - self.data_import_details = kwargs.get('data_import_details', None) - self.device_type = kwargs['device_type'] - self.transfer_type = kwargs['transfer_type'] + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): @@ -1927,16 +2352,17 @@ class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError :ivar status: Data transfer details validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_03_01.models.ValidationStatus """ _validation = { @@ -1955,6 +2381,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateDataTransferDetails' # type: str self.status = None @@ -1963,24 +2391,33 @@ def __init__( class DcAccessSecurityCode(msrest.serialization.Model): """Dc access security code. - :param reverse_dc_access_code: Reverse Dc access security code. - :type reverse_dc_access_code: str - :param forward_dc_access_code: Forward Dc access security code. - :type forward_dc_access_code: str + :ivar reverse_dc_access_code: Reverse Dc access security code. + :vartype reverse_dc_access_code: str + :ivar forward_dc_access_code: Forward Dc access security code. + :vartype forward_dc_access_code: str """ _attribute_map = { - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, + 'reverse_dc_access_code': {'key': 'reverseDCAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDCAccessCode', 'type': 'str'}, } def __init__( self, + *, + reverse_dc_access_code: Optional[str] = None, + forward_dc_access_code: Optional[str] = None, **kwargs ): + """ + :keyword reverse_dc_access_code: Reverse Dc access security code. + :paramtype reverse_dc_access_code: str + :keyword forward_dc_access_code: Forward Dc access security code. + :paramtype forward_dc_access_code: str + """ super(DcAccessSecurityCode, self).__init__(**kwargs) - self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) - self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) + self.reverse_dc_access_code = reverse_dc_access_code + self.forward_dc_access_code = forward_dc_access_code class Details(msrest.serialization.Model): @@ -1988,10 +2425,10 @@ class Details(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str """ _validation = { @@ -2006,11 +2443,20 @@ class Details(msrest.serialization.Model): def __init__( self, + *, + code: str, + message: str, **kwargs ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + """ super(Details, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] + self.code = code + self.message = message class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -2018,39 +2464,53 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int """ _validation = { 'storage_location': {'required': True}, 'sku_name': {'required': True}, - 'expected_data_size_in_terabytes': {'required': True}, + 'expected_data_size_in_tera_bytes': {'required': True}, } _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, } def __init__( self, + *, + storage_location: str, + expected_data_size_in_tera_bytes: int, + country: Optional[str] = None, **kwargs ): - super(DiskScheduleAvailabilityRequest, self).__init__(**kwargs) + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + :keyword expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs + to be transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ + super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = kwargs['expected_data_size_in_terabytes'] + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes class DiskSecret(msrest.serialization.Model): @@ -2079,6 +2539,8 @@ def __init__( self, **kwargs ): + """ + """ super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None @@ -2087,9 +2549,9 @@ def __init__( class EncryptionPreferences(msrest.serialization.Model): """Preferences related to the Encryption. - :param double_encryption: Defines secondary layer of software-based encryption enablement. - Possible values include: "Enabled", "Disabled". - :type double_encryption: str or ~azure.mgmt.databox.models.DoubleEncryption + :ivar double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :vartype double_encryption: str or ~azure.mgmt.databox.v2021_03_01.models.DoubleEncryption """ _attribute_map = { @@ -2098,10 +2560,17 @@ class EncryptionPreferences(msrest.serialization.Model): def __init__( self, + *, + double_encryption: Optional[Union[str, "DoubleEncryption"]] = "Disabled", **kwargs ): + """ + :keyword double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :paramtype double_encryption: str or ~azure.mgmt.databox.v2021_03_01.models.DoubleEncryption + """ super(EncryptionPreferences, self).__init__(**kwargs) - self.double_encryption = kwargs.get('double_encryption', None) + self.double_encryption = double_encryption class ErrorDetail(msrest.serialization.Model): @@ -2109,14 +2578,14 @@ class ErrorDetail(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str - :param details: - :type details: list[~azure.mgmt.databox.models.Details] - :param target: - :type target: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar details: + :vartype details: list[~azure.mgmt.databox.v2021_03_01.models.Details] + :ivar target: + :vartype target: str """ _validation = { @@ -2133,13 +2602,28 @@ class ErrorDetail(msrest.serialization.Model): def __init__( self, + *, + code: str, + message: str, + details: Optional[List["Details"]] = None, + target: Optional[str] = None, **kwargs ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + :keyword details: + :paramtype details: list[~azure.mgmt.databox.v2021_03_01.models.Details] + :keyword target: + :paramtype target: str + """ super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.details = kwargs.get('details', None) - self.target = kwargs.get('target', None) + self.code = code + self.message = message + self.details = details + self.target = target class FilterFileDetails(msrest.serialization.Model): @@ -2147,12 +2631,12 @@ class FilterFileDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param filter_file_type: Required. Type of the filter file. Possible values include: + :ivar filter_file_type: Required. Type of the filter file. Possible values include: "AzureBlob", "AzureFile". - :type filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :param filter_file_path: Required. Path of the file that contains the details of all items to + :vartype filter_file_type: str or ~azure.mgmt.databox.v2021_03_01.models.FilterFileType + :ivar filter_file_path: Required. Path of the file that contains the details of all items to transfer. - :type filter_file_path: str + :vartype filter_file_path: str """ _validation = { @@ -2167,11 +2651,22 @@ class FilterFileDetails(msrest.serialization.Model): def __init__( self, + *, + filter_file_type: Union[str, "FilterFileType"], + filter_file_path: str, **kwargs ): + """ + :keyword filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :paramtype filter_file_type: str or ~azure.mgmt.databox.v2021_03_01.models.FilterFileType + :keyword filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :paramtype filter_file_path: str + """ super(FilterFileDetails, self).__init__(**kwargs) - self.filter_file_type = kwargs['filter_file_type'] - self.filter_file_path = kwargs['filter_file_path'] + self.filter_file_type = filter_file_type + self.filter_file_path = filter_file_path class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -2179,14 +2674,14 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -2202,19 +2697,29 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): def __init__( self, + *, + storage_location: str, + country: Optional[str] = None, **kwargs ): - super(HeavyScheduleAvailabilityRequest, self).__init__(**kwargs) + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ + super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBoxHeavy' # type: str class IdentityProperties(msrest.serialization.Model): """Managed identity properties. - :param type: Managed service identity type. - :type type: str - :param user_assigned: User assigned identity properties. - :type user_assigned: ~azure.mgmt.databox.models.UserAssignedProperties + :ivar type: Managed service identity type. + :vartype type: str + :ivar user_assigned: User assigned identity properties. + :vartype user_assigned: ~azure.mgmt.databox.v2021_03_01.models.UserAssignedProperties """ _attribute_map = { @@ -2224,18 +2729,27 @@ class IdentityProperties(msrest.serialization.Model): def __init__( self, + *, + type: Optional[str] = None, + user_assigned: Optional["UserAssignedProperties"] = None, **kwargs ): + """ + :keyword type: Managed service identity type. + :paramtype type: str + :keyword user_assigned: User assigned identity properties. + :paramtype user_assigned: ~azure.mgmt.databox.v2021_03_01.models.UserAssignedProperties + """ super(IdentityProperties, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned = kwargs.get('user_assigned', None) + self.type = type + self.user_assigned = user_assigned class JobDeliveryInfo(msrest.serialization.Model): """Additional delivery info. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime """ _attribute_map = { @@ -2244,10 +2758,16 @@ class JobDeliveryInfo(msrest.serialization.Model): def __init__( self, + *, + scheduled_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword scheduled_date_time: Scheduled date time. + :paramtype scheduled_date_time: ~datetime.datetime + """ super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = kwargs.get('scheduled_date_time', None) + self.scheduled_date_time = scheduled_date_time class Resource(msrest.serialization.Model): @@ -2255,18 +2775,18 @@ class Resource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2021_03_01.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2021_03_01.models.ResourceIdentity """ _validation = { @@ -2283,13 +2803,32 @@ class Resource(msrest.serialization.Model): def __init__( self, + *, + location: str, + sku: "Sku", + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2021_03_01.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2021_03_01.models.ResourceIdentity + """ super(Resource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs['sku'] - self.identity = kwargs.get('identity', None) + self.location = location + self.tags = tags + self.sku = sku + self.identity = identity class JobResource(Resource): @@ -2299,27 +2838,29 @@ class JobResource(Resource): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2021_03_01.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2021_03_01.models.ResourceIdentity :ivar name: Name of the object. :vartype name: str :ivar id: Id of the object. :vartype id: str :ivar type: Type of the object. :vartype type: str - :param transfer_type: Required. Type of the data transfer. Possible values include: + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.databox.v2021_03_01.models.SystemData + :ivar transfer_type: Required. Type of the data transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType :ivar is_cancellable: Describes whether the job is cancellable or not. :vartype is_cancellable: bool :ivar is_deletable: Describes whether the job is deletable or not. @@ -2333,20 +2874,20 @@ class JobResource(Resource): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.models.StageName + :vartype status: str or ~azure.mgmt.databox.v2021_03_01.models.StageName :ivar start_time: Time at which the job was started in UTC ISO 8601 format. :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError + :ivar details: Details of a job run. This field will only be sent for expand details filter. + :vartype details: ~azure.mgmt.databox.v2021_03_01.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo + :ivar delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :vartype delivery_type: str or ~azure.mgmt.databox.v2021_03_01.models.JobDeliveryType + :ivar delivery_info: Delivery Info of Job. + :vartype delivery_info: ~azure.mgmt.databox.v2021_03_01.models.JobDeliveryInfo :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. :vartype is_cancellable_without_fee: bool """ @@ -2357,6 +2898,7 @@ class JobResource(Resource): 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'transfer_type': {'required': True}, 'is_cancellable': {'readonly': True}, 'is_deletable': {'readonly': True}, @@ -2377,6 +2919,7 @@ class JobResource(Resource): 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'transfer_type': {'key': 'properties.transferType', 'type': 'str'}, 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, @@ -2394,13 +2937,47 @@ class JobResource(Resource): def __init__( self, + *, + location: str, + sku: "Sku", + transfer_type: Union[str, "TransferType"], + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + details: Optional["JobDetails"] = None, + delivery_type: Optional[Union[str, "JobDeliveryType"]] = "NonScheduled", + delivery_info: Optional["JobDeliveryInfo"] = None, **kwargs ): - super(JobResource, self).__init__(**kwargs) + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2021_03_01.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2021_03_01.models.ResourceIdentity + :keyword transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType + :keyword details: Details of a job run. This field will only be sent for expand details filter. + :paramtype details: ~azure.mgmt.databox.v2021_03_01.models.JobDetails + :keyword delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :paramtype delivery_type: str or ~azure.mgmt.databox.v2021_03_01.models.JobDeliveryType + :keyword delivery_info: Delivery Info of Job. + :paramtype delivery_info: ~azure.mgmt.databox.v2021_03_01.models.JobDeliveryInfo + """ + super(JobResource, self).__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) self.name = None self.id = None self.type = None - self.transfer_type = kwargs['transfer_type'] + self.system_data = None + self.transfer_type = transfer_type self.is_cancellable = None self.is_deletable = None self.is_shipping_address_editable = None @@ -2408,20 +2985,20 @@ def __init__( self.status = None self.start_time = None self.error = None - self.details = kwargs.get('details', None) + self.details = details self.cancellation_reason = None - self.delivery_type = kwargs.get('delivery_type', None) - self.delivery_info = kwargs.get('delivery_info', None) + self.delivery_type = delivery_type + self.delivery_info = delivery_info self.is_cancellable_without_fee = None class JobResourceList(msrest.serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :ivar value: List of job resources. + :vartype value: list[~azure.mgmt.databox.v2021_03_01.models.JobResource] + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str """ _attribute_map = { @@ -2431,23 +3008,32 @@ class JobResourceList(msrest.serialization.Model): def __init__( self, + *, + value: Optional[List["JobResource"]] = None, + next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of job resources. + :paramtype value: list[~azure.mgmt.databox.v2021_03_01.models.JobResource] + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ super(JobResourceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = value + self.next_link = next_link class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails + :vartype tags: dict[str, str] + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2021_03_01.models.ResourceIdentity + :ivar details: Details of a job to be updated. + :vartype details: ~azure.mgmt.databox.v2021_03_01.models.UpdateJobDetails """ _attribute_map = { @@ -2458,12 +3044,25 @@ class JobResourceUpdateParameter(msrest.serialization.Model): def __init__( self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + details: Optional["UpdateJobDetails"] = None, **kwargs ): + """ + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2021_03_01.models.ResourceIdentity + :keyword details: Details of a job to be updated. + :paramtype details: ~azure.mgmt.databox.v2021_03_01.models.UpdateJobDetails + """ super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.details = kwargs.get('details', None) + self.tags = tags + self.identity = identity + self.details = details class JobStages(msrest.serialization.Model): @@ -2476,17 +3075,17 @@ class JobStages(msrest.serialization.Model): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :vartype stage_name: str or ~azure.mgmt.databox.v2021_03_01.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", "WaitingForCustomerAction", "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + :vartype stage_status: str or ~azure.mgmt.databox.v2021_03_01.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. :vartype stage_time: ~datetime.datetime :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object + :vartype job_stage_details: any """ _validation = { @@ -2509,6 +3108,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None @@ -2522,16 +3123,16 @@ class KeyEncryptionKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kek_type: Required. Type of encryption key used for key encryption. Possible values - include: "MicrosoftManaged", "CustomerManaged". - :type kek_type: str or ~azure.mgmt.databox.models.KekType - :param identity_properties: Managed identity properties used for key encryption. - :type identity_properties: ~azure.mgmt.databox.models.IdentityProperties - :param kek_url: Key encryption key. It is required in case of Customer managed KekType. - :type kek_url: str - :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + :ivar kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :vartype kek_type: str or ~azure.mgmt.databox.v2021_03_01.models.KekType + :ivar identity_properties: Managed identity properties used for key encryption. + :vartype identity_properties: ~azure.mgmt.databox.v2021_03_01.models.IdentityProperties + :ivar kek_url: Key encryption key. It is required in case of Customer managed KekType. + :vartype kek_url: str + :ivar kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed KekType. - :type kek_vault_resource_id: str + :vartype kek_vault_resource_id: str """ _validation = { @@ -2547,13 +3148,75 @@ class KeyEncryptionKey(msrest.serialization.Model): def __init__( self, + *, + kek_type: Union[str, "KekType"] = "MicrosoftManaged", + identity_properties: Optional["IdentityProperties"] = None, + kek_url: Optional[str] = None, + kek_vault_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :paramtype kek_type: str or ~azure.mgmt.databox.v2021_03_01.models.KekType + :keyword identity_properties: Managed identity properties used for key encryption. + :paramtype identity_properties: ~azure.mgmt.databox.v2021_03_01.models.IdentityProperties + :keyword kek_url: Key encryption key. It is required in case of Customer managed KekType. + :paramtype kek_url: str + :keyword kek_vault_resource_id: Kek vault resource id. It is required in case of Customer + managed KekType. + :paramtype kek_vault_resource_id: str + """ super(KeyEncryptionKey, self).__init__(**kwargs) - self.kek_type = kwargs['kek_type'] - self.identity_properties = kwargs.get('identity_properties', None) - self.kek_url = kwargs.get('kek_url', None) - self.kek_vault_resource_id = kwargs.get('kek_vault_resource_id', None) + self.kek_type = kek_type + self.identity_properties = identity_properties + self.kek_url = kek_url + self.kek_vault_resource_id = kek_vault_resource_id + + +class LastMitigationActionOnJob(msrest.serialization.Model): + """Last Mitigation Action Performed On Job. + + :ivar action_date_time_in_utc: Action performed date time. + :vartype action_date_time_in_utc: ~datetime.datetime + :ivar is_performed_by_customer: Action performed by customer, + possibility is that mitigation might happen by customer or service or by ops. + :vartype is_performed_by_customer: bool + :ivar customer_resolution: Resolution code provided by customer. Possible values include: + "None", "MoveToCleanUpDevice", "Resume". + :vartype customer_resolution: str or + ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode + """ + + _attribute_map = { + 'action_date_time_in_utc': {'key': 'actionDateTimeInUtc', 'type': 'iso-8601'}, + 'is_performed_by_customer': {'key': 'isPerformedByCustomer', 'type': 'bool'}, + 'customer_resolution': {'key': 'customerResolution', 'type': 'str'}, + } + + def __init__( + self, + *, + action_date_time_in_utc: Optional[datetime.datetime] = None, + is_performed_by_customer: Optional[bool] = None, + customer_resolution: Optional[Union[str, "CustomerResolutionCode"]] = None, + **kwargs + ): + """ + :keyword action_date_time_in_utc: Action performed date time. + :paramtype action_date_time_in_utc: ~datetime.datetime + :keyword is_performed_by_customer: Action performed by customer, + possibility is that mitigation might happen by customer or service or by ops. + :paramtype is_performed_by_customer: bool + :keyword customer_resolution: Resolution code provided by customer. Possible values include: + "None", "MoveToCleanUpDevice", "Resume". + :paramtype customer_resolution: str or + ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode + """ + super(LastMitigationActionOnJob, self).__init__(**kwargs) + self.action_date_time_in_utc = action_date_time_in_utc + self.is_performed_by_customer = is_performed_by_customer + self.customer_resolution = customer_resolution class ManagedDiskDetails(DataAccountDetails): @@ -2561,21 +3224,21 @@ class ManagedDiskDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param resource_group_id: Required. Resource Group Id of the compute disks. - :type resource_group_id: str - :param staging_storage_account_id: Required. Resource Id of the storage account that can be - used to copy the vhd for staging. - :type staging_storage_account_id: str + :vartype share_password: str + :ivar resource_group_id: Required. Resource Group Id of the compute disks. + :vartype resource_group_id: str + :ivar staging_storage_account_id: Required. Resource Id of the storage account that can be used + to copy the vhd for staging. + :vartype staging_storage_account_id: str """ _validation = { @@ -2593,12 +3256,65 @@ class ManagedDiskDetails(DataAccountDetails): def __init__( self, + *, + resource_group_id: str, + staging_storage_account_id: str, + share_password: Optional[str] = None, **kwargs ): - super(ManagedDiskDetails, self).__init__(**kwargs) + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword resource_group_id: Required. Resource Group Id of the compute disks. + :paramtype resource_group_id: str + :keyword staging_storage_account_id: Required. Resource Id of the storage account that can be + used to copy the vhd for staging. + :paramtype staging_storage_account_id: str + """ + super(ManagedDiskDetails, self).__init__(share_password=share_password, **kwargs) self.data_account_type = 'ManagedDisk' # type: str - self.resource_group_id = kwargs['resource_group_id'] - self.staging_storage_account_id = kwargs['staging_storage_account_id'] + self.resource_group_id = resource_group_id + self.staging_storage_account_id = staging_storage_account_id + + +class MitigateJobRequest(msrest.serialization.Model): + """The Mitigate Job captured from request body for Mitigate API. + + All required parameters must be populated in order to send to Azure. + + :ivar customer_resolution_code: Required. Resolution code for the job. Possible values include: + "None", "MoveToCleanUpDevice", "Resume". + :vartype customer_resolution_code: str or + ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode + """ + + _validation = { + 'customer_resolution_code': {'required': True}, + } + + _attribute_map = { + 'customer_resolution_code': {'key': 'customerResolutionCode', 'type': 'str'}, + } + + def __init__( + self, + *, + customer_resolution_code: Union[str, "CustomerResolutionCode"], + **kwargs + ): + """ + :keyword customer_resolution_code: Required. Resolution code for the job. Possible values + include: "None", "MoveToCleanUpDevice", "Resume". + :paramtype customer_resolution_code: str or + ~azure.mgmt.databox.v2021_03_01.models.CustomerResolutionCode + """ + super(MitigateJobRequest, self).__init__(**kwargs) + self.customer_resolution_code = customer_resolution_code class NotificationPreference(msrest.serialization.Model): @@ -2606,11 +3322,11 @@ class NotificationPreference(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + :ivar stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :vartype stage_name: str or ~azure.mgmt.databox.v2021_03_01.models.NotificationStageName + :ivar send_notification: Required. Notification is required or not. + :vartype send_notification: bool """ _validation = { @@ -2625,11 +3341,21 @@ class NotificationPreference(msrest.serialization.Model): def __init__( self, + *, + stage_name: Union[str, "NotificationStageName"], + send_notification: bool = True, **kwargs ): + """ + :keyword stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :paramtype stage_name: str or ~azure.mgmt.databox.v2021_03_01.models.NotificationStageName + :keyword send_notification: Required. Notification is required or not. + :paramtype send_notification: bool + """ super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs['stage_name'] - self.send_notification = kwargs['send_notification'] + self.stage_name = stage_name + self.send_notification = send_notification class Operation(msrest.serialization.Model): @@ -2641,13 +3367,13 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2021_03_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :vartype properties: any :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool """ _validation = { @@ -2667,27 +3393,33 @@ class Operation(msrest.serialization.Model): def __init__( self, + *, + is_data_action: Optional[bool] = None, **kwargs ): + """ + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + """ super(Operation, self).__init__(**kwargs) self.name = None self.display = None self.properties = None self.origin = None - self.is_data_action = kwargs.get('is_data_action', None) + self.is_data_action = is_data_action class OperationDisplay(msrest.serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :ivar provider: Provider name. + :vartype provider: str + :ivar resource: Resource name. + :vartype resource: str + :ivar operation: Localized name of the operation for display purpose. + :vartype operation: str + :ivar description: Localized description of the operation for display purpose. + :vartype description: str """ _attribute_map = { @@ -2699,13 +3431,28 @@ class OperationDisplay(msrest.serialization.Model): def __init__( self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Provider name. + :paramtype provider: str + :keyword resource: Resource name. + :paramtype resource: str + :keyword operation: Localized name of the operation for display purpose. + :paramtype operation: str + :keyword description: Localized description of the operation for display purpose. + :paramtype description: str + """ super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description class OperationList(msrest.serialization.Model): @@ -2714,9 +3461,9 @@ class OperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2021_03_01.models.Operation] + :ivar next_link: Link for the next set of operations. + :vartype next_link: str """ _validation = { @@ -2730,11 +3477,17 @@ class OperationList(msrest.serialization.Model): def __init__( self, + *, + next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of operations. + :paramtype next_link: str + """ super(OperationList, self).__init__(**kwargs) self.value = None - self.next_link = kwargs.get('next_link', None) + self.next_link = next_link class PackageShippingDetails(msrest.serialization.Model): @@ -2766,6 +3519,8 @@ def __init__( self, **kwargs ): + """ + """ super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None @@ -2775,12 +3530,12 @@ def __init__( class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred data center region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences - :param encryption_preferences: Preferences related to the Encryption. - :type encryption_preferences: ~azure.mgmt.databox.models.EncryptionPreferences + :ivar preferred_data_center_region: Preferred data center region. + :vartype preferred_data_center_region: list[str] + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2021_03_01.models.TransportPreferences + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: ~azure.mgmt.databox.v2021_03_01.models.EncryptionPreferences """ _attribute_map = { @@ -2791,12 +3546,24 @@ class Preferences(msrest.serialization.Model): def __init__( self, + *, + preferred_data_center_region: Optional[List[str]] = None, + transport_preferences: Optional["TransportPreferences"] = None, + encryption_preferences: Optional["EncryptionPreferences"] = None, **kwargs ): + """ + :keyword preferred_data_center_region: Preferred data center region. + :paramtype preferred_data_center_region: list[str] + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2021_03_01.models.TransportPreferences + :keyword encryption_preferences: Preferences related to the Encryption. + :paramtype encryption_preferences: ~azure.mgmt.databox.v2021_03_01.models.EncryptionPreferences + """ super(Preferences, self).__init__(**kwargs) - self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) - self.transport_preferences = kwargs.get('transport_preferences', None) - self.encryption_preferences = kwargs.get('encryption_preferences', None) + self.preferred_data_center_region = preferred_data_center_region + self.transport_preferences = transport_preferences + self.encryption_preferences = encryption_preferences class PreferencesValidationRequest(ValidationInputRequest): @@ -2804,16 +3571,17 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference of transport and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator + :ivar preference: Preference of transport and data center. + :vartype preference: ~azure.mgmt.databox.v2021_03_01.models.Preferences + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName """ _validation = { @@ -2829,12 +3597,22 @@ class PreferencesValidationRequest(ValidationInputRequest): def __init__( self, + *, + device_type: Union[str, "SkuName"], + preference: Optional["Preferences"] = None, **kwargs ): + """ + :keyword preference: Preference of transport and data center. + :paramtype preference: ~azure.mgmt.databox.v2021_03_01.models.Preferences + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + """ super(PreferencesValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str - self.preference = kwargs.get('preference', None) - self.device_type = kwargs['device_type'] + self.preference = preference + self.device_type = device_type class PreferencesValidationResponseProperties(ValidationInputResponse): @@ -2844,16 +3622,17 @@ class PreferencesValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError :ivar status: Validation status of requested data center and transport. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_03_01.models.ValidationStatus """ _validation = { @@ -2872,6 +3651,8 @@ def __init__( self, **kwargs ): + """ + """ super(PreferencesValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str self.status = None @@ -2880,12 +3661,14 @@ def __init__( class RegionConfigurationRequest(msrest.serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability for scheduling + :ivar schedule_availability_request: Request body to get the availability for scheduling orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given + :vartype schedule_availability_request: + ~azure.mgmt.databox.v2021_03_01.models.ScheduleAvailabilityRequest + :ivar transport_availability_request: Request body to get the transport availability for given sku. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest + :vartype transport_availability_request: + ~azure.mgmt.databox.v2021_03_01.models.TransportAvailabilityRequest """ _attribute_map = { @@ -2895,11 +3678,24 @@ class RegionConfigurationRequest(msrest.serialization.Model): def __init__( self, + *, + schedule_availability_request: Optional["ScheduleAvailabilityRequest"] = None, + transport_availability_request: Optional["TransportAvailabilityRequest"] = None, **kwargs ): + """ + :keyword schedule_availability_request: Request body to get the availability for scheduling + orders. + :paramtype schedule_availability_request: + ~azure.mgmt.databox.v2021_03_01.models.ScheduleAvailabilityRequest + :keyword transport_availability_request: Request body to get the transport availability for + given sku. + :paramtype transport_availability_request: + ~azure.mgmt.databox.v2021_03_01.models.TransportAvailabilityRequest + """ super(RegionConfigurationRequest, self).__init__(**kwargs) - self.schedule_availability_request = kwargs.get('schedule_availability_request', None) - self.transport_availability_request = kwargs.get('transport_availability_request', None) + self.schedule_availability_request = schedule_availability_request + self.transport_availability_request = transport_availability_request class RegionConfigurationResponse(msrest.serialization.Model): @@ -2909,10 +3705,10 @@ class RegionConfigurationResponse(msrest.serialization.Model): :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse + ~azure.mgmt.databox.v2021_03_01.models.ScheduleAvailabilityResponse :ivar transport_availability_response: Transport options available for given sku in a region. :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse + ~azure.mgmt.databox.v2021_03_01.models.TransportAvailabilityResponse """ _validation = { @@ -2929,6 +3725,8 @@ def __init__( self, **kwargs ): + """ + """ super(RegionConfigurationResponse, self).__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None @@ -2939,14 +3737,15 @@ class ResourceIdentity(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param type: Identity type. - :type type: str + :ivar type: Identity type. + :vartype type: str :ivar principal_id: Service Principal Id backing the Msi. :vartype principal_id: str :ivar tenant_id: Home Tenant Id. :vartype tenant_id: str - :param user_assigned_identities: User Assigned Identities. - :type user_assigned_identities: dict[str, ~azure.mgmt.databox.models.UserAssignedIdentity] + :ivar user_assigned_identities: User Assigned Identities. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.databox.v2021_03_01.models.UserAssignedIdentity] """ _validation = { @@ -2963,13 +3762,23 @@ class ResourceIdentity(msrest.serialization.Model): def __init__( self, + *, + type: Optional[str] = "None", + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, **kwargs ): + """ + :keyword type: Identity type. + :paramtype type: str + :keyword user_assigned_identities: User Assigned Identities. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.databox.v2021_03_01.models.UserAssignedIdentity] + """ super(ResourceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) + self.type = type self.principal_id = None self.tenant_id = None - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.user_assigned_identities = user_assigned_identities class ScheduleAvailabilityResponse(msrest.serialization.Model): @@ -2993,6 +3802,8 @@ def __init__( self, **kwargs ): + """ + """ super(ScheduleAvailabilityResponse, self).__init__(**kwargs) self.available_dates = None @@ -3005,14 +3816,15 @@ class ShareCredentialDetails(msrest.serialization.Model): :ivar share_name: Name of the share. :vartype share_name: str :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", - "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk", "AzurePremiumFiles". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". + :vartype share_type: str or ~azure.mgmt.databox.v2021_03_01.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] + :vartype supported_access_protocols: list[str or + ~azure.mgmt.databox.v2021_03_01.models.AccessProtocol] """ _validation = { @@ -3035,6 +3847,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -3048,14 +3862,14 @@ class ShipmentPickUpRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be + :ivar start_time: Required. Minimum date after which the pick up should commence, this must be in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be + :vartype start_time: ~datetime.datetime + :ivar end_time: Required. Maximum date before which the pick up should commence, this must be in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :vartype end_time: ~datetime.datetime + :ivar shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :vartype shipment_location: str """ _validation = { @@ -3072,12 +3886,26 @@ class ShipmentPickUpRequest(msrest.serialization.Model): def __init__( self, + *, + start_time: datetime.datetime, + end_time: datetime.datetime, + shipment_location: str, **kwargs ): + """ + :keyword start_time: Required. Minimum date after which the pick up should commence, this must + be in local time of pick up area. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Required. Maximum date before which the pick up should commence, this must + be in local time of pick up area. + :paramtype end_time: ~datetime.datetime + :keyword shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :paramtype shipment_location: str + """ super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs['start_time'] - self.end_time = kwargs['end_time'] - self.shipment_location = kwargs['shipment_location'] + self.start_time = start_time + self.end_time = end_time + self.shipment_location = shipment_location class ShipmentPickUpResponse(msrest.serialization.Model): @@ -3106,6 +3934,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None @@ -3116,27 +3946,27 @@ class ShippingAddress(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :ivar street_address1: Required. Street Address line 1. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: Required. Name of the Country. + :vartype country: str + :ivar postal_code: Postal code. + :vartype postal_code: str + :ivar zip_extended_code: Extended Zip Code. + :vartype zip_extended_code: str + :ivar company_name: Name of the company. + :vartype company_name: str + :ivar address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :vartype address_type: str or ~azure.mgmt.databox.v2021_03_01.models.AddressType """ _validation = { @@ -3159,19 +3989,53 @@ class ShippingAddress(msrest.serialization.Model): def __init__( self, + *, + street_address1: str, + country: str, + street_address2: Optional[str] = None, + street_address3: Optional[str] = None, + city: Optional[str] = None, + state_or_province: Optional[str] = None, + postal_code: Optional[str] = None, + zip_extended_code: Optional[str] = None, + company_name: Optional[str] = None, + address_type: Optional[Union[str, "AddressType"]] = "None", **kwargs ): + """ + :keyword street_address1: Required. Street Address line 1. + :paramtype street_address1: str + :keyword street_address2: Street Address line 2. + :paramtype street_address2: str + :keyword street_address3: Street Address line 3. + :paramtype street_address3: str + :keyword city: Name of the City. + :paramtype city: str + :keyword state_or_province: Name of the State or Province. + :paramtype state_or_province: str + :keyword country: Required. Name of the Country. + :paramtype country: str + :keyword postal_code: Postal code. + :paramtype postal_code: str + :keyword zip_extended_code: Extended Zip Code. + :paramtype zip_extended_code: str + :keyword company_name: Name of the company. + :paramtype company_name: str + :keyword address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :paramtype address_type: str or ~azure.mgmt.databox.v2021_03_01.models.AddressType + """ super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs['street_address1'] - self.street_address2 = kwargs.get('street_address2', None) - self.street_address3 = kwargs.get('street_address3', None) - self.city = kwargs.get('city', None) - self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs['country'] - self.postal_code = kwargs.get('postal_code', None) - self.zip_extended_code = kwargs.get('zip_extended_code', None) - self.company_name = kwargs.get('company_name', None) - self.address_type = kwargs.get('address_type', None) + self.street_address1 = street_address1 + self.street_address2 = street_address2 + self.street_address3 = street_address3 + self.city = city + self.state_or_province = state_or_province + self.country = country + self.postal_code = postal_code + self.zip_extended_code = zip_extended_code + self.company_name = company_name + self.address_type = address_type class Sku(msrest.serialization.Model): @@ -3179,13 +4043,13 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :vartype name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :ivar display_name: The display name of the sku. + :vartype display_name: str + :ivar family: The sku family. + :vartype family: str """ _validation = { @@ -3200,12 +4064,25 @@ class Sku(msrest.serialization.Model): def __init__( self, + *, + name: Union[str, "SkuName"], + display_name: Optional[str] = None, + family: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :keyword display_name: The display name of the sku. + :paramtype display_name: str + :keyword family: The sku family. + :paramtype family: str + """ super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.display_name = kwargs.get('display_name', None) - self.family = kwargs.get('family', None) + self.name = name + self.display_name = display_name + self.family = family class SkuAvailabilityValidationRequest(ValidationInputRequest): @@ -3213,23 +4090,24 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str + :vartype location: str """ _validation = { @@ -3250,14 +4128,33 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): def __init__( self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + country: str, + location: str, **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + """ super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str - self.device_type = kwargs['device_type'] - self.transfer_type = kwargs['transfer_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] + self.device_type = device_type + self.transfer_type = transfer_type + self.country = country + self.location = location class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): @@ -3267,16 +4164,17 @@ class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_03_01.models.ValidationStatus """ _validation = { @@ -3295,6 +4193,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str self.status = None @@ -3325,6 +4225,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None @@ -3361,6 +4263,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None @@ -3373,21 +4277,21 @@ class SkuInformation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~azure.mgmt.databox.v2021_03_01.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool :ivar data_location_to_service_location_map: The map of data location to service location. :vartype data_location_to_service_location_map: - list[~azure.mgmt.databox.models.DataLocationToServiceLocationMap] + list[~azure.mgmt.databox.v2021_03_01.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2021_03_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~azure.mgmt.databox.v2021_03_01.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :vartype disabled_reason: str or ~azure.mgmt.databox.v2021_03_01.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -3422,6 +4326,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None @@ -3439,18 +4345,18 @@ class StorageAccountDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param storage_account_id: Required. Storage Account Resource Id. - :type storage_account_id: str + :vartype share_password: str + :ivar storage_account_id: Required. Storage Account Resource Id. + :vartype storage_account_id: str """ _validation = { @@ -3466,11 +4372,25 @@ class StorageAccountDetails(DataAccountDetails): def __init__( self, + *, + storage_account_id: str, + share_password: Optional[str] = None, **kwargs ): - super(StorageAccountDetails, self).__init__(**kwargs) + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword storage_account_id: Required. Storage Account Resource Id. + :paramtype storage_account_id: str + """ + super(StorageAccountDetails, self).__init__(share_password=share_password, **kwargs) self.data_account_type = 'StorageAccount' # type: str - self.storage_account_id = kwargs['storage_account_id'] + self.storage_account_id = storage_account_id class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): @@ -3478,11 +4398,12 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator """ _validation = { @@ -3497,6 +4418,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str @@ -3508,16 +4431,17 @@ class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInp All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_03_01.models.CloudError :ivar status: Validation status of subscription permission to create job. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_03_01.models.ValidationStatus """ _validation = { @@ -3536,23 +4460,79 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str self.status = None +class SystemData(msrest.serialization.Model): + """Provides details about resource creation and update time. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_by: A string identifier for the identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource: user, application, + managedIdentity. + :vartype created_by_type: str + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: A string identifier for the identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource: user, + application, managedIdentity. + :vartype last_modified_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None + + class TransferAllDetails(msrest.serialization.Model): """Details to transfer all data. All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: + :ivar data_account_type: Required. Type of the account of data. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :type transfer_all_blobs: bool - :param transfer_all_files: To indicate if all Azure Files have to be transferred. - :type transfer_all_files: bool + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.models.DataAccountType + :ivar transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :vartype transfer_all_blobs: bool + :ivar transfer_all_files: To indicate if all Azure Files have to be transferred. + :vartype transfer_all_files: bool """ _validation = { @@ -3567,12 +4547,25 @@ class TransferAllDetails(msrest.serialization.Model): def __init__( self, + *, + data_account_type: Union[str, "DataAccountType"], + transfer_all_blobs: Optional[bool] = None, + transfer_all_files: Optional[bool] = None, **kwargs ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.models.DataAccountType + :keyword transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :paramtype transfer_all_blobs: bool + :keyword transfer_all_files: To indicate if all Azure Files have to be transferred. + :paramtype transfer_all_files: bool + """ super(TransferAllDetails, self).__init__(**kwargs) - self.data_account_type = kwargs['data_account_type'] - self.transfer_all_blobs = kwargs.get('transfer_all_blobs', None) - self.transfer_all_files = kwargs.get('transfer_all_files', None) + self.data_account_type = data_account_type + self.transfer_all_blobs = transfer_all_blobs + self.transfer_all_files = transfer_all_files class TransferConfiguration(msrest.serialization.Model): @@ -3580,16 +4573,18 @@ class TransferConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible + :ivar transfer_configuration_type: Required. Type of the configuration for transfer. Possible values include: "TransferAll", "TransferUsingFilter". - :type transfer_configuration_type: str or ~azure.mgmt.databox.models.TransferConfigurationType - :param transfer_filter_details: Map of filter type and the details to filter. This field is + :vartype transfer_configuration_type: str or + ~azure.mgmt.databox.v2021_03_01.models.TransferConfigurationType + :ivar transfer_filter_details: Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - :type transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :param transfer_all_details: Map of filter type and the details to transfer all data. This - field is required only if the TransferConfigurationType is given as TransferAll. - :type transfer_all_details: ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails + :vartype transfer_filter_details: + ~azure.mgmt.databox.v2021_03_01.models.TransferConfigurationTransferFilterDetails + :ivar transfer_all_details: Map of filter type and the details to transfer all data. This field + is required only if the TransferConfigurationType is given as TransferAll. + :vartype transfer_all_details: + ~azure.mgmt.databox.v2021_03_01.models.TransferConfigurationTransferAllDetails """ _validation = { @@ -3604,19 +4599,37 @@ class TransferConfiguration(msrest.serialization.Model): def __init__( self, + *, + transfer_configuration_type: Union[str, "TransferConfigurationType"], + transfer_filter_details: Optional["TransferConfigurationTransferFilterDetails"] = None, + transfer_all_details: Optional["TransferConfigurationTransferAllDetails"] = None, **kwargs ): + """ + :keyword transfer_configuration_type: Required. Type of the configuration for transfer. + Possible values include: "TransferAll", "TransferUsingFilter". + :paramtype transfer_configuration_type: str or + ~azure.mgmt.databox.v2021_03_01.models.TransferConfigurationType + :keyword transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :paramtype transfer_filter_details: + ~azure.mgmt.databox.v2021_03_01.models.TransferConfigurationTransferFilterDetails + :keyword transfer_all_details: Map of filter type and the details to transfer all data. This + field is required only if the TransferConfigurationType is given as TransferAll. + :paramtype transfer_all_details: + ~azure.mgmt.databox.v2021_03_01.models.TransferConfigurationTransferAllDetails + """ super(TransferConfiguration, self).__init__(**kwargs) - self.transfer_configuration_type = kwargs['transfer_configuration_type'] - self.transfer_filter_details = kwargs.get('transfer_filter_details', None) - self.transfer_all_details = kwargs.get('transfer_all_details', None) + self.transfer_configuration_type = transfer_configuration_type + self.transfer_filter_details = transfer_filter_details + self.transfer_all_details = transfer_all_details class TransferConfigurationTransferAllDetails(msrest.serialization.Model): """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. - :param include: Details to transfer all data. - :type include: ~azure.mgmt.databox.models.TransferAllDetails + :ivar include: Details to transfer all data. + :vartype include: ~azure.mgmt.databox.v2021_03_01.models.TransferAllDetails """ _attribute_map = { @@ -3625,17 +4638,23 @@ class TransferConfigurationTransferAllDetails(msrest.serialization.Model): def __init__( self, + *, + include: Optional["TransferAllDetails"] = None, **kwargs ): + """ + :keyword include: Details to transfer all data. + :paramtype include: ~azure.mgmt.databox.v2021_03_01.models.TransferAllDetails + """ super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) - self.include = kwargs.get('include', None) + self.include = include class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - :param include: Details of the filtering the transfer of data. - :type include: ~azure.mgmt.databox.models.TransferFilterDetails + :ivar include: Details of the filtering the transfer of data. + :vartype include: ~azure.mgmt.databox.v2021_03_01.models.TransferFilterDetails """ _attribute_map = { @@ -3644,10 +4663,16 @@ class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): def __init__( self, + *, + include: Optional["TransferFilterDetails"] = None, **kwargs ): + """ + :keyword include: Details of the filtering the transfer of data. + :paramtype include: ~azure.mgmt.databox.v2021_03_01.models.TransferFilterDetails + """ super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) - self.include = kwargs.get('include', None) + self.include = include class TransferFilterDetails(msrest.serialization.Model): @@ -3655,15 +4680,16 @@ class TransferFilterDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: + :ivar data_account_type: Required. Type of the account of data. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param blob_filter_details: Filter details to transfer blobs. - :type blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :param azure_file_filter_details: Filter details to transfer Azure files. - :type azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :param filter_file_details: Details of the filter files to be used for data transfer. - :type filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.models.DataAccountType + :ivar blob_filter_details: Filter details to transfer blobs. + :vartype blob_filter_details: ~azure.mgmt.databox.v2021_03_01.models.BlobFilterDetails + :ivar azure_file_filter_details: Filter details to transfer Azure files. + :vartype azure_file_filter_details: + ~azure.mgmt.databox.v2021_03_01.models.AzureFileFilterDetails + :ivar filter_file_details: Details of the filter files to be used for data transfer. + :vartype filter_file_details: list[~azure.mgmt.databox.v2021_03_01.models.FilterFileDetails] """ _validation = { @@ -3679,13 +4705,30 @@ class TransferFilterDetails(msrest.serialization.Model): def __init__( self, + *, + data_account_type: Union[str, "DataAccountType"], + blob_filter_details: Optional["BlobFilterDetails"] = None, + azure_file_filter_details: Optional["AzureFileFilterDetails"] = None, + filter_file_details: Optional[List["FilterFileDetails"]] = None, **kwargs ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or ~azure.mgmt.databox.v2021_03_01.models.DataAccountType + :keyword blob_filter_details: Filter details to transfer blobs. + :paramtype blob_filter_details: ~azure.mgmt.databox.v2021_03_01.models.BlobFilterDetails + :keyword azure_file_filter_details: Filter details to transfer Azure files. + :paramtype azure_file_filter_details: + ~azure.mgmt.databox.v2021_03_01.models.AzureFileFilterDetails + :keyword filter_file_details: Details of the filter files to be used for data transfer. + :paramtype filter_file_details: list[~azure.mgmt.databox.v2021_03_01.models.FilterFileDetails] + """ super(TransferFilterDetails, self).__init__(**kwargs) - self.data_account_type = kwargs['data_account_type'] - self.blob_filter_details = kwargs.get('blob_filter_details', None) - self.azure_file_filter_details = kwargs.get('azure_file_filter_details', None) - self.filter_file_details = kwargs.get('filter_file_details', None) + self.data_account_type = data_account_type + self.blob_filter_details = blob_filter_details + self.azure_file_filter_details = azure_file_filter_details + self.filter_file_details = filter_file_details class TransportAvailabilityDetails(msrest.serialization.Model): @@ -3695,7 +4738,7 @@ class TransportAvailabilityDetails(msrest.serialization.Model): :ivar shipment_type: Transport Shipment Type supported for given region. Possible values include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype shipment_type: str or ~azure.mgmt.databox.v2021_03_01.models.TransportShipmentTypes """ _validation = { @@ -3710,6 +4753,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityDetails, self).__init__(**kwargs) self.shipment_type = None @@ -3717,9 +4762,9 @@ def __init__( class TransportAvailabilityRequest(msrest.serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + :ivar sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName """ _attribute_map = { @@ -3728,10 +4773,17 @@ class TransportAvailabilityRequest(msrest.serialization.Model): def __init__( self, + *, + sku_name: Optional[Union[str, "SkuName"]] = None, **kwargs ): + """ + :keyword sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype sku_name: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + """ super(TransportAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = kwargs.get('sku_name', None) + self.sku_name = sku_name class TransportAvailabilityResponse(msrest.serialization.Model): @@ -3741,7 +4793,7 @@ class TransportAvailabilityResponse(msrest.serialization.Model): :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~azure.mgmt.databox.v2021_03_01.models.TransportAvailabilityDetails] """ _validation = { @@ -3756,6 +4808,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityResponse, self).__init__(**kwargs) self.transport_availability_details = None @@ -3765,9 +4819,10 @@ class TransportPreferences(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + :ivar preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype preferred_shipment_type: str or + ~azure.mgmt.databox.v2021_03_01.models.TransportShipmentTypes """ _validation = { @@ -3780,10 +4835,18 @@ class TransportPreferences(msrest.serialization.Model): def __init__( self, + *, + preferred_shipment_type: Union[str, "TransportShipmentTypes"], **kwargs ): + """ + :keyword preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :paramtype preferred_shipment_type: str or + ~azure.mgmt.databox.v2021_03_01.models.TransportShipmentTypes + """ super(TransportPreferences, self).__init__(**kwargs) - self.preferred_shipment_type = kwargs['preferred_shipment_type'] + self.preferred_shipment_type = preferred_shipment_type class UnencryptedCredentials(msrest.serialization.Model): @@ -3794,7 +4857,7 @@ class UnencryptedCredentials(msrest.serialization.Model): :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2021_03_01.models.JobSecrets """ _validation = { @@ -3811,6 +4874,8 @@ def __init__( self, **kwargs ): + """ + """ super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None @@ -3819,10 +4884,10 @@ def __init__( class UnencryptedCredentialsList(msrest.serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :ivar value: List of unencrypted credentials. + :vartype value: list[~azure.mgmt.databox.v2021_03_01.models.UnencryptedCredentials] + :ivar next_link: Link for the next set of unencrypted credentials. + :vartype next_link: str """ _attribute_map = { @@ -3832,22 +4897,31 @@ class UnencryptedCredentialsList(msrest.serialization.Model): def __init__( self, + *, + value: Optional[List["UnencryptedCredentials"]] = None, + next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of unencrypted credentials. + :paramtype value: list[~azure.mgmt.databox.v2021_03_01.models.UnencryptedCredentials] + :keyword next_link: Link for the next set of unencrypted credentials. + :paramtype next_link: str + """ super(UnencryptedCredentialsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = value + self.next_link = next_link class UpdateJobDetails(msrest.serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param key_encryption_key: Key encryption key for the job. - :type key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar contact_details: Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress + :ivar key_encryption_key: Key encryption key for the job. + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey """ _attribute_map = { @@ -3858,12 +4932,24 @@ class UpdateJobDetails(msrest.serialization.Model): def __init__( self, + *, + contact_details: Optional["ContactDetails"] = None, + shipping_address: Optional["ShippingAddress"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, **kwargs ): + """ + :keyword contact_details: Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_03_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress + :keyword key_encryption_key: Key encryption key for the job. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_03_01.models.KeyEncryptionKey + """ super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = kwargs.get('contact_details', None) - self.shipping_address = kwargs.get('shipping_address', None) - self.key_encryption_key = kwargs.get('key_encryption_key', None) + self.contact_details = contact_details + self.shipping_address = shipping_address + self.key_encryption_key = key_encryption_key class UserAssignedIdentity(msrest.serialization.Model): @@ -3891,6 +4977,8 @@ def __init__( self, **kwargs ): + """ + """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -3899,8 +4987,8 @@ def __init__( class UserAssignedProperties(msrest.serialization.Model): """User assigned identity properties. - :param resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. - :type resource_id: str + :ivar resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :vartype resource_id: str """ _attribute_map = { @@ -3909,10 +4997,16 @@ class UserAssignedProperties(msrest.serialization.Model): def __init__( self, + *, + resource_id: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :paramtype resource_id: str + """ super(UserAssignedProperties, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = resource_id class ValidateAddress(ValidationInputRequest): @@ -3920,18 +5014,19 @@ class ValidateAddress(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_03_01.models.ValidationInputDiscriminator + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :vartype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2021_03_01.models.TransportPreferences """ _validation = { @@ -3949,13 +5044,26 @@ class ValidateAddress(ValidationInputRequest): def __init__( self, + *, + shipping_address: "ShippingAddress", + device_type: Union[str, "SkuName"], + transport_preferences: Optional["TransportPreferences"] = None, **kwargs ): + """ + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_03_01.models.ShippingAddress + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_03_01.models.SkuName + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2021_03_01.models.TransportPreferences + """ super(ValidateAddress, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str - self.shipping_address = kwargs['shipping_address'] - self.device_type = kwargs['device_type'] - self.transport_preferences = kwargs.get('transport_preferences', None) + self.shipping_address = shipping_address + self.device_type = device_type + self.transport_preferences = transport_preferences class ValidationResponse(msrest.serialization.Model): @@ -3965,10 +5073,11 @@ class ValidationResponse(msrest.serialization.Model): :ivar status: Overall validation status. Possible values include: "AllValidToProceed", "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_03_01.models.OverallValidationStatus :ivar individual_response_details: List of response details contain validationType and its response as key and value respectively. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] + :vartype individual_response_details: + list[~azure.mgmt.databox.v2021_03_01.models.ValidationInputResponse] """ _validation = { @@ -3985,6 +5094,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationResponse, self).__init__(**kwargs) self.status = None self.individual_response_details = None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/__init__.py new file mode 100644 index 000000000000..bd13cc67afb6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._jobs_operations import JobsOperations +from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin +from ._service_operations import ServiceOperations + +__all__ = [ + 'Operations', + 'JobsOperations', + 'DataBoxManagementClientOperationsMixin', + 'ServiceOperations', +] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_data_box_management_client_operations.py new file mode 100644 index 000000000000..aeca6cd0c57f --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_data_box_management_client_operations.py @@ -0,0 +1,129 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_mitigate_request( + job_name: str, + subscription_id: str, + resource_group_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate') + path_format_arguments = { + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class DataBoxManagementClientOperationsMixin(object): + + @distributed_trace + def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: "_models.MitigateJobRequest", + **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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. + :type mitigate_job_request: ~azure.mgmt.databox.v2021_03_01.models.MitigateJobRequest + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(mitigate_job_request, 'MitigateJobRequest') + + request = build_mitigate_request( + job_name=job_name, + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + content_type=content_type, + json=_json, + template_url=self.mitigate.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + 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'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_jobs_operations.py new file mode 100644 index 000000000000..34cd5df6e239 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_jobs_operations.py @@ -0,0 +1,1153 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_book_shipment_pick_up_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_credentials_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class JobsOperations(object): + """JobsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_03_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: + """Lists all the jobs available under the subscription. + + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": + """Gets information about the specified job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_03_01.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + def _create_initial( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource: Job details from request body. + :type job_resource: ~azure.mgmt.databox.v2021_03_01.models.JobResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_03_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2021_03_01.models.JobResourceUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_03_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + if_match=if_match, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. + :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_03_01.models.ShipmentPickUpRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_03_01.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + + @distributed_trace + def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param cancellation_reason: Reason for cancellation. + :type cancellation_reason: ~azure.mgmt.databox.v2021_03_01.models.CancellationReason + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + + @distributed_trace + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentialsList"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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("UnencryptedCredentialsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_operations.py new file mode 100644 index 000000000000..7d2decd92d69 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_operations.py @@ -0,0 +1,135 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +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: + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.DataBox/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_03_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.OperationList"]: + """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 OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_service_operations.py new file mode 100644 index 000000000000..ee26cbeedc71 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/operations/_service_operations.py @@ -0,0 +1,688 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_available_skus_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_address_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class ServiceOperations(object): + """ServiceOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_03_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> Iterable["_models.AvailableSkusResult"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param available_sku_request: Filters for showing the available skus. + :type available_sku_request: ~azure.mgmt.databox.v2021_03_01.models.AvailableSkuRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_03_01.models.AvailableSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + + @distributed_trace + def validate_address( + self, + location: str, + validate_address: "_models.ValidateAddress", + **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. + :type location: str + :param validate_address: Shipping address of the customer. + :type validate_address: ~azure.mgmt.databox.v2021_03_01.models.ValidateAddress + :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.v2021_03_01.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') + + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_03_01.models.ValidationRequest + :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.v2021_03_01.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def validate_inputs( + self, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_03_01.models.ValidationRequest + :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.v2021_03_01.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def region_configuration( + self, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationRequest + :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.v2021_03_01.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_03_01.models.RegionConfigurationRequest + :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.v2021_03_01.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_03_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/__init__.py new file mode 100644 index 000000000000..72afe00aa0a1 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/__init__.py @@ -0,0 +1,18 @@ +# 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 +__all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_configuration.py new file mode 100644 index 000000000000..de368f8d8904 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_configuration.py @@ -0,0 +1,68 @@ +# 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): + """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. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + 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 = "2021-05-01" + 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 # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_data_box_management_client.py new file mode 100644 index 000000000000..adcd205a438e --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_data_box_management_client.py @@ -0,0 +1,99 @@ +# 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, Optional, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +from . import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): + """The DataBox Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databox.v2021_05_01.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databox.v2021_05_01.operations.JobsOperations + :ivar service: ServiceOperations operations + :vartype service: azure.mgmt.databox.v2021_05_01.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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(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, # type: 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/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_metadata.json new file mode 100644 index 000000000000..629fbdb00dd8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_metadata.json @@ -0,0 +1,122 @@ +{ + "chosen_version": "2021-05-01", + "total_api_version_list": ["2021-05-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": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The Subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The Subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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" + }, + "operation_mixins": { + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "operations": { + "mitigate" : { + "sync": { + "signature": "def mitigate(\n self,\n job_name, # type: str\n resource_group_name, # type: str\n mitigate_job_request, # type: \"_models.MitigateJobRequest\"\n **kwargs # type: Any\n):\n # type: (...) -\u003e None\n", + "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n:type job_name: str\n:param resource_group_name: The Resource Group Name.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def mitigate(\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: \"_models.MitigateJobRequest\",\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n:type job_name: str\n:param resource_group_name: The Resource Group Name.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "job_name, resource_group_name, mitigate_job_request" + } + } + } +} \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/_version.py @@ -0,0 +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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/__init__.py new file mode 100644 index 000000000000..c57c5574bdd0 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/__init__.py @@ -0,0 +1,15 @@ +# 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 +__all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_configuration.py new file mode 100644 index 000000000000..366a20dbcbd8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class DataBoxManagementClientConfiguration(Configuration): + """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. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + 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 = "2021-05-01" + 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) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_data_box_management_client.py new file mode 100644 index 000000000000..f7a048f3ed3f --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_data_box_management_client.py @@ -0,0 +1,96 @@ +# 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, Optional, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from .. import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): + """The DataBox Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databox.v2021_05_01.aio.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databox.v2021_05_01.aio.operations.JobsOperations + :ivar service: ServiceOperations operations + :vartype service: azure.mgmt.databox.v2021_05_01.aio.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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(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/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/__init__.py new file mode 100644 index 000000000000..bd13cc67afb6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._jobs_operations import JobsOperations +from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin +from ._service_operations import ServiceOperations + +__all__ = [ + 'Operations', + 'JobsOperations', + 'DataBoxManagementClientOperationsMixin', + 'ServiceOperations', +] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_data_box_management_client_operations.py new file mode 100644 index 000000000000..f11fe16c6a19 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_data_box_management_client_operations.py @@ -0,0 +1,82 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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_async import distributed_trace_async +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 +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DataBoxManagementClientOperationsMixin: + + @distributed_trace_async + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: "_models.MitigateJobRequest", + **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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. + :type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(mitigate_job_request, 'MitigateJobRequest') + + request = build_mitigate_request( + job_name=job_name, + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + content_type=content_type, + json=_json, + template_url=self.mitigate.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + 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'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_jobs_operations.py new file mode 100644 index 000000000000..ebe530053b4a --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_jobs_operations.py @@ -0,0 +1,793 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +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.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._jobs_operations import build_book_shipment_pick_up_request, build_cancel_request, build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_credentials_request, build_list_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_05_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.JobResourceList"]: + """Lists all the jobs available under the subscription. + + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.JobResourceList"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": + """Gets information about the specified job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_05_01.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + async def _create_initial( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.JobResource"]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource: Job details from request body. + :type job_resource: ~azure.mgmt.databox.v2021_05_01.models.JobResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_05_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller["_models.JobResource"]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2021_05_01.models.JobResourceUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_05_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + if_match=if_match, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. + :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_05_01.models.ShipmentPickUpRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_05_01.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + + @distributed_trace_async + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param cancellation_reason: Reason for cancellation. + :type cancellation_reason: ~azure.mgmt.databox.v2021_05_01.models.CancellationReason + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + + @distributed_trace + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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("UnencryptedCredentialsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_operations.py new file mode 100644 index 000000000000..af1ed901417c --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_operations.py @@ -0,0 +1,110 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.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: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_05_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationList"]: + """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 OperationList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_service_operations.py new file mode 100644 index 000000000000..76cf1e7eac27 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/aio/operations/_service_operations.py @@ -0,0 +1,428 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.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, 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: + """ServiceOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_05_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> AsyncIterable["_models.AvailableSkusResult"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param available_sku_request: Filters for showing the available skus. + :type available_sku_request: ~azure.mgmt.databox.v2021_05_01.models.AvailableSkuRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_05_01.models.AvailableSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + @distributed_trace_async + async def validate_address( + self, + location: str, + validate_address: "_models.ValidateAddress", + **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. + :type location: str + :param validate_address: Shipping address of the customer. + :type validate_address: ~azure.mgmt.databox.v2021_05_01.models.ValidateAddress + :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.v2021_05_01.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') + + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_05_01.models.ValidationRequest + :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.v2021_05_01.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def validate_inputs( + self, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_05_01.models.ValidationRequest + :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.v2021_05_01.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def region_configuration( + self, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationRequest + :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.v2021_05_01.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationRequest + :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.v2021_05_01.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/__init__.py new file mode 100644 index 000000000000..d03afb65c2d7 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/__init__.py @@ -0,0 +1,273 @@ +# 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 EncryptionPreferences +from ._models_py3 import ErrorDetail +from ._models_py3 import FilterFileDetails +from ._models_py3 import HeavyScheduleAvailabilityRequest +from ._models_py3 import IdentityProperties +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 LastMitigationActionOnJob +from ._models_py3 import ManagedDiskDetails +from ._models_py3 import MitigateJobRequest +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 SystemData +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 UserAssignedIdentity +from ._models_py3 import UserAssignedProperties +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, + AddressType, + AddressValidationStatus, + ClassDiscriminator, + CopyStatus, + CustomerResolutionCode, + DataAccountType, + DoubleEncryption, + FilterFileType, + JobDeliveryType, + KekType, + LogCollectionLevel, + NotificationStageName, + OverallValidationStatus, + ShareDestinationFormatType, + SkuDisabledReason, + SkuName, + StageName, + StageStatus, + TransferConfigurationType, + TransferType, + TransportShipmentTypes, + ValidationInputDiscriminator, + ValidationStatus, +) + +__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', + 'EncryptionPreferences', + 'ErrorDetail', + 'FilterFileDetails', + 'HeavyScheduleAvailabilityRequest', + 'IdentityProperties', + 'JobDeliveryInfo', + 'JobDetails', + 'JobResource', + 'JobResourceList', + 'JobResourceUpdateParameter', + 'JobSecrets', + 'JobStages', + 'KeyEncryptionKey', + 'LastMitigationActionOnJob', + 'ManagedDiskDetails', + 'MitigateJobRequest', + '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', + 'SystemData', + 'TransferAllDetails', + 'TransferConfiguration', + 'TransferConfigurationTransferAllDetails', + 'TransferConfigurationTransferFilterDetails', + 'TransferFilterDetails', + 'TransportAvailabilityDetails', + 'TransportAvailabilityRequest', + 'TransportAvailabilityResponse', + 'TransportPreferences', + 'UnencryptedCredentials', + 'UnencryptedCredentialsList', + 'UpdateJobDetails', + 'UserAssignedIdentity', + 'UserAssignedProperties', + 'ValidateAddress', + 'ValidationInputRequest', + 'ValidationInputResponse', + 'ValidationRequest', + 'ValidationResponse', + 'AccessProtocol', + 'AddressType', + 'AddressValidationStatus', + 'ClassDiscriminator', + 'CopyStatus', + 'CustomerResolutionCode', + 'DataAccountType', + 'DoubleEncryption', + 'FilterFileType', + 'JobDeliveryType', + 'KekType', + 'LogCollectionLevel', + 'NotificationStageName', + 'OverallValidationStatus', + 'ShareDestinationFormatType', + 'SkuDisabledReason', + 'SkuName', + 'StageName', + 'StageStatus', + 'TransferConfigurationType', + 'TransferType', + 'TransportShipmentTypes', + 'ValidationInputDiscriminator', + 'ValidationStatus', +] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_data_box_management_client_enums.py new file mode 100644 index 000000000000..eb3eb0e7c0be --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_data_box_management_client_enums.py @@ -0,0 +1,335 @@ +# 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 six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class AccessProtocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + +class AddressType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of address. + """ + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + +class AddressValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The address validation status. + """ + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + +class ClassDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the type of job details. + """ + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + +class CopyStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The Status of the copy + """ + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + +class CustomerResolutionCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: No Resolution Yet. + NONE = "None" + #: Clean the device. + MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" + #: Resume the job to same stage. + RESUME = "Resume" + +class DataAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the account. + """ + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + +class DoubleEncryption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Defines secondary layer of software-based encryption enablement. + """ + + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" + +class FilterFileType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the filter file. + """ + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + +class JobDeliveryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Delivery type of Job. + """ + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + +class KekType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of encryption key used for key encryption. + """ + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + +class LogCollectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Level of the logs to be collected. + """ + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + +class NotificationStageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage. + """ + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + +class OverallValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Overall validation status. + """ + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + +class ShareDestinationFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the share. + """ + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + +class SkuDisabledReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Reason why the Sku is disabled. + """ + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + +class StageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage which is in progress. + """ + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + +class StageStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Status of the job stage. + """ + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + #: Stage is waiting for customer action for kek action items. + WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" + #: Stage is waiting for customer action for clean up. + WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" + #: Stage has performed customer action for clean up. + CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" + +class TransferConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the configuration for transfer. + """ + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + +class TransferType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the transfer. + """ + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + +class TransportShipmentTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Transport Shipment Type supported for given region. + """ + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + +class ValidationInputDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Identifies the type of validation request. + """ + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + +class ValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Create order limit validation status. + """ + + #: Validation is successful. + VALID = "Valid" + #: Validation is not successful. + INVALID = "Invalid" + #: Validation is skipped. + SKIPPED = "Skipped" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_models_py3.py similarity index 51% rename from sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models.py rename to sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_models_py3.py index eae813d0281c..69b1401693e4 100644 --- a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_04_01/models/_models.py +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/models/_models_py3.py @@ -6,9 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime +from typing import Any, Dict, List, Optional, Union + from azure.core.exceptions import HttpResponseError import msrest.serialization +from ._data_box_management_client_enums import * + class AccountCredentialDetails(msrest.serialization.Model): """Credential details of the account. @@ -19,12 +24,13 @@ class AccountCredentialDetails(msrest.serialization.Model): :vartype account_name: str :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.models.DataAccountType :ivar account_connection_string: Connection string of the account endpoint to use the account as a storage endpoint on the device. :vartype account_connection_string: str :ivar share_credential_details: Per share level unencrypted access credentials. - :vartype share_credential_details: list[~azure.mgmt.databox.models.ShareCredentialDetails] + :vartype share_credential_details: + list[~azure.mgmt.databox.v2021_05_01.models.ShareCredentialDetails] """ _validation = { @@ -45,6 +51,8 @@ def __init__( self, **kwargs ): + """ + """ super(AccountCredentialDetails, self).__init__(**kwargs) self.account_name = None self.data_account_type = None @@ -55,10 +63,10 @@ def __init__( class AdditionalErrorInfo(msrest.serialization.Model): """Additional error info. - :param type: Additional error type. - :type type: str - :param info: Additional error info. - :type info: object + :ivar type: Additional error type. + :vartype type: str + :ivar info: Additional error info. + :vartype info: any """ _attribute_map = { @@ -68,11 +76,20 @@ class AdditionalErrorInfo(msrest.serialization.Model): def __init__( self, + *, + type: Optional[str] = None, + info: Optional[Any] = None, **kwargs ): + """ + :keyword type: Additional error type. + :paramtype type: str + :keyword info: Additional error info. + :paramtype info: any + """ super(AdditionalErrorInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.info = kwargs.get('info', None) + self.type = type + self.info = info class AddressValidationOutput(msrest.serialization.Model): @@ -80,18 +97,20 @@ class AddressValidationOutput(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param validation_type: Identifies the type of validation response.Constant filled by server. + :ivar validation_type: Identifies the type of validation response.Constant filled by server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2021_05_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_05_01.models.ShippingAddress] """ _validation = { @@ -111,6 +130,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationOutput, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -128,13 +149,14 @@ class ValidationInputResponse(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError """ _validation = { @@ -155,6 +177,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputResponse, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] self.error = None @@ -167,18 +191,20 @@ class AddressValidationProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError :ivar validation_status: The address validation status. Possible values include: "Valid", "Invalid", "Ambiguous". - :vartype validation_status: str or ~azure.mgmt.databox.models.AddressValidationStatus + :vartype validation_status: str or + ~azure.mgmt.databox.v2021_05_01.models.AddressValidationStatus :ivar alternate_addresses: List of alternate addresses. - :vartype alternate_addresses: list[~azure.mgmt.databox.models.ShippingAddress] + :vartype alternate_addresses: list[~azure.mgmt.databox.v2021_05_01.models.ShippingAddress] """ _validation = { @@ -199,6 +225,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddressValidationProperties, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str self.validation_status = None @@ -210,8 +238,8 @@ class ApiError(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param error: Required. - :type error: ~azure.mgmt.databox.models.ErrorDetail + :ivar error: Required. + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.ErrorDetail """ _validation = { @@ -224,10 +252,16 @@ class ApiError(msrest.serialization.Model): def __init__( self, + *, + error: "ErrorDetail", **kwargs ): + """ + :keyword error: Required. + :paramtype error: ~azure.mgmt.databox.v2021_05_01.models.ErrorDetail + """ super(ApiError, self).__init__(**kwargs) - self.error = kwargs['error'] + self.error = error class ApplianceNetworkConfiguration(msrest.serialization.Model): @@ -255,6 +289,8 @@ def __init__( self, **kwargs ): + """ + """ super(ApplianceNetworkConfiguration, self).__init__(**kwargs) self.name = None self.mac_address = None @@ -289,6 +325,8 @@ def __init__( self, **kwargs ): + """ + """ super(ArmBaseObject, self).__init__(**kwargs) self.name = None self.id = None @@ -300,17 +338,17 @@ class AvailableSkuRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str - :param sku_names: Sku Names to filter for available skus. - :type sku_names: list[str or ~azure.mgmt.databox.models.SkuName] + :vartype location: str + :ivar sku_names: Sku Names to filter for available skus. + :vartype sku_names: list[str or ~azure.mgmt.databox.v2021_05_01.models.SkuName] """ _validation = { @@ -328,13 +366,31 @@ class AvailableSkuRequest(msrest.serialization.Model): def __init__( self, + *, + transfer_type: Union[str, "TransferType"], + country: str, + location: str, + sku_names: Optional[List[Union[str, "SkuName"]]] = None, **kwargs ): + """ + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + :keyword sku_names: Sku Names to filter for available skus. + :paramtype sku_names: list[str or ~azure.mgmt.databox.v2021_05_01.models.SkuName] + """ super(AvailableSkuRequest, self).__init__(**kwargs) - self.transfer_type = kwargs['transfer_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] - self.sku_names = kwargs.get('sku_names', None) + self.transfer_type = transfer_type + self.country = country + self.location = location + self.sku_names = sku_names class AvailableSkusResult(msrest.serialization.Model): @@ -343,9 +399,9 @@ class AvailableSkusResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of available skus. - :vartype value: list[~azure.mgmt.databox.models.SkuInformation] - :param next_link: Link for the next set of skus. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2021_05_01.models.SkuInformation] + :ivar next_link: Link for the next set of skus. + :vartype next_link: str """ _validation = { @@ -359,22 +415,28 @@ class AvailableSkusResult(msrest.serialization.Model): def __init__( self, + *, + next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of skus. + :paramtype next_link: str + """ super(AvailableSkusResult, self).__init__(**kwargs) self.value = None - self.next_link = kwargs.get('next_link', None) + self.next_link = next_link class AzureFileFilterDetails(msrest.serialization.Model): """Filter details to transfer Azure files. - :param file_prefix_list: Prefix list of the Azure files to be transferred. - :type file_prefix_list: list[str] - :param file_path_list: List of full path of the files to be transferred. - :type file_path_list: list[str] - :param file_share_list: List of file shares to be transferred. - :type file_share_list: list[str] + :ivar file_prefix_list: Prefix list of the Azure files to be transferred. + :vartype file_prefix_list: list[str] + :ivar file_path_list: List of full path of the files to be transferred. + :vartype file_path_list: list[str] + :ivar file_share_list: List of file shares to be transferred. + :vartype file_share_list: list[str] """ _attribute_map = { @@ -385,23 +447,35 @@ class AzureFileFilterDetails(msrest.serialization.Model): def __init__( self, + *, + file_prefix_list: Optional[List[str]] = None, + file_path_list: Optional[List[str]] = None, + file_share_list: Optional[List[str]] = None, **kwargs ): + """ + :keyword file_prefix_list: Prefix list of the Azure files to be transferred. + :paramtype file_prefix_list: list[str] + :keyword file_path_list: List of full path of the files to be transferred. + :paramtype file_path_list: list[str] + :keyword file_share_list: List of file shares to be transferred. + :paramtype file_share_list: list[str] + """ super(AzureFileFilterDetails, self).__init__(**kwargs) - self.file_prefix_list = kwargs.get('file_prefix_list', None) - self.file_path_list = kwargs.get('file_path_list', None) - self.file_share_list = kwargs.get('file_share_list', None) + self.file_prefix_list = file_prefix_list + self.file_path_list = file_path_list + self.file_share_list = file_share_list class BlobFilterDetails(msrest.serialization.Model): """Filter details to transfer Azure Blobs. - :param blob_prefix_list: Prefix list of the Azure blobs to be transferred. - :type blob_prefix_list: list[str] - :param blob_path_list: List of full path of the blobs to be transferred. - :type blob_path_list: list[str] - :param container_list: List of blob containers to be transferred. - :type container_list: list[str] + :ivar blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :vartype blob_prefix_list: list[str] + :ivar blob_path_list: List of full path of the blobs to be transferred. + :vartype blob_path_list: list[str] + :ivar container_list: List of blob containers to be transferred. + :vartype container_list: list[str] """ _attribute_map = { @@ -412,12 +486,24 @@ class BlobFilterDetails(msrest.serialization.Model): def __init__( self, + *, + blob_prefix_list: Optional[List[str]] = None, + blob_path_list: Optional[List[str]] = None, + container_list: Optional[List[str]] = None, **kwargs ): + """ + :keyword blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :paramtype blob_prefix_list: list[str] + :keyword blob_path_list: List of full path of the blobs to be transferred. + :paramtype blob_path_list: list[str] + :keyword container_list: List of blob containers to be transferred. + :paramtype container_list: list[str] + """ super(BlobFilterDetails, self).__init__(**kwargs) - self.blob_prefix_list = kwargs.get('blob_prefix_list', None) - self.blob_path_list = kwargs.get('blob_path_list', None) - self.container_list = kwargs.get('container_list', None) + self.blob_prefix_list = blob_prefix_list + self.blob_path_list = blob_path_list + self.container_list = container_list class CancellationReason(msrest.serialization.Model): @@ -425,8 +511,8 @@ class CancellationReason(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param reason: Required. Reason for cancellation. - :type reason: str + :ivar reason: Required. Reason for cancellation. + :vartype reason: str """ _validation = { @@ -439,10 +525,16 @@ class CancellationReason(msrest.serialization.Model): def __init__( self, + *, + reason: str, **kwargs ): + """ + :keyword reason: Required. Reason for cancellation. + :paramtype reason: str + """ super(CancellationReason, self).__init__(**kwargs) - self.reason = kwargs['reason'] + self.reason = reason class CloudError(msrest.serialization.Model): @@ -450,16 +542,16 @@ class CloudError(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: Cloud error code. - :type code: str - :param message: Cloud error message. - :type message: str - :param target: Cloud error target. - :type target: str + :ivar code: Cloud error code. + :vartype code: str + :ivar message: Cloud error message. + :vartype message: str + :ivar target: Cloud error target. + :vartype target: str :ivar details: Cloud error details. - :vartype details: list[~azure.mgmt.databox.models.CloudError] + :vartype details: list[~azure.mgmt.databox.v2021_05_01.models.CloudError] :ivar additional_info: Cloud error additional info. - :vartype additional_info: list[~azure.mgmt.databox.models.AdditionalErrorInfo] + :vartype additional_info: list[~azure.mgmt.databox.v2021_05_01.models.AdditionalErrorInfo] """ _validation = { @@ -477,12 +569,24 @@ class CloudError(msrest.serialization.Model): def __init__( self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, **kwargs ): + """ + :keyword code: Cloud error code. + :paramtype code: str + :keyword message: Cloud error message. + :paramtype message: str + :keyword target: Cloud error target. + :paramtype target: str + """ super(CloudError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) + self.code = code + self.message = message + self.target = target self.details = None self.additional_info = None @@ -492,18 +596,19 @@ class ContactDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param contact_name: Required. Contact name of the person. - :type contact_name: str - :param phone: Required. Phone number of the contact person. - :type phone: str - :param phone_extension: Phone extension number of the contact person. - :type phone_extension: str - :param mobile: Mobile number of the contact person. - :type mobile: str - :param email_list: Required. List of Email-ids to be notified about job progress. - :type email_list: list[str] - :param notification_preference: Notification preference for a job stage. - :type notification_preference: list[~azure.mgmt.databox.models.NotificationPreference] + :ivar contact_name: Required. Contact name of the person. + :vartype contact_name: str + :ivar phone: Required. Phone number of the contact person. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: Required. List of Email-ids to be notified about job progress. + :vartype email_list: list[str] + :ivar notification_preference: Notification preference for a job stage. + :vartype notification_preference: + list[~azure.mgmt.databox.v2021_05_01.models.NotificationPreference] """ _validation = { @@ -523,15 +628,37 @@ class ContactDetails(msrest.serialization.Model): def __init__( self, + *, + contact_name: str, + phone: str, + email_list: List[str], + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + notification_preference: Optional[List["NotificationPreference"]] = None, **kwargs ): + """ + :keyword contact_name: Required. Contact name of the person. + :paramtype contact_name: str + :keyword phone: Required. Phone number of the contact person. + :paramtype phone: str + :keyword phone_extension: Phone extension number of the contact person. + :paramtype phone_extension: str + :keyword mobile: Mobile number of the contact person. + :paramtype mobile: str + :keyword email_list: Required. List of Email-ids to be notified about job progress. + :paramtype email_list: list[str] + :keyword notification_preference: Notification preference for a job stage. + :paramtype notification_preference: + list[~azure.mgmt.databox.v2021_05_01.models.NotificationPreference] + """ super(ContactDetails, self).__init__(**kwargs) - self.contact_name = kwargs['contact_name'] - self.phone = kwargs['phone'] - self.phone_extension = kwargs.get('phone_extension', None) - self.mobile = kwargs.get('mobile', None) - self.email_list = kwargs['email_list'] - self.notification_preference = kwargs.get('notification_preference', None) + self.contact_name = contact_name + self.phone = phone + self.phone_extension = phone_extension + self.mobile = mobile + self.email_list = email_list + self.notification_preference = notification_preference class CopyLogDetails(msrest.serialization.Model): @@ -542,9 +669,10 @@ class CopyLogDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator """ _validation = { @@ -563,6 +691,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = None # type: Optional[str] @@ -577,10 +707,10 @@ class CopyProgress(msrest.serialization.Model): :vartype storage_account_name: str :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", "ExportFromAzure". - :vartype transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", "ManagedDisk". - :vartype data_account_type: str or ~azure.mgmt.databox.models.DataAccountType + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.models.DataAccountType :ivar account_id: Id of the account where the data needs to be uploaded. :vartype account_id: str :ivar bytes_processed: To indicate bytes transferred. @@ -651,6 +781,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyProgress, self).__init__(**kwargs) self.storage_account_name = None self.transfer_type = None @@ -677,12 +809,13 @@ class ValidationRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :vartype individual_request_details: + list[~azure.mgmt.databox.v2021_05_01.models.ValidationInputRequest] """ _validation = { @@ -701,11 +834,19 @@ class ValidationRequest(msrest.serialization.Model): def __init__( self, + *, + individual_request_details: List["ValidationInputRequest"], **kwargs ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2021_05_01.models.ValidationInputRequest] + """ super(ValidationRequest, self).__init__(**kwargs) self.validation_category = None # type: Optional[str] - self.individual_request_details = kwargs['individual_request_details'] + self.individual_request_details = individual_request_details class CreateJobValidations(ValidationRequest): @@ -713,12 +854,13 @@ class CreateJobValidations(ValidationRequest): All required parameters must be populated in order to send to Azure. - :param validation_category: Required. Identify the nature of validation.Constant filled by + :ivar validation_category: Required. Identify the nature of validation.Constant filled by server. - :type validation_category: str - :param individual_request_details: Required. List of request details contain validationType and + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and its request as key and value respectively. - :type individual_request_details: list[~azure.mgmt.databox.models.ValidationInputRequest] + :vartype individual_request_details: + list[~azure.mgmt.databox.v2021_05_01.models.ValidationInputRequest] """ _validation = { @@ -733,9 +875,17 @@ class CreateJobValidations(ValidationRequest): def __init__( self, + *, + individual_request_details: List["ValidationInputRequest"], **kwargs ): - super(CreateJobValidations, self).__init__(**kwargs) + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2021_05_01.models.ValidationInputRequest] + """ + super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) self.validation_category = 'JobCreationValidation' # type: str @@ -747,11 +897,12 @@ class ValidationInputRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator """ _validation = { @@ -770,6 +921,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationInputRequest, self).__init__(**kwargs) self.validation_type = None # type: Optional[str] @@ -779,14 +932,15 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName """ _validation = { @@ -801,11 +955,18 @@ class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): def __init__( self, + *, + device_type: Union[str, "SkuName"], **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + """ super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str - self.device_type = kwargs['device_type'] + self.device_type = device_type class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): @@ -815,16 +976,17 @@ class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInpu All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError :ivar status: Create order limit validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_05_01.models.ValidationStatus """ _validation = { @@ -843,6 +1005,8 @@ def __init__( self, **kwargs ): + """ + """ super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateCreateOrderLimit' # type: str self.status = None @@ -856,16 +1020,16 @@ class DataAccountDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str + :vartype share_password: str """ _validation = { @@ -883,11 +1047,22 @@ class DataAccountDetails(msrest.serialization.Model): def __init__( self, + *, + share_password: Optional[str] = None, **kwargs ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + """ super(DataAccountDetails, self).__init__(**kwargs) self.data_account_type = None # type: Optional[str] - self.share_password = kwargs.get('share_password', None) + self.share_password = share_password class DataBoxAccountCopyLogDetails(CopyLogDetails): @@ -897,9 +1072,10 @@ class DataBoxAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -927,6 +1103,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBox' # type: str self.account_name = None @@ -941,9 +1119,10 @@ class DataBoxDiskCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator :ivar disk_serial_number: Disk Serial Number. :vartype disk_serial_number: str :ivar error_log_link: Link for copy error logs. @@ -970,6 +1149,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxDisk' # type: str self.disk_serial_number = None @@ -991,7 +1172,7 @@ class DataBoxDiskCopyProgress(msrest.serialization.Model): :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData". - :vartype status: str or ~azure.mgmt.databox.models.CopyStatus + :vartype status: str or ~azure.mgmt.databox.v2021_05_01.models.CopyStatus """ _validation = { @@ -1012,6 +1193,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskCopyProgress, self).__init__(**kwargs) self.serial_number = None self.bytes_copied = None @@ -1030,35 +1213,40 @@ class JobDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2021_05_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_05_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_05_01.models.LastMitigationActionOnJob """ _validation = { @@ -1070,7 +1258,8 @@ class JobDetails(msrest.serialization.Model): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, } _attribute_map = { @@ -1087,7 +1276,9 @@ class JobDetails(msrest.serialization.Model): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, } _subtype_map = { @@ -1096,23 +1287,50 @@ class JobDetails(msrest.serialization.Model): def __init__( self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, **kwargs ): + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ super(JobDetails, self).__init__(**kwargs) self.job_stages = None - self.contact_details = kwargs['contact_details'] - self.shipping_address = kwargs.get('shipping_address', None) + self.contact_details = contact_details + self.shipping_address = shipping_address self.delivery_package = None self.return_package = None - self.data_import_details = kwargs.get('data_import_details', None) - self.data_export_details = kwargs.get('data_export_details', None) + self.data_import_details = data_import_details + self.data_export_details = data_export_details self.job_details_type = None # type: Optional[str] - self.preferences = kwargs.get('preferences', None) + self.preferences = preferences self.copy_log_details = None self.reverse_shipment_label_sas_key = None self.chain_of_custody_sas_key = None - self.key_encryption_key = None - self.expected_data_size_in_terabytes = kwargs.get('expected_data_size_in_terabytes', None) + self.key_encryption_key = key_encryption_key + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes + self.actions = None + self.last_mitigation_action_on_job = None class DataBoxDiskJobDetails(JobDetails): @@ -1123,46 +1341,51 @@ class DataBoxDiskJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2021_05_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_05_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int - :param preferred_disks: User preference on what size disks are needed for the job. The map is + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_05_01.models.LastMitigationActionOnJob + :ivar preferred_disks: User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. - :type preferred_disks: dict[str, int] + :vartype preferred_disks: dict[str, int] :ivar copy_progress: Copy progress per disk. - :vartype copy_progress: list[~azure.mgmt.databox.models.DataBoxDiskCopyProgress] + :vartype copy_progress: list[~azure.mgmt.databox.v2021_05_01.models.DataBoxDiskCopyProgress] :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. :vartype disks_and_size_details: dict[str, int] - :param passkey: User entered passkey for DataBox Disk job. - :type passkey: str + :ivar passkey: User entered passkey for DataBox Disk job. + :vartype passkey: str """ _validation = { @@ -1174,7 +1397,8 @@ class DataBoxDiskJobDetails(JobDetails): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, 'copy_progress': {'readonly': True}, 'disks_and_size_details': {'readonly': True}, } @@ -1193,7 +1417,9 @@ class DataBoxDiskJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, @@ -1202,14 +1428,47 @@ class DataBoxDiskJobDetails(JobDetails): def __init__( self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + preferred_disks: Optional[Dict[str, int]] = None, + passkey: Optional[str] = None, **kwargs ): - super(DataBoxDiskJobDetails, self).__init__(**kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. + :paramtype preferred_disks: dict[str, int] + :keyword passkey: User entered passkey for DataBox Disk job. + :paramtype passkey: str + """ + super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBoxDisk' # type: str - self.preferred_disks = kwargs.get('preferred_disks', None) + self.preferred_disks = preferred_disks self.copy_progress = None self.disks_and_size_details = None - self.passkey = kwargs.get('passkey', None) + self.passkey = passkey class JobSecrets(msrest.serialization.Model): @@ -1222,13 +1481,13 @@ class JobSecrets(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_05_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError """ _validation = { @@ -1251,6 +1510,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobSecrets, self).__init__(**kwargs) self.job_secrets_type = None # type: Optional[str] self.dc_access_security_code = None @@ -1264,15 +1525,15 @@ class DataBoxDiskJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_05_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError :ivar disk_secrets: Contains the list of secrets object for that device. - :vartype disk_secrets: list[~azure.mgmt.databox.models.DiskSecret] + :vartype disk_secrets: list[~azure.mgmt.databox.v2021_05_01.models.DiskSecret] :ivar pass_key: PassKey for the disk Job. :vartype pass_key: str :ivar is_passkey_user_defined: Whether passkey was provided by user. @@ -1301,6 +1562,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxDiskJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxDisk' # type: str self.disk_secrets = None @@ -1315,9 +1578,10 @@ class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): All required parameters must be populated in order to send to Azure. - :param copy_log_details_type: Required. Indicates the type of job details.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type copy_log_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator :ivar account_name: Account name. :vartype account_name: str :ivar copy_log_link: Link for copy logs. @@ -1345,6 +1609,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) self.copy_log_details_type = 'DataBoxHeavy' # type: str self.account_name = None @@ -1360,44 +1626,49 @@ class DataBoxHeavyJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2021_05_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_05_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_05_01.models.LastMitigationActionOnJob :ivar copy_progress: Copy progress per account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox Heavy. Should not be passed + :vartype copy_progress: list[~azure.mgmt.databox.v2021_05_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox Heavy. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str + :vartype device_password: str """ _validation = { @@ -1409,7 +1680,8 @@ class DataBoxHeavyJobDetails(JobDetails): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, 'copy_progress': {'readonly': True}, } @@ -1427,19 +1699,54 @@ class DataBoxHeavyJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } def __init__( self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + device_password: Optional[str] = None, **kwargs ): - super(DataBoxHeavyJobDetails, self).__init__(**kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBoxHeavy' # type: str self.copy_progress = None - self.device_password = kwargs.get('device_password', None) + self.device_password = device_password class DataBoxHeavyJobSecrets(JobSecrets): @@ -1449,15 +1756,15 @@ class DataBoxHeavyJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_05_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. - :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.models.DataBoxHeavySecret] + :vartype cabinet_pod_secrets: list[~azure.mgmt.databox.v2021_05_01.models.DataBoxHeavySecret] """ _validation = { @@ -1478,6 +1785,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBoxHeavy' # type: str self.cabinet_pod_secrets = None @@ -1493,12 +1802,14 @@ class DataBoxHeavySecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2021_05_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2021_05_01.models.AccountCredentialDetails] """ _validation = { @@ -1521,6 +1832,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxHeavySecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1537,44 +1850,49 @@ class DataBoxJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. :ivar job_stages: List of stages that run in the job. - :vartype job_stages: list[~azure.mgmt.databox.models.JobStages] - :param contact_details: Required. Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress + :vartype job_stages: list[~azure.mgmt.databox.v2021_05_01.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress :ivar delivery_package: Delivery package shipping details. - :vartype delivery_package: ~azure.mgmt.databox.models.PackageShippingDetails + :vartype delivery_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails :ivar return_package: Return package shipping details. - :vartype return_package: ~azure.mgmt.databox.models.PackageShippingDetails - :param data_import_details: Details of the data to be imported into azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param data_export_details: Details of the data to be exported from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param job_details_type: Required. Indicates the type of job details.Constant filled by server. + :vartype return_package: ~azure.mgmt.databox.v2021_05_01.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_details_type: str or ~azure.mgmt.databox.models.ClassDiscriminator - :param preferences: Preferences for the order. - :type preferences: ~azure.mgmt.databox.models.Preferences + :vartype job_details_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences :ivar copy_log_details: List of copy log details. - :vartype copy_log_details: list[~azure.mgmt.databox.models.CopyLogDetails] + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_05_01.models.CopyLogDetails] :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. :vartype reverse_shipment_label_sas_key: str :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. :vartype chain_of_custody_sas_key: str :ivar key_encryption_key: Details about which key encryption type is being used. - :vartype key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey - :param expected_data_size_in_terabytes: The expected size of the data, which needs to be + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_05_01.models.LastMitigationActionOnJob :ivar copy_progress: Copy progress per storage account. - :vartype copy_progress: list[~azure.mgmt.databox.models.CopyProgress] - :param device_password: Set Device password for unlocking Databox. Should not be passed for + :vartype copy_progress: list[~azure.mgmt.databox.v2021_05_01.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type device_password: str + :vartype device_password: str """ _validation = { @@ -1586,7 +1904,8 @@ class DataBoxJobDetails(JobDetails): 'copy_log_details': {'readonly': True}, 'reverse_shipment_label_sas_key': {'readonly': True}, 'chain_of_custody_sas_key': {'readonly': True}, - 'key_encryption_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, 'copy_progress': {'readonly': True}, } @@ -1604,19 +1923,54 @@ class DataBoxJobDetails(JobDetails): 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, 'device_password': {'key': 'devicePassword', 'type': 'str'}, } def __init__( self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + device_password: Optional[str] = None, **kwargs ): - super(DataBoxJobDetails, self).__init__(**kwargs) + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_05_01.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) self.job_details_type = 'DataBox' # type: str self.copy_progress = None - self.device_password = kwargs.get('device_password', None) + self.device_password = device_password class DataboxJobSecrets(JobSecrets): @@ -1626,15 +1980,15 @@ class DataboxJobSecrets(JobSecrets): All required parameters must be populated in order to send to Azure. - :param job_secrets_type: Required. Used to indicate what type of job secrets object.Constant - filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type job_secrets_type: str or ~azure.mgmt.databox.models.ClassDiscriminator + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype job_secrets_type: str or ~azure.mgmt.databox.v2021_05_01.models.ClassDiscriminator :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. - :vartype dc_access_security_code: ~azure.mgmt.databox.models.DcAccessSecurityCode + :vartype dc_access_security_code: ~azure.mgmt.databox.v2021_05_01.models.DcAccessSecurityCode :ivar error: Error while fetching the secrets. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param pod_secrets: Contains the list of secret objects for a job. - :type pod_secrets: list[~azure.mgmt.databox.models.DataBoxSecret] + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError + :ivar pod_secrets: Contains the list of secret objects for a job. + :vartype pod_secrets: list[~azure.mgmt.databox.v2021_05_01.models.DataBoxSecret] """ _validation = { @@ -1652,11 +2006,17 @@ class DataboxJobSecrets(JobSecrets): def __init__( self, + *, + pod_secrets: Optional[List["DataBoxSecret"]] = None, **kwargs ): + """ + :keyword pod_secrets: Contains the list of secret objects for a job. + :paramtype pod_secrets: list[~azure.mgmt.databox.v2021_05_01.models.DataBoxSecret] + """ super(DataboxJobSecrets, self).__init__(**kwargs) self.job_secrets_type = 'DataBox' # type: str - self.pod_secrets = kwargs.get('pod_secrets', None) + self.pod_secrets = pod_secrets class ScheduleAvailabilityRequest(msrest.serialization.Model): @@ -1667,14 +2027,14 @@ class ScheduleAvailabilityRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -1694,12 +2054,22 @@ class ScheduleAvailabilityRequest(msrest.serialization.Model): def __init__( self, + *, + storage_location: str, + country: Optional[str] = None, **kwargs ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ super(ScheduleAvailabilityRequest, self).__init__(**kwargs) - self.storage_location = kwargs['storage_location'] + self.storage_location = storage_location self.sku_name = None # type: Optional[str] - self.country = kwargs.get('country', None) + self.country = country class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -1707,14 +2077,14 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -1730,9 +2100,19 @@ class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): def __init__( self, + *, + storage_location: str, + country: Optional[str] = None, **kwargs ): - super(DataBoxScheduleAvailabilityRequest, self).__init__(**kwargs) + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ + super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBox' # type: str @@ -1746,12 +2126,14 @@ class DataBoxSecret(msrest.serialization.Model): :ivar device_password: Password for out of the box experience on device. :vartype device_password: str :ivar network_configurations: Network configuration of the appliance. - :vartype network_configurations: list[~azure.mgmt.databox.models.ApplianceNetworkConfiguration] + :vartype network_configurations: + list[~azure.mgmt.databox.v2021_05_01.models.ApplianceNetworkConfiguration] :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the device. :vartype encoded_validation_cert_pub_key: str :ivar account_credential_details: Per account level access credentials. - :vartype account_credential_details: list[~azure.mgmt.databox.models.AccountCredentialDetails] + :vartype account_credential_details: + list[~azure.mgmt.databox.v2021_05_01.models.AccountCredentialDetails] """ _validation = { @@ -1774,6 +2156,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataBoxSecret, self).__init__(**kwargs) self.device_serial_number = None self.device_password = None @@ -1787,13 +2171,13 @@ class DataExportDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_configuration: Required. Configuration for the data transfer. - :type transfer_configuration: ~azure.mgmt.databox.models.TransferConfiguration - :param log_collection_level: Level of the logs to be collected. Possible values include: - "Error", "Verbose". - :type log_collection_level: str or ~azure.mgmt.databox.models.LogCollectionLevel - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :ivar transfer_configuration: Required. Configuration for the data transfer. + :vartype transfer_configuration: ~azure.mgmt.databox.v2021_05_01.models.TransferConfiguration + :ivar log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". Default value: "Error". + :vartype log_collection_level: str or ~azure.mgmt.databox.v2021_05_01.models.LogCollectionLevel + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2021_05_01.models.DataAccountDetails """ _validation = { @@ -1809,12 +2193,26 @@ class DataExportDetails(msrest.serialization.Model): def __init__( self, + *, + transfer_configuration: "TransferConfiguration", + account_details: "DataAccountDetails", + log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = "Error", **kwargs ): + """ + :keyword transfer_configuration: Required. Configuration for the data transfer. + :paramtype transfer_configuration: ~azure.mgmt.databox.v2021_05_01.models.TransferConfiguration + :keyword log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". Default value: "Error". + :paramtype log_collection_level: str or + ~azure.mgmt.databox.v2021_05_01.models.LogCollectionLevel + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2021_05_01.models.DataAccountDetails + """ super(DataExportDetails, self).__init__(**kwargs) - self.transfer_configuration = kwargs['transfer_configuration'] - self.log_collection_level = kwargs.get('log_collection_level', None) - self.account_details = kwargs['account_details'] + self.transfer_configuration = transfer_configuration + self.log_collection_level = log_collection_level + self.account_details = account_details class DataImportDetails(msrest.serialization.Model): @@ -1822,8 +2220,8 @@ class DataImportDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param account_details: Required. Account details of the data to be transferred. - :type account_details: ~azure.mgmt.databox.models.DataAccountDetails + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2021_05_01.models.DataAccountDetails """ _validation = { @@ -1836,10 +2234,16 @@ class DataImportDetails(msrest.serialization.Model): def __init__( self, + *, + account_details: "DataAccountDetails", **kwargs ): + """ + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2021_05_01.models.DataAccountDetails + """ super(DataImportDetails, self).__init__(**kwargs) - self.account_details = kwargs['account_details'] + self.account_details = account_details class DataLocationToServiceLocationMap(msrest.serialization.Model): @@ -1867,6 +2271,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataLocationToServiceLocationMap, self).__init__(**kwargs) self.data_location = None self.service_location = None @@ -1877,21 +2283,22 @@ class DataTransferDetailsValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param data_export_details: List of DataTransfer details to be used to export data from azure. - :type data_export_details: list[~azure.mgmt.databox.models.DataExportDetails] - :param data_import_details: List of DataTransfer details to be used to import data to azure. - :type data_import_details: list[~azure.mgmt.databox.models.DataImportDetails] - :param device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator + :ivar data_export_details: List of DataTransfer details to be used to export data from azure. + :vartype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :ivar data_import_details: List of DataTransfer details to be used to import data to azure. + :vartype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :ivar device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType """ _validation = { @@ -1910,14 +2317,32 @@ class DataTransferDetailsValidationRequest(ValidationInputRequest): def __init__( self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + data_export_details: Optional[List["DataExportDetails"]] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, **kwargs ): + """ + :keyword data_export_details: List of DataTransfer details to be used to export data from + azure. + :paramtype data_export_details: list[~azure.mgmt.databox.v2021_05_01.models.DataExportDetails] + :keyword data_import_details: List of DataTransfer details to be used to import data to azure. + :paramtype data_import_details: list[~azure.mgmt.databox.v2021_05_01.models.DataImportDetails] + :keyword device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType + """ super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateDataTransferDetails' # type: str - self.data_export_details = kwargs.get('data_export_details', None) - self.data_import_details = kwargs.get('data_import_details', None) - self.device_type = kwargs['device_type'] - self.transfer_type = kwargs['transfer_type'] + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): @@ -1927,16 +2352,17 @@ class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError :ivar status: Data transfer details validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_05_01.models.ValidationStatus """ _validation = { @@ -1955,6 +2381,8 @@ def __init__( self, **kwargs ): + """ + """ super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateDataTransferDetails' # type: str self.status = None @@ -1963,24 +2391,33 @@ def __init__( class DcAccessSecurityCode(msrest.serialization.Model): """Dc access security code. - :param reverse_dc_access_code: Reverse Dc access security code. - :type reverse_dc_access_code: str - :param forward_dc_access_code: Forward Dc access security code. - :type forward_dc_access_code: str + :ivar reverse_dc_access_code: Reverse Dc access security code. + :vartype reverse_dc_access_code: str + :ivar forward_dc_access_code: Forward Dc access security code. + :vartype forward_dc_access_code: str """ _attribute_map = { - 'reverse_dc_access_code': {'key': 'reverseDcAccessCode', 'type': 'str'}, - 'forward_dc_access_code': {'key': 'forwardDcAccessCode', 'type': 'str'}, + 'reverse_dc_access_code': {'key': 'reverseDCAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDCAccessCode', 'type': 'str'}, } def __init__( self, + *, + reverse_dc_access_code: Optional[str] = None, + forward_dc_access_code: Optional[str] = None, **kwargs ): + """ + :keyword reverse_dc_access_code: Reverse Dc access security code. + :paramtype reverse_dc_access_code: str + :keyword forward_dc_access_code: Forward Dc access security code. + :paramtype forward_dc_access_code: str + """ super(DcAccessSecurityCode, self).__init__(**kwargs) - self.reverse_dc_access_code = kwargs.get('reverse_dc_access_code', None) - self.forward_dc_access_code = kwargs.get('forward_dc_access_code', None) + self.reverse_dc_access_code = reverse_dc_access_code + self.forward_dc_access_code = forward_dc_access_code class Details(msrest.serialization.Model): @@ -1988,10 +2425,10 @@ class Details(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str """ _validation = { @@ -2006,11 +2443,20 @@ class Details(msrest.serialization.Model): def __init__( self, + *, + code: str, + message: str, **kwargs ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + """ super(Details, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] + self.code = code + self.message = message class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -2018,39 +2464,53 @@ class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str - :param expected_data_size_in_terabytes: Required. The expected size of the data, which needs to + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs to be transferred in this job, in terabytes. - :type expected_data_size_in_terabytes: int + :vartype expected_data_size_in_tera_bytes: int """ _validation = { 'storage_location': {'required': True}, 'sku_name': {'required': True}, - 'expected_data_size_in_terabytes': {'required': True}, + 'expected_data_size_in_tera_bytes': {'required': True}, } _attribute_map = { 'storage_location': {'key': 'storageLocation', 'type': 'str'}, 'sku_name': {'key': 'skuName', 'type': 'str'}, 'country': {'key': 'country', 'type': 'str'}, - 'expected_data_size_in_terabytes': {'key': 'expectedDataSizeInTerabytes', 'type': 'int'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, } def __init__( self, + *, + storage_location: str, + expected_data_size_in_tera_bytes: int, + country: Optional[str] = None, **kwargs ): - super(DiskScheduleAvailabilityRequest, self).__init__(**kwargs) + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + :keyword expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs + to be transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ + super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBoxDisk' # type: str - self.expected_data_size_in_terabytes = kwargs['expected_data_size_in_terabytes'] + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes class DiskSecret(msrest.serialization.Model): @@ -2079,24 +2539,53 @@ def __init__( self, **kwargs ): + """ + """ super(DiskSecret, self).__init__(**kwargs) self.disk_serial_number = None self.bit_locker_key = None +class EncryptionPreferences(msrest.serialization.Model): + """Preferences related to the Encryption. + + :ivar double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :vartype double_encryption: str or ~azure.mgmt.databox.v2021_05_01.models.DoubleEncryption + """ + + _attribute_map = { + 'double_encryption': {'key': 'doubleEncryption', 'type': 'str'}, + } + + def __init__( + self, + *, + double_encryption: Optional[Union[str, "DoubleEncryption"]] = "Disabled", + **kwargs + ): + """ + :keyword double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :paramtype double_encryption: str or ~azure.mgmt.databox.v2021_05_01.models.DoubleEncryption + """ + super(EncryptionPreferences, self).__init__(**kwargs) + self.double_encryption = double_encryption + + class ErrorDetail(msrest.serialization.Model): """ErrorDetail. All required parameters must be populated in order to send to Azure. - :param code: Required. - :type code: str - :param message: Required. - :type message: str - :param details: - :type details: list[~azure.mgmt.databox.models.Details] - :param target: - :type target: str + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar details: + :vartype details: list[~azure.mgmt.databox.v2021_05_01.models.Details] + :ivar target: + :vartype target: str """ _validation = { @@ -2113,13 +2602,28 @@ class ErrorDetail(msrest.serialization.Model): def __init__( self, + *, + code: str, + message: str, + details: Optional[List["Details"]] = None, + target: Optional[str] = None, **kwargs ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + :keyword details: + :paramtype details: list[~azure.mgmt.databox.v2021_05_01.models.Details] + :keyword target: + :paramtype target: str + """ super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.details = kwargs.get('details', None) - self.target = kwargs.get('target', None) + self.code = code + self.message = message + self.details = details + self.target = target class FilterFileDetails(msrest.serialization.Model): @@ -2127,12 +2631,12 @@ class FilterFileDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param filter_file_type: Required. Type of the filter file. Possible values include: + :ivar filter_file_type: Required. Type of the filter file. Possible values include: "AzureBlob", "AzureFile". - :type filter_file_type: str or ~azure.mgmt.databox.models.FilterFileType - :param filter_file_path: Required. Path of the file that contains the details of all items to + :vartype filter_file_type: str or ~azure.mgmt.databox.v2021_05_01.models.FilterFileType + :ivar filter_file_path: Required. Path of the file that contains the details of all items to transfer. - :type filter_file_path: str + :vartype filter_file_path: str """ _validation = { @@ -2147,11 +2651,22 @@ class FilterFileDetails(msrest.serialization.Model): def __init__( self, + *, + filter_file_type: Union[str, "FilterFileType"], + filter_file_path: str, **kwargs ): + """ + :keyword filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :paramtype filter_file_type: str or ~azure.mgmt.databox.v2021_05_01.models.FilterFileType + :keyword filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :paramtype filter_file_path: str + """ super(FilterFileDetails, self).__init__(**kwargs) - self.filter_file_type = kwargs['filter_file_type'] - self.filter_file_path = kwargs['filter_file_path'] + self.filter_file_type = filter_file_type + self.filter_file_path = filter_file_path class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): @@ -2159,14 +2674,14 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): All required parameters must be populated in order to send to Azure. - :param storage_location: Required. Location for data transfer. For locations check: + :ivar storage_location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type storage_location: str - :param sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by - server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName - :param country: Country in which storage location should be supported. - :type country: str + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str """ _validation = { @@ -2182,17 +2697,59 @@ class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): def __init__( self, + *, + storage_location: str, + country: Optional[str] = None, **kwargs ): - super(HeavyScheduleAvailabilityRequest, self).__init__(**kwargs) + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ + super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) self.sku_name = 'DataBoxHeavy' # type: str +class IdentityProperties(msrest.serialization.Model): + """Managed identity properties. + + :ivar type: Managed service identity type. + :vartype type: str + :ivar user_assigned: User assigned identity properties. + :vartype user_assigned: ~azure.mgmt.databox.v2021_05_01.models.UserAssignedProperties + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned': {'key': 'userAssigned', 'type': 'UserAssignedProperties'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + user_assigned: Optional["UserAssignedProperties"] = None, + **kwargs + ): + """ + :keyword type: Managed service identity type. + :paramtype type: str + :keyword user_assigned: User assigned identity properties. + :paramtype user_assigned: ~azure.mgmt.databox.v2021_05_01.models.UserAssignedProperties + """ + super(IdentityProperties, self).__init__(**kwargs) + self.type = type + self.user_assigned = user_assigned + + class JobDeliveryInfo(msrest.serialization.Model): """Additional delivery info. - :param scheduled_date_time: Scheduled date time. - :type scheduled_date_time: ~datetime.datetime + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime """ _attribute_map = { @@ -2201,10 +2758,16 @@ class JobDeliveryInfo(msrest.serialization.Model): def __init__( self, + *, + scheduled_date_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword scheduled_date_time: Scheduled date time. + :paramtype scheduled_date_time: ~datetime.datetime + """ super(JobDeliveryInfo, self).__init__(**kwargs) - self.scheduled_date_time = kwargs.get('scheduled_date_time', None) + self.scheduled_date_time = scheduled_date_time class Resource(msrest.serialization.Model): @@ -2212,18 +2775,18 @@ class Resource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2021_05_01.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2021_05_01.models.ResourceIdentity """ _validation = { @@ -2240,13 +2803,32 @@ class Resource(msrest.serialization.Model): def __init__( self, + *, + location: str, + sku: "Sku", + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, **kwargs ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2021_05_01.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2021_05_01.models.ResourceIdentity + """ super(Resource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - self.sku = kwargs['sku'] - self.identity = kwargs.get('identity', None) + self.location = location + self.tags = tags + self.sku = sku + self.identity = identity class JobResource(Resource): @@ -2256,27 +2838,29 @@ class JobResource(Resource): All required parameters must be populated in order to send to Azure. - :param location: Required. The location of the resource. This will be one of the supported and + :ivar location: Required. The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed. - :type location: str - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param sku: Required. The sku type. - :type sku: ~azure.mgmt.databox.models.Sku - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2021_05_01.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2021_05_01.models.ResourceIdentity :ivar name: Name of the object. :vartype name: str :ivar id: Id of the object. :vartype id: str :ivar type: Type of the object. :vartype type: str - :param transfer_type: Required. Type of the data transfer. Possible values include: + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.databox.v2021_05_01.models.SystemData + :ivar transfer_type: Required. Type of the data transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType :ivar is_cancellable: Describes whether the job is cancellable or not. :vartype is_cancellable: bool :ivar is_deletable: Describes whether the job is deletable or not. @@ -2290,20 +2874,20 @@ class JobResource(Resource): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype status: str or ~azure.mgmt.databox.models.StageName + :vartype status: str or ~azure.mgmt.databox.v2021_05_01.models.StageName :ivar start_time: Time at which the job was started in UTC ISO 8601 format. :vartype start_time: ~datetime.datetime :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.databox.models.CloudError - :param details: Details of a job run. This field will only be sent for expand details filter. - :type details: ~azure.mgmt.databox.models.JobDetails + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError + :ivar details: Details of a job run. This field will only be sent for expand details filter. + :vartype details: ~azure.mgmt.databox.v2021_05_01.models.JobDetails :ivar cancellation_reason: Reason for cancellation. :vartype cancellation_reason: str - :param delivery_type: Delivery type of Job. Possible values include: "NonScheduled", - "Scheduled". - :type delivery_type: str or ~azure.mgmt.databox.models.JobDeliveryType - :param delivery_info: Delivery Info of Job. - :type delivery_info: ~azure.mgmt.databox.models.JobDeliveryInfo + :ivar delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :vartype delivery_type: str or ~azure.mgmt.databox.v2021_05_01.models.JobDeliveryType + :ivar delivery_info: Delivery Info of Job. + :vartype delivery_info: ~azure.mgmt.databox.v2021_05_01.models.JobDeliveryInfo :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. :vartype is_cancellable_without_fee: bool """ @@ -2314,6 +2898,7 @@ class JobResource(Resource): 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'transfer_type': {'required': True}, 'is_cancellable': {'readonly': True}, 'is_deletable': {'readonly': True}, @@ -2334,6 +2919,7 @@ class JobResource(Resource): 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'transfer_type': {'key': 'properties.transferType', 'type': 'str'}, 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, @@ -2351,13 +2937,47 @@ class JobResource(Resource): def __init__( self, + *, + location: str, + sku: "Sku", + transfer_type: Union[str, "TransferType"], + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + details: Optional["JobDetails"] = None, + delivery_type: Optional[Union[str, "JobDeliveryType"]] = "NonScheduled", + delivery_info: Optional["JobDeliveryInfo"] = None, **kwargs ): - super(JobResource, self).__init__(**kwargs) + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2021_05_01.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2021_05_01.models.ResourceIdentity + :keyword transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType + :keyword details: Details of a job run. This field will only be sent for expand details filter. + :paramtype details: ~azure.mgmt.databox.v2021_05_01.models.JobDetails + :keyword delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :paramtype delivery_type: str or ~azure.mgmt.databox.v2021_05_01.models.JobDeliveryType + :keyword delivery_info: Delivery Info of Job. + :paramtype delivery_info: ~azure.mgmt.databox.v2021_05_01.models.JobDeliveryInfo + """ + super(JobResource, self).__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) self.name = None self.id = None self.type = None - self.transfer_type = kwargs['transfer_type'] + self.system_data = None + self.transfer_type = transfer_type self.is_cancellable = None self.is_deletable = None self.is_shipping_address_editable = None @@ -2365,20 +2985,20 @@ def __init__( self.status = None self.start_time = None self.error = None - self.details = kwargs.get('details', None) + self.details = details self.cancellation_reason = None - self.delivery_type = kwargs.get('delivery_type', None) - self.delivery_info = kwargs.get('delivery_info', None) + self.delivery_type = delivery_type + self.delivery_info = delivery_info self.is_cancellable_without_fee = None class JobResourceList(msrest.serialization.Model): """Job Resource Collection. - :param value: List of job resources. - :type value: list[~azure.mgmt.databox.models.JobResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :ivar value: List of job resources. + :vartype value: list[~azure.mgmt.databox.v2021_05_01.models.JobResource] + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str """ _attribute_map = { @@ -2388,23 +3008,32 @@ class JobResourceList(msrest.serialization.Model): def __init__( self, + *, + value: Optional[List["JobResource"]] = None, + next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of job resources. + :paramtype value: list[~azure.mgmt.databox.v2021_05_01.models.JobResource] + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ super(JobResourceList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = value + self.next_link = next_link class JobResourceUpdateParameter(msrest.serialization.Model): """The JobResourceUpdateParameter. - :param tags: A set of tags. The list of key value pairs that describe the resource. These tags + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). - :type tags: dict[str, str] - :param identity: Msi identity of the resource. - :type identity: ~azure.mgmt.databox.models.ResourceIdentity - :param details: Details of a job to be updated. - :type details: ~azure.mgmt.databox.models.UpdateJobDetails + :vartype tags: dict[str, str] + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2021_05_01.models.ResourceIdentity + :ivar details: Details of a job to be updated. + :vartype details: ~azure.mgmt.databox.v2021_05_01.models.UpdateJobDetails """ _attribute_map = { @@ -2415,12 +3044,25 @@ class JobResourceUpdateParameter(msrest.serialization.Model): def __init__( self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + details: Optional["UpdateJobDetails"] = None, **kwargs ): + """ + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2021_05_01.models.ResourceIdentity + :keyword details: Details of a job to be updated. + :paramtype details: ~azure.mgmt.databox.v2021_05_01.models.UpdateJobDetails + """ super(JobResourceUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.details = kwargs.get('details', None) + self.tags = tags + self.identity = identity + self.details = details class JobStages(msrest.serialization.Model): @@ -2433,17 +3075,18 @@ class JobStages(msrest.serialization.Model): "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC". - :vartype stage_name: str or ~azure.mgmt.databox.models.StageName + :vartype stage_name: str or ~azure.mgmt.databox.v2021_05_01.models.StageName :ivar display_name: Display name of the job stage. :vartype display_name: str :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", - "WaitingForCustomerAction", "SucceededWithWarnings". - :vartype stage_status: str or ~azure.mgmt.databox.models.StageStatus + "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", + "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp". + :vartype stage_status: str or ~azure.mgmt.databox.v2021_05_01.models.StageStatus :ivar stage_time: Time for the job stage in UTC ISO 8601 format. :vartype stage_time: ~datetime.datetime :ivar job_stage_details: Job Stage Details. - :vartype job_stage_details: object + :vartype job_stage_details: any """ _validation = { @@ -2466,6 +3109,8 @@ def __init__( self, **kwargs ): + """ + """ super(JobStages, self).__init__(**kwargs) self.stage_name = None self.display_name = None @@ -2479,14 +3124,16 @@ class KeyEncryptionKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param kek_type: Required. Type of encryption key used for key encryption. Possible values - include: "MicrosoftManaged", "CustomerManaged". - :type kek_type: str or ~azure.mgmt.databox.models.KekType - :param kek_url: Key encryption key. It is required in case of Customer managed KekType. - :type kek_url: str - :param kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + :ivar kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :vartype kek_type: str or ~azure.mgmt.databox.v2021_05_01.models.KekType + :ivar identity_properties: Managed identity properties used for key encryption. + :vartype identity_properties: ~azure.mgmt.databox.v2021_05_01.models.IdentityProperties + :ivar kek_url: Key encryption key. It is required in case of Customer managed KekType. + :vartype kek_url: str + :ivar kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed KekType. - :type kek_vault_resource_id: str + :vartype kek_vault_resource_id: str """ _validation = { @@ -2495,18 +3142,82 @@ class KeyEncryptionKey(msrest.serialization.Model): _attribute_map = { 'kek_type': {'key': 'kekType', 'type': 'str'}, + 'identity_properties': {'key': 'identityProperties', 'type': 'IdentityProperties'}, 'kek_url': {'key': 'kekUrl', 'type': 'str'}, 'kek_vault_resource_id': {'key': 'kekVaultResourceID', 'type': 'str'}, } def __init__( self, + *, + kek_type: Union[str, "KekType"] = "MicrosoftManaged", + identity_properties: Optional["IdentityProperties"] = None, + kek_url: Optional[str] = None, + kek_vault_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :paramtype kek_type: str or ~azure.mgmt.databox.v2021_05_01.models.KekType + :keyword identity_properties: Managed identity properties used for key encryption. + :paramtype identity_properties: ~azure.mgmt.databox.v2021_05_01.models.IdentityProperties + :keyword kek_url: Key encryption key. It is required in case of Customer managed KekType. + :paramtype kek_url: str + :keyword kek_vault_resource_id: Kek vault resource id. It is required in case of Customer + managed KekType. + :paramtype kek_vault_resource_id: str + """ super(KeyEncryptionKey, self).__init__(**kwargs) - self.kek_type = kwargs['kek_type'] - self.kek_url = kwargs.get('kek_url', None) - self.kek_vault_resource_id = kwargs.get('kek_vault_resource_id', None) + self.kek_type = kek_type + self.identity_properties = identity_properties + self.kek_url = kek_url + self.kek_vault_resource_id = kek_vault_resource_id + + +class LastMitigationActionOnJob(msrest.serialization.Model): + """Last Mitigation Action Performed On Job. + + :ivar action_date_time_in_utc: Action performed date time. + :vartype action_date_time_in_utc: ~datetime.datetime + :ivar is_performed_by_customer: Action performed by customer, + possibility is that mitigation might happen by customer or service or by ops. + :vartype is_performed_by_customer: bool + :ivar customer_resolution: Resolution code provided by customer. Possible values include: + "None", "MoveToCleanUpDevice", "Resume". + :vartype customer_resolution: str or + ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode + """ + + _attribute_map = { + 'action_date_time_in_utc': {'key': 'actionDateTimeInUtc', 'type': 'iso-8601'}, + 'is_performed_by_customer': {'key': 'isPerformedByCustomer', 'type': 'bool'}, + 'customer_resolution': {'key': 'customerResolution', 'type': 'str'}, + } + + def __init__( + self, + *, + action_date_time_in_utc: Optional[datetime.datetime] = None, + is_performed_by_customer: Optional[bool] = None, + customer_resolution: Optional[Union[str, "CustomerResolutionCode"]] = None, + **kwargs + ): + """ + :keyword action_date_time_in_utc: Action performed date time. + :paramtype action_date_time_in_utc: ~datetime.datetime + :keyword is_performed_by_customer: Action performed by customer, + possibility is that mitigation might happen by customer or service or by ops. + :paramtype is_performed_by_customer: bool + :keyword customer_resolution: Resolution code provided by customer. Possible values include: + "None", "MoveToCleanUpDevice", "Resume". + :paramtype customer_resolution: str or + ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode + """ + super(LastMitigationActionOnJob, self).__init__(**kwargs) + self.action_date_time_in_utc = action_date_time_in_utc + self.is_performed_by_customer = is_performed_by_customer + self.customer_resolution = customer_resolution class ManagedDiskDetails(DataAccountDetails): @@ -2514,21 +3225,21 @@ class ManagedDiskDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param resource_group_id: Required. Resource Group Id of the compute disks. - :type resource_group_id: str - :param staging_storage_account_id: Required. Resource Id of the storage account that can be - used to copy the vhd for staging. - :type staging_storage_account_id: str + :vartype share_password: str + :ivar resource_group_id: Required. Resource Group Id of the compute disks. + :vartype resource_group_id: str + :ivar staging_storage_account_id: Required. Resource Id of the storage account that can be used + to copy the vhd for staging. + :vartype staging_storage_account_id: str """ _validation = { @@ -2546,12 +3257,65 @@ class ManagedDiskDetails(DataAccountDetails): def __init__( self, + *, + resource_group_id: str, + staging_storage_account_id: str, + share_password: Optional[str] = None, **kwargs ): - super(ManagedDiskDetails, self).__init__(**kwargs) + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword resource_group_id: Required. Resource Group Id of the compute disks. + :paramtype resource_group_id: str + :keyword staging_storage_account_id: Required. Resource Id of the storage account that can be + used to copy the vhd for staging. + :paramtype staging_storage_account_id: str + """ + super(ManagedDiskDetails, self).__init__(share_password=share_password, **kwargs) self.data_account_type = 'ManagedDisk' # type: str - self.resource_group_id = kwargs['resource_group_id'] - self.staging_storage_account_id = kwargs['staging_storage_account_id'] + self.resource_group_id = resource_group_id + self.staging_storage_account_id = staging_storage_account_id + + +class MitigateJobRequest(msrest.serialization.Model): + """The Mitigate Job captured from request body for Mitigate API. + + All required parameters must be populated in order to send to Azure. + + :ivar customer_resolution_code: Required. Resolution code for the job. Possible values include: + "None", "MoveToCleanUpDevice", "Resume". + :vartype customer_resolution_code: str or + ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode + """ + + _validation = { + 'customer_resolution_code': {'required': True}, + } + + _attribute_map = { + 'customer_resolution_code': {'key': 'customerResolutionCode', 'type': 'str'}, + } + + def __init__( + self, + *, + customer_resolution_code: Union[str, "CustomerResolutionCode"], + **kwargs + ): + """ + :keyword customer_resolution_code: Required. Resolution code for the job. Possible values + include: "None", "MoveToCleanUpDevice", "Resume". + :paramtype customer_resolution_code: str or + ~azure.mgmt.databox.v2021_05_01.models.CustomerResolutionCode + """ + super(MitigateJobRequest, self).__init__(**kwargs) + self.customer_resolution_code = customer_resolution_code class NotificationPreference(msrest.serialization.Model): @@ -2559,11 +3323,11 @@ class NotificationPreference(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + :ivar stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". - :type stage_name: str or ~azure.mgmt.databox.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :vartype stage_name: str or ~azure.mgmt.databox.v2021_05_01.models.NotificationStageName + :ivar send_notification: Required. Notification is required or not. + :vartype send_notification: bool """ _validation = { @@ -2578,11 +3342,21 @@ class NotificationPreference(msrest.serialization.Model): def __init__( self, + *, + stage_name: Union[str, "NotificationStageName"], + send_notification: bool = True, **kwargs ): + """ + :keyword stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy". + :paramtype stage_name: str or ~azure.mgmt.databox.v2021_05_01.models.NotificationStageName + :keyword send_notification: Required. Notification is required or not. + :paramtype send_notification: bool + """ super(NotificationPreference, self).__init__(**kwargs) - self.stage_name = kwargs['stage_name'] - self.send_notification = kwargs['send_notification'] + self.stage_name = stage_name + self.send_notification = send_notification class Operation(msrest.serialization.Model): @@ -2594,13 +3368,13 @@ class Operation(msrest.serialization.Model): {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. :vartype name: str :ivar display: Operation display values. - :vartype display: ~azure.mgmt.databox.models.OperationDisplay + :vartype display: ~azure.mgmt.databox.v2021_05_01.models.OperationDisplay :ivar properties: Operation properties. - :vartype properties: object + :vartype properties: any :ivar origin: Origin of the operation. Can be : user|system|user,system. :vartype origin: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool """ _validation = { @@ -2620,27 +3394,33 @@ class Operation(msrest.serialization.Model): def __init__( self, + *, + is_data_action: Optional[bool] = None, **kwargs ): + """ + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + """ super(Operation, self).__init__(**kwargs) self.name = None self.display = None self.properties = None self.origin = None - self.is_data_action = kwargs.get('is_data_action', None) + self.is_data_action = is_data_action class OperationDisplay(msrest.serialization.Model): """Operation display. - :param provider: Provider name. - :type provider: str - :param resource: Resource name. - :type resource: str - :param operation: Localized name of the operation for display purpose. - :type operation: str - :param description: Localized description of the operation for display purpose. - :type description: str + :ivar provider: Provider name. + :vartype provider: str + :ivar resource: Resource name. + :vartype resource: str + :ivar operation: Localized name of the operation for display purpose. + :vartype operation: str + :ivar description: Localized description of the operation for display purpose. + :vartype description: str """ _attribute_map = { @@ -2652,13 +3432,28 @@ class OperationDisplay(msrest.serialization.Model): def __init__( self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Provider name. + :paramtype provider: str + :keyword resource: Resource name. + :paramtype resource: str + :keyword operation: Localized name of the operation for display purpose. + :paramtype operation: str + :keyword description: Localized description of the operation for display purpose. + :paramtype description: str + """ super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description class OperationList(msrest.serialization.Model): @@ -2667,9 +3462,9 @@ class OperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations. - :vartype value: list[~azure.mgmt.databox.models.Operation] - :param next_link: Link for the next set of operations. - :type next_link: str + :vartype value: list[~azure.mgmt.databox.v2021_05_01.models.Operation] + :ivar next_link: Link for the next set of operations. + :vartype next_link: str """ _validation = { @@ -2683,11 +3478,17 @@ class OperationList(msrest.serialization.Model): def __init__( self, + *, + next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: Link for the next set of operations. + :paramtype next_link: str + """ super(OperationList, self).__init__(**kwargs) self.value = None - self.next_link = kwargs.get('next_link', None) + self.next_link = next_link class PackageShippingDetails(msrest.serialization.Model): @@ -2719,6 +3520,8 @@ def __init__( self, **kwargs ): + """ + """ super(PackageShippingDetails, self).__init__(**kwargs) self.carrier_name = None self.tracking_id = None @@ -2728,24 +3531,40 @@ def __init__( class Preferences(msrest.serialization.Model): """Preferences related to the order. - :param preferred_data_center_region: Preferred data center region. - :type preferred_data_center_region: list[str] - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :ivar preferred_data_center_region: Preferred data center region. + :vartype preferred_data_center_region: list[str] + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2021_05_01.models.TransportPreferences + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: ~azure.mgmt.databox.v2021_05_01.models.EncryptionPreferences """ _attribute_map = { 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, + 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, } def __init__( self, + *, + preferred_data_center_region: Optional[List[str]] = None, + transport_preferences: Optional["TransportPreferences"] = None, + encryption_preferences: Optional["EncryptionPreferences"] = None, **kwargs ): + """ + :keyword preferred_data_center_region: Preferred data center region. + :paramtype preferred_data_center_region: list[str] + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2021_05_01.models.TransportPreferences + :keyword encryption_preferences: Preferences related to the Encryption. + :paramtype encryption_preferences: ~azure.mgmt.databox.v2021_05_01.models.EncryptionPreferences + """ super(Preferences, self).__init__(**kwargs) - self.preferred_data_center_region = kwargs.get('preferred_data_center_region', None) - self.transport_preferences = kwargs.get('transport_preferences', None) + self.preferred_data_center_region = preferred_data_center_region + self.transport_preferences = transport_preferences + self.encryption_preferences = encryption_preferences class PreferencesValidationRequest(ValidationInputRequest): @@ -2753,16 +3572,17 @@ class PreferencesValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param preference: Preference of transport and data center. - :type preference: ~azure.mgmt.databox.models.Preferences - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator + :ivar preference: Preference of transport and data center. + :vartype preference: ~azure.mgmt.databox.v2021_05_01.models.Preferences + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName + :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName """ _validation = { @@ -2778,12 +3598,22 @@ class PreferencesValidationRequest(ValidationInputRequest): def __init__( self, + *, + device_type: Union[str, "SkuName"], + preference: Optional["Preferences"] = None, **kwargs ): + """ + :keyword preference: Preference of transport and data center. + :paramtype preference: ~azure.mgmt.databox.v2021_05_01.models.Preferences + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + """ super(PreferencesValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str - self.preference = kwargs.get('preference', None) - self.device_type = kwargs['device_type'] + self.preference = preference + self.device_type = device_type class PreferencesValidationResponseProperties(ValidationInputResponse): @@ -2793,16 +3623,17 @@ class PreferencesValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError :ivar status: Validation status of requested data center and transport. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_05_01.models.ValidationStatus """ _validation = { @@ -2821,6 +3652,8 @@ def __init__( self, **kwargs ): + """ + """ super(PreferencesValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidatePreferences' # type: str self.status = None @@ -2829,12 +3662,14 @@ def __init__( class RegionConfigurationRequest(msrest.serialization.Model): """Request body to get the configuration for the region. - :param schedule_availability_request: Request body to get the availability for scheduling + :ivar schedule_availability_request: Request body to get the availability for scheduling orders. - :type schedule_availability_request: ~azure.mgmt.databox.models.ScheduleAvailabilityRequest - :param transport_availability_request: Request body to get the transport availability for given + :vartype schedule_availability_request: + ~azure.mgmt.databox.v2021_05_01.models.ScheduleAvailabilityRequest + :ivar transport_availability_request: Request body to get the transport availability for given sku. - :type transport_availability_request: ~azure.mgmt.databox.models.TransportAvailabilityRequest + :vartype transport_availability_request: + ~azure.mgmt.databox.v2021_05_01.models.TransportAvailabilityRequest """ _attribute_map = { @@ -2844,11 +3679,24 @@ class RegionConfigurationRequest(msrest.serialization.Model): def __init__( self, + *, + schedule_availability_request: Optional["ScheduleAvailabilityRequest"] = None, + transport_availability_request: Optional["TransportAvailabilityRequest"] = None, **kwargs ): + """ + :keyword schedule_availability_request: Request body to get the availability for scheduling + orders. + :paramtype schedule_availability_request: + ~azure.mgmt.databox.v2021_05_01.models.ScheduleAvailabilityRequest + :keyword transport_availability_request: Request body to get the transport availability for + given sku. + :paramtype transport_availability_request: + ~azure.mgmt.databox.v2021_05_01.models.TransportAvailabilityRequest + """ super(RegionConfigurationRequest, self).__init__(**kwargs) - self.schedule_availability_request = kwargs.get('schedule_availability_request', None) - self.transport_availability_request = kwargs.get('transport_availability_request', None) + self.schedule_availability_request = schedule_availability_request + self.transport_availability_request = transport_availability_request class RegionConfigurationResponse(msrest.serialization.Model): @@ -2858,10 +3706,10 @@ class RegionConfigurationResponse(msrest.serialization.Model): :ivar schedule_availability_response: Schedule availability for given sku in a region. :vartype schedule_availability_response: - ~azure.mgmt.databox.models.ScheduleAvailabilityResponse + ~azure.mgmt.databox.v2021_05_01.models.ScheduleAvailabilityResponse :ivar transport_availability_response: Transport options available for given sku in a region. :vartype transport_availability_response: - ~azure.mgmt.databox.models.TransportAvailabilityResponse + ~azure.mgmt.databox.v2021_05_01.models.TransportAvailabilityResponse """ _validation = { @@ -2878,6 +3726,8 @@ def __init__( self, **kwargs ): + """ + """ super(RegionConfigurationResponse, self).__init__(**kwargs) self.schedule_availability_response = None self.transport_availability_response = None @@ -2888,12 +3738,15 @@ class ResourceIdentity(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param type: Identity type. - :type type: str + :ivar type: Identity type. + :vartype type: str :ivar principal_id: Service Principal Id backing the Msi. :vartype principal_id: str :ivar tenant_id: Home Tenant Id. :vartype tenant_id: str + :ivar user_assigned_identities: User Assigned Identities. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.databox.v2021_05_01.models.UserAssignedIdentity] """ _validation = { @@ -2905,16 +3758,28 @@ class ResourceIdentity(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, } def __init__( self, + *, + type: Optional[str] = "None", + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, **kwargs ): + """ + :keyword type: Identity type. + :paramtype type: str + :keyword user_assigned_identities: User Assigned Identities. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.databox.v2021_05_01.models.UserAssignedIdentity] + """ super(ResourceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) + self.type = type self.principal_id = None self.tenant_id = None + self.user_assigned_identities = user_assigned_identities class ScheduleAvailabilityResponse(msrest.serialization.Model): @@ -2938,6 +3803,8 @@ def __init__( self, **kwargs ): + """ + """ super(ScheduleAvailabilityResponse, self).__init__(**kwargs) self.available_dates = None @@ -2951,13 +3818,14 @@ class ShareCredentialDetails(msrest.serialization.Model): :vartype share_name: str :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". - :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType + :vartype share_type: str or ~azure.mgmt.databox.v2021_05_01.models.ShareDestinationFormatType :ivar user_name: User name for the share. :vartype user_name: str :ivar password: Password for the share. :vartype password: str :ivar supported_access_protocols: Access protocols supported on the device. - :vartype supported_access_protocols: list[str or ~azure.mgmt.databox.models.AccessProtocol] + :vartype supported_access_protocols: list[str or + ~azure.mgmt.databox.v2021_05_01.models.AccessProtocol] """ _validation = { @@ -2980,6 +3848,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShareCredentialDetails, self).__init__(**kwargs) self.share_name = None self.share_type = None @@ -2993,14 +3863,14 @@ class ShipmentPickUpRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param start_time: Required. Minimum date after which the pick up should commence, this must be + :ivar start_time: Required. Minimum date after which the pick up should commence, this must be in local time of pick up area. - :type start_time: ~datetime.datetime - :param end_time: Required. Maximum date before which the pick up should commence, this must be + :vartype start_time: ~datetime.datetime + :ivar end_time: Required. Maximum date before which the pick up should commence, this must be in local time of pick up area. - :type end_time: ~datetime.datetime - :param shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. - :type shipment_location: str + :vartype end_time: ~datetime.datetime + :ivar shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :vartype shipment_location: str """ _validation = { @@ -3017,12 +3887,26 @@ class ShipmentPickUpRequest(msrest.serialization.Model): def __init__( self, + *, + start_time: datetime.datetime, + end_time: datetime.datetime, + shipment_location: str, **kwargs ): + """ + :keyword start_time: Required. Minimum date after which the pick up should commence, this must + be in local time of pick up area. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Required. Maximum date before which the pick up should commence, this must + be in local time of pick up area. + :paramtype end_time: ~datetime.datetime + :keyword shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :paramtype shipment_location: str + """ super(ShipmentPickUpRequest, self).__init__(**kwargs) - self.start_time = kwargs['start_time'] - self.end_time = kwargs['end_time'] - self.shipment_location = kwargs['shipment_location'] + self.start_time = start_time + self.end_time = end_time + self.shipment_location = shipment_location class ShipmentPickUpResponse(msrest.serialization.Model): @@ -3051,6 +3935,8 @@ def __init__( self, **kwargs ): + """ + """ super(ShipmentPickUpResponse, self).__init__(**kwargs) self.confirmation_number = None self.ready_by_time = None @@ -3061,33 +3947,32 @@ class ShippingAddress(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param street_address1: Required. Street Address line 1. - :type street_address1: str - :param street_address2: Street Address line 2. - :type street_address2: str - :param street_address3: Street Address line 3. - :type street_address3: str - :param city: Name of the City. - :type city: str - :param state_or_province: Name of the State or Province. - :type state_or_province: str - :param country: Required. Name of the Country. - :type country: str - :param postal_code: Required. Postal code. - :type postal_code: str - :param zip_extended_code: Extended Zip Code. - :type zip_extended_code: str - :param company_name: Name of the company. - :type company_name: str - :param address_type: Type of address. Possible values include: "None", "Residential", - "Commercial". - :type address_type: str or ~azure.mgmt.databox.models.AddressType + :ivar street_address1: Required. Street Address line 1. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: Required. Name of the Country. + :vartype country: str + :ivar postal_code: Postal code. + :vartype postal_code: str + :ivar zip_extended_code: Extended Zip Code. + :vartype zip_extended_code: str + :ivar company_name: Name of the company. + :vartype company_name: str + :ivar address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :vartype address_type: str or ~azure.mgmt.databox.v2021_05_01.models.AddressType """ _validation = { 'street_address1': {'required': True}, 'country': {'required': True}, - 'postal_code': {'required': True}, } _attribute_map = { @@ -3105,19 +3990,53 @@ class ShippingAddress(msrest.serialization.Model): def __init__( self, + *, + street_address1: str, + country: str, + street_address2: Optional[str] = None, + street_address3: Optional[str] = None, + city: Optional[str] = None, + state_or_province: Optional[str] = None, + postal_code: Optional[str] = None, + zip_extended_code: Optional[str] = None, + company_name: Optional[str] = None, + address_type: Optional[Union[str, "AddressType"]] = "None", **kwargs ): + """ + :keyword street_address1: Required. Street Address line 1. + :paramtype street_address1: str + :keyword street_address2: Street Address line 2. + :paramtype street_address2: str + :keyword street_address3: Street Address line 3. + :paramtype street_address3: str + :keyword city: Name of the City. + :paramtype city: str + :keyword state_or_province: Name of the State or Province. + :paramtype state_or_province: str + :keyword country: Required. Name of the Country. + :paramtype country: str + :keyword postal_code: Postal code. + :paramtype postal_code: str + :keyword zip_extended_code: Extended Zip Code. + :paramtype zip_extended_code: str + :keyword company_name: Name of the company. + :paramtype company_name: str + :keyword address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :paramtype address_type: str or ~azure.mgmt.databox.v2021_05_01.models.AddressType + """ super(ShippingAddress, self).__init__(**kwargs) - self.street_address1 = kwargs['street_address1'] - self.street_address2 = kwargs.get('street_address2', None) - self.street_address3 = kwargs.get('street_address3', None) - self.city = kwargs.get('city', None) - self.state_or_province = kwargs.get('state_or_province', None) - self.country = kwargs['country'] - self.postal_code = kwargs['postal_code'] - self.zip_extended_code = kwargs.get('zip_extended_code', None) - self.company_name = kwargs.get('company_name', None) - self.address_type = kwargs.get('address_type', None) + self.street_address1 = street_address1 + self.street_address2 = street_address2 + self.street_address3 = street_address3 + self.city = city + self.state_or_province = state_or_province + self.country = country + self.postal_code = postal_code + self.zip_extended_code = zip_extended_code + self.company_name = company_name + self.address_type = address_type class Sku(msrest.serialization.Model): @@ -3125,13 +4044,13 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + :ivar name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type name: str or ~azure.mgmt.databox.models.SkuName - :param display_name: The display name of the sku. - :type display_name: str - :param family: The sku family. - :type family: str + :vartype name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :ivar display_name: The display name of the sku. + :vartype display_name: str + :ivar family: The sku family. + :vartype family: str """ _validation = { @@ -3146,12 +4065,25 @@ class Sku(msrest.serialization.Model): def __init__( self, + *, + name: Union[str, "SkuName"], + display_name: Optional[str] = None, + family: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :keyword display_name: The display name of the sku. + :paramtype display_name: str + :keyword family: The sku family. + :paramtype family: str + """ super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.display_name = kwargs.get('display_name', None) - self.family = kwargs.get('family', None) + self.name = name + self.display_name = display_name + self.family = family class SkuAvailabilityValidationRequest(ValidationInputRequest): @@ -3159,23 +4091,24 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", "ExportFromAzure". - :type transfer_type: str or ~azure.mgmt.databox.models.TransferType - :param country: Required. ISO country code. Country for hardware shipment. For codes check: + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. - :type country: str - :param location: Required. Location for data transfer. For locations check: + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. - :type location: str + :vartype location: str """ _validation = { @@ -3196,14 +4129,33 @@ class SkuAvailabilityValidationRequest(ValidationInputRequest): def __init__( self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + country: str, + location: str, **kwargs ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + """ super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str - self.device_type = kwargs['device_type'] - self.transfer_type = kwargs['transfer_type'] - self.country = kwargs['country'] - self.location = kwargs['location'] + self.device_type = device_type + self.transfer_type = transfer_type + self.country = country + self.location = location class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): @@ -3213,16 +4165,17 @@ class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_05_01.models.ValidationStatus """ _validation = { @@ -3241,6 +4194,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSkuAvailability' # type: str self.status = None @@ -3271,6 +4226,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCapacity, self).__init__(**kwargs) self.usable = None self.maximum = None @@ -3307,6 +4264,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuCost, self).__init__(**kwargs) self.meter_id = None self.meter_type = None @@ -3319,21 +4278,21 @@ class SkuInformation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar sku: The Sku. - :vartype sku: ~azure.mgmt.databox.models.Sku + :vartype sku: ~azure.mgmt.databox.v2021_05_01.models.Sku :ivar enabled: The sku is enabled or not. :vartype enabled: bool :ivar data_location_to_service_location_map: The map of data location to service location. :vartype data_location_to_service_location_map: - list[~azure.mgmt.databox.models.DataLocationToServiceLocationMap] + list[~azure.mgmt.databox.v2021_05_01.models.DataLocationToServiceLocationMap] :ivar capacity: Capacity of the Sku. - :vartype capacity: ~azure.mgmt.databox.models.SkuCapacity + :vartype capacity: ~azure.mgmt.databox.v2021_05_01.models.SkuCapacity :ivar costs: Cost of the Sku. - :vartype costs: list[~azure.mgmt.databox.models.SkuCost] + :vartype costs: list[~azure.mgmt.databox.v2021_05_01.models.SkuCost] :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". - :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason + :vartype disabled_reason: str or ~azure.mgmt.databox.v2021_05_01.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. :vartype disabled_reason_message: str :ivar required_feature: Required feature to access the sku. @@ -3368,6 +4327,8 @@ def __init__( self, **kwargs ): + """ + """ super(SkuInformation, self).__init__(**kwargs) self.sku = None self.enabled = None @@ -3385,18 +4346,18 @@ class StorageAccountDetails(DataAccountDetails): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Account Type of the data to be transferred.Constant filled - by server. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param share_password: Password for all the shares to be created on the device. Should not be + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. - :type share_password: str - :param storage_account_id: Required. Storage Account Resource Id. - :type storage_account_id: str + :vartype share_password: str + :ivar storage_account_id: Required. Storage Account Resource Id. + :vartype storage_account_id: str """ _validation = { @@ -3412,11 +4373,25 @@ class StorageAccountDetails(DataAccountDetails): def __init__( self, + *, + storage_account_id: str, + share_password: Optional[str] = None, **kwargs ): - super(StorageAccountDetails, self).__init__(**kwargs) + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword storage_account_id: Required. Storage Account Resource Id. + :paramtype storage_account_id: str + """ + super(StorageAccountDetails, self).__init__(share_password=share_password, **kwargs) self.data_account_type = 'StorageAccount' # type: str - self.storage_account_id = kwargs['storage_account_id'] + self.storage_account_id = storage_account_id class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): @@ -3424,11 +4399,12 @@ class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator """ _validation = { @@ -3443,6 +4419,8 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str @@ -3454,16 +4432,17 @@ class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInp All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation response.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator :ivar error: Error code and message of validation response. - :vartype error: ~azure.mgmt.databox.models.CloudError + :vartype error: ~azure.mgmt.databox.v2021_05_01.models.CloudError :ivar status: Validation status of subscription permission to create job. Possible values include: "Valid", "Invalid", "Skipped". - :vartype status: str or ~azure.mgmt.databox.models.ValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_05_01.models.ValidationStatus """ _validation = { @@ -3482,23 +4461,79 @@ def __init__( self, **kwargs ): + """ + """ super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str self.status = None +class SystemData(msrest.serialization.Model): + """Provides details about resource creation and update time. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_by: A string identifier for the identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource: user, application, + managedIdentity. + :vartype created_by_type: str + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: A string identifier for the identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource: user, + application, managedIdentity. + :vartype last_modified_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None + + class TransferAllDetails(msrest.serialization.Model): """Details to transfer all data. All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: + :ivar data_account_type: Required. Type of the account of data. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param transfer_all_blobs: To indicate if all Azure blobs have to be transferred. - :type transfer_all_blobs: bool - :param transfer_all_files: To indicate if all Azure Files have to be transferred. - :type transfer_all_files: bool + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.models.DataAccountType + :ivar transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :vartype transfer_all_blobs: bool + :ivar transfer_all_files: To indicate if all Azure Files have to be transferred. + :vartype transfer_all_files: bool """ _validation = { @@ -3513,12 +4548,25 @@ class TransferAllDetails(msrest.serialization.Model): def __init__( self, + *, + data_account_type: Union[str, "DataAccountType"], + transfer_all_blobs: Optional[bool] = None, + transfer_all_files: Optional[bool] = None, **kwargs ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.models.DataAccountType + :keyword transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :paramtype transfer_all_blobs: bool + :keyword transfer_all_files: To indicate if all Azure Files have to be transferred. + :paramtype transfer_all_files: bool + """ super(TransferAllDetails, self).__init__(**kwargs) - self.data_account_type = kwargs['data_account_type'] - self.transfer_all_blobs = kwargs.get('transfer_all_blobs', None) - self.transfer_all_files = kwargs.get('transfer_all_files', None) + self.data_account_type = data_account_type + self.transfer_all_blobs = transfer_all_blobs + self.transfer_all_files = transfer_all_files class TransferConfiguration(msrest.serialization.Model): @@ -3526,16 +4574,18 @@ class TransferConfiguration(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param transfer_configuration_type: Required. Type of the configuration for transfer. Possible + :ivar transfer_configuration_type: Required. Type of the configuration for transfer. Possible values include: "TransferAll", "TransferUsingFilter". - :type transfer_configuration_type: str or ~azure.mgmt.databox.models.TransferConfigurationType - :param transfer_filter_details: Map of filter type and the details to filter. This field is + :vartype transfer_configuration_type: str or + ~azure.mgmt.databox.v2021_05_01.models.TransferConfigurationType + :ivar transfer_filter_details: Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - :type transfer_filter_details: - ~azure.mgmt.databox.models.TransferConfigurationTransferFilterDetails - :param transfer_all_details: Map of filter type and the details to transfer all data. This - field is required only if the TransferConfigurationType is given as TransferAll. - :type transfer_all_details: ~azure.mgmt.databox.models.TransferConfigurationTransferAllDetails + :vartype transfer_filter_details: + ~azure.mgmt.databox.v2021_05_01.models.TransferConfigurationTransferFilterDetails + :ivar transfer_all_details: Map of filter type and the details to transfer all data. This field + is required only if the TransferConfigurationType is given as TransferAll. + :vartype transfer_all_details: + ~azure.mgmt.databox.v2021_05_01.models.TransferConfigurationTransferAllDetails """ _validation = { @@ -3550,19 +4600,37 @@ class TransferConfiguration(msrest.serialization.Model): def __init__( self, + *, + transfer_configuration_type: Union[str, "TransferConfigurationType"], + transfer_filter_details: Optional["TransferConfigurationTransferFilterDetails"] = None, + transfer_all_details: Optional["TransferConfigurationTransferAllDetails"] = None, **kwargs ): + """ + :keyword transfer_configuration_type: Required. Type of the configuration for transfer. + Possible values include: "TransferAll", "TransferUsingFilter". + :paramtype transfer_configuration_type: str or + ~azure.mgmt.databox.v2021_05_01.models.TransferConfigurationType + :keyword transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :paramtype transfer_filter_details: + ~azure.mgmt.databox.v2021_05_01.models.TransferConfigurationTransferFilterDetails + :keyword transfer_all_details: Map of filter type and the details to transfer all data. This + field is required only if the TransferConfigurationType is given as TransferAll. + :paramtype transfer_all_details: + ~azure.mgmt.databox.v2021_05_01.models.TransferConfigurationTransferAllDetails + """ super(TransferConfiguration, self).__init__(**kwargs) - self.transfer_configuration_type = kwargs['transfer_configuration_type'] - self.transfer_filter_details = kwargs.get('transfer_filter_details', None) - self.transfer_all_details = kwargs.get('transfer_all_details', None) + self.transfer_configuration_type = transfer_configuration_type + self.transfer_filter_details = transfer_filter_details + self.transfer_all_details = transfer_all_details class TransferConfigurationTransferAllDetails(msrest.serialization.Model): """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. - :param include: Details to transfer all data. - :type include: ~azure.mgmt.databox.models.TransferAllDetails + :ivar include: Details to transfer all data. + :vartype include: ~azure.mgmt.databox.v2021_05_01.models.TransferAllDetails """ _attribute_map = { @@ -3571,17 +4639,23 @@ class TransferConfigurationTransferAllDetails(msrest.serialization.Model): def __init__( self, + *, + include: Optional["TransferAllDetails"] = None, **kwargs ): + """ + :keyword include: Details to transfer all data. + :paramtype include: ~azure.mgmt.databox.v2021_05_01.models.TransferAllDetails + """ super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) - self.include = kwargs.get('include', None) + self.include = include class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. - :param include: Details of the filtering the transfer of data. - :type include: ~azure.mgmt.databox.models.TransferFilterDetails + :ivar include: Details of the filtering the transfer of data. + :vartype include: ~azure.mgmt.databox.v2021_05_01.models.TransferFilterDetails """ _attribute_map = { @@ -3590,10 +4664,16 @@ class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): def __init__( self, + *, + include: Optional["TransferFilterDetails"] = None, **kwargs ): + """ + :keyword include: Details of the filtering the transfer of data. + :paramtype include: ~azure.mgmt.databox.v2021_05_01.models.TransferFilterDetails + """ super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) - self.include = kwargs.get('include', None) + self.include = include class TransferFilterDetails(msrest.serialization.Model): @@ -3601,15 +4681,16 @@ class TransferFilterDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_account_type: Required. Type of the account of data. Possible values include: + :ivar data_account_type: Required. Type of the account of data. Possible values include: "StorageAccount", "ManagedDisk". - :type data_account_type: str or ~azure.mgmt.databox.models.DataAccountType - :param blob_filter_details: Filter details to transfer blobs. - :type blob_filter_details: ~azure.mgmt.databox.models.BlobFilterDetails - :param azure_file_filter_details: Filter details to transfer Azure files. - :type azure_file_filter_details: ~azure.mgmt.databox.models.AzureFileFilterDetails - :param filter_file_details: Details of the filter files to be used for data transfer. - :type filter_file_details: list[~azure.mgmt.databox.models.FilterFileDetails] + :vartype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.models.DataAccountType + :ivar blob_filter_details: Filter details to transfer blobs. + :vartype blob_filter_details: ~azure.mgmt.databox.v2021_05_01.models.BlobFilterDetails + :ivar azure_file_filter_details: Filter details to transfer Azure files. + :vartype azure_file_filter_details: + ~azure.mgmt.databox.v2021_05_01.models.AzureFileFilterDetails + :ivar filter_file_details: Details of the filter files to be used for data transfer. + :vartype filter_file_details: list[~azure.mgmt.databox.v2021_05_01.models.FilterFileDetails] """ _validation = { @@ -3625,13 +4706,30 @@ class TransferFilterDetails(msrest.serialization.Model): def __init__( self, + *, + data_account_type: Union[str, "DataAccountType"], + blob_filter_details: Optional["BlobFilterDetails"] = None, + azure_file_filter_details: Optional["AzureFileFilterDetails"] = None, + filter_file_details: Optional[List["FilterFileDetails"]] = None, **kwargs ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or ~azure.mgmt.databox.v2021_05_01.models.DataAccountType + :keyword blob_filter_details: Filter details to transfer blobs. + :paramtype blob_filter_details: ~azure.mgmt.databox.v2021_05_01.models.BlobFilterDetails + :keyword azure_file_filter_details: Filter details to transfer Azure files. + :paramtype azure_file_filter_details: + ~azure.mgmt.databox.v2021_05_01.models.AzureFileFilterDetails + :keyword filter_file_details: Details of the filter files to be used for data transfer. + :paramtype filter_file_details: list[~azure.mgmt.databox.v2021_05_01.models.FilterFileDetails] + """ super(TransferFilterDetails, self).__init__(**kwargs) - self.data_account_type = kwargs['data_account_type'] - self.blob_filter_details = kwargs.get('blob_filter_details', None) - self.azure_file_filter_details = kwargs.get('azure_file_filter_details', None) - self.filter_file_details = kwargs.get('filter_file_details', None) + self.data_account_type = data_account_type + self.blob_filter_details = blob_filter_details + self.azure_file_filter_details = azure_file_filter_details + self.filter_file_details = filter_file_details class TransportAvailabilityDetails(msrest.serialization.Model): @@ -3641,7 +4739,7 @@ class TransportAvailabilityDetails(msrest.serialization.Model): :ivar shipment_type: Transport Shipment Type supported for given region. Possible values include: "CustomerManaged", "MicrosoftManaged". - :vartype shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype shipment_type: str or ~azure.mgmt.databox.v2021_05_01.models.TransportShipmentTypes """ _validation = { @@ -3656,6 +4754,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityDetails, self).__init__(**kwargs) self.shipment_type = None @@ -3663,9 +4763,9 @@ def __init__( class TransportAvailabilityRequest(msrest.serialization.Model): """Request body to get the transport availability for given sku. - :param sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + :ivar sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type sku_name: str or ~azure.mgmt.databox.models.SkuName + :vartype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName """ _attribute_map = { @@ -3674,10 +4774,17 @@ class TransportAvailabilityRequest(msrest.serialization.Model): def __init__( self, + *, + sku_name: Optional[Union[str, "SkuName"]] = None, **kwargs ): + """ + :keyword sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy". + :paramtype sku_name: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + """ super(TransportAvailabilityRequest, self).__init__(**kwargs) - self.sku_name = kwargs.get('sku_name', None) + self.sku_name = sku_name class TransportAvailabilityResponse(msrest.serialization.Model): @@ -3687,7 +4794,7 @@ class TransportAvailabilityResponse(msrest.serialization.Model): :ivar transport_availability_details: List of transport availability details for given region. :vartype transport_availability_details: - list[~azure.mgmt.databox.models.TransportAvailabilityDetails] + list[~azure.mgmt.databox.v2021_05_01.models.TransportAvailabilityDetails] """ _validation = { @@ -3702,6 +4809,8 @@ def __init__( self, **kwargs ): + """ + """ super(TransportAvailabilityResponse, self).__init__(**kwargs) self.transport_availability_details = None @@ -3711,9 +4820,10 @@ class TransportPreferences(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + :ivar preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". - :type preferred_shipment_type: str or ~azure.mgmt.databox.models.TransportShipmentTypes + :vartype preferred_shipment_type: str or + ~azure.mgmt.databox.v2021_05_01.models.TransportShipmentTypes """ _validation = { @@ -3726,10 +4836,18 @@ class TransportPreferences(msrest.serialization.Model): def __init__( self, + *, + preferred_shipment_type: Union[str, "TransportShipmentTypes"], **kwargs ): + """ + :keyword preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :paramtype preferred_shipment_type: str or + ~azure.mgmt.databox.v2021_05_01.models.TransportShipmentTypes + """ super(TransportPreferences, self).__init__(**kwargs) - self.preferred_shipment_type = kwargs['preferred_shipment_type'] + self.preferred_shipment_type = preferred_shipment_type class UnencryptedCredentials(msrest.serialization.Model): @@ -3740,7 +4858,7 @@ class UnencryptedCredentials(msrest.serialization.Model): :ivar job_name: Name of the job. :vartype job_name: str :ivar job_secrets: Secrets related to this job. - :vartype job_secrets: ~azure.mgmt.databox.models.JobSecrets + :vartype job_secrets: ~azure.mgmt.databox.v2021_05_01.models.JobSecrets """ _validation = { @@ -3757,6 +4875,8 @@ def __init__( self, **kwargs ): + """ + """ super(UnencryptedCredentials, self).__init__(**kwargs) self.job_name = None self.job_secrets = None @@ -3765,10 +4885,10 @@ def __init__( class UnencryptedCredentialsList(msrest.serialization.Model): """List of unencrypted credentials for accessing device. - :param value: List of unencrypted credentials. - :type value: list[~azure.mgmt.databox.models.UnencryptedCredentials] - :param next_link: Link for the next set of unencrypted credentials. - :type next_link: str + :ivar value: List of unencrypted credentials. + :vartype value: list[~azure.mgmt.databox.v2021_05_01.models.UnencryptedCredentials] + :ivar next_link: Link for the next set of unencrypted credentials. + :vartype next_link: str """ _attribute_map = { @@ -3778,22 +4898,31 @@ class UnencryptedCredentialsList(msrest.serialization.Model): def __init__( self, + *, + value: Optional[List["UnencryptedCredentials"]] = None, + next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of unencrypted credentials. + :paramtype value: list[~azure.mgmt.databox.v2021_05_01.models.UnencryptedCredentials] + :keyword next_link: Link for the next set of unencrypted credentials. + :paramtype next_link: str + """ super(UnencryptedCredentialsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = value + self.next_link = next_link class UpdateJobDetails(msrest.serialization.Model): """Job details for update. - :param contact_details: Contact details for notification and shipping. - :type contact_details: ~azure.mgmt.databox.models.ContactDetails - :param shipping_address: Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param key_encryption_key: Key encryption key for the job. - :type key_encryption_key: ~azure.mgmt.databox.models.KeyEncryptionKey + :ivar contact_details: Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress + :ivar key_encryption_key: Key encryption key for the job. + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey """ _attribute_map = { @@ -3804,12 +4933,81 @@ class UpdateJobDetails(msrest.serialization.Model): def __init__( self, + *, + contact_details: Optional["ContactDetails"] = None, + shipping_address: Optional["ShippingAddress"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, **kwargs ): + """ + :keyword contact_details: Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_05_01.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress + :keyword key_encryption_key: Key encryption key for the job. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_05_01.models.KeyEncryptionKey + """ super(UpdateJobDetails, self).__init__(**kwargs) - self.contact_details = kwargs.get('contact_details', None) - self.shipping_address = kwargs.get('shipping_address', None) - self.key_encryption_key = kwargs.get('key_encryption_key', None) + self.contact_details = contact_details + self.shipping_address = shipping_address + self.key_encryption_key = key_encryption_key + + +class UserAssignedIdentity(msrest.serialization.Model): + """Class defining User assigned identity details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class UserAssignedProperties(msrest.serialization.Model): + """User assigned identity properties. + + :ivar resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :vartype resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + **kwargs + ): + """ + :keyword resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :paramtype resource_id: str + """ + super(UserAssignedProperties, self).__init__(**kwargs) + self.resource_id = resource_id class ValidateAddress(ValidationInputRequest): @@ -3817,18 +5015,19 @@ class ValidateAddress(ValidationInputRequest): All required parameters must be populated in order to send to Azure. - :param validation_type: Required. Identifies the type of validation request.Constant filled by - server. Possible values include: "ValidateAddress", - "ValidateSubscriptionIsAllowedToCreateJob", "ValidatePreferences", "ValidateCreateOrderLimit", - "ValidateSkuAvailability", "ValidateDataTransferDetails". - :type validation_type: str or ~azure.mgmt.databox.models.ValidationInputDiscriminator - :param shipping_address: Required. Shipping address of the customer. - :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress - :param device_type: Required. Device type to be used for the job. Possible values include: + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_05_01.models.ValidationInputDiscriminator + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress + :ivar device_type: Required. Device type to be used for the job. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy". - :type device_type: str or ~azure.mgmt.databox.models.SkuName - :param transport_preferences: Preferences related to the shipment logistics of the sku. - :type transport_preferences: ~azure.mgmt.databox.models.TransportPreferences + :vartype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: ~azure.mgmt.databox.v2021_05_01.models.TransportPreferences """ _validation = { @@ -3846,13 +5045,26 @@ class ValidateAddress(ValidationInputRequest): def __init__( self, + *, + shipping_address: "ShippingAddress", + device_type: Union[str, "SkuName"], + transport_preferences: Optional["TransportPreferences"] = None, **kwargs ): + """ + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_05_01.models.ShippingAddress + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_05_01.models.SkuName + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: ~azure.mgmt.databox.v2021_05_01.models.TransportPreferences + """ super(ValidateAddress, self).__init__(**kwargs) self.validation_type = 'ValidateAddress' # type: str - self.shipping_address = kwargs['shipping_address'] - self.device_type = kwargs['device_type'] - self.transport_preferences = kwargs.get('transport_preferences', None) + self.shipping_address = shipping_address + self.device_type = device_type + self.transport_preferences = transport_preferences class ValidationResponse(msrest.serialization.Model): @@ -3862,10 +5074,11 @@ class ValidationResponse(msrest.serialization.Model): :ivar status: Overall validation status. Possible values include: "AllValidToProceed", "InputsRevisitRequired", "CertainInputValidationsSkipped". - :vartype status: str or ~azure.mgmt.databox.models.OverallValidationStatus + :vartype status: str or ~azure.mgmt.databox.v2021_05_01.models.OverallValidationStatus :ivar individual_response_details: List of response details contain validationType and its response as key and value respectively. - :vartype individual_response_details: list[~azure.mgmt.databox.models.ValidationInputResponse] + :vartype individual_response_details: + list[~azure.mgmt.databox.v2021_05_01.models.ValidationInputResponse] """ _validation = { @@ -3882,6 +5095,8 @@ def __init__( self, **kwargs ): + """ + """ super(ValidationResponse, self).__init__(**kwargs) self.status = None self.individual_response_details = None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/__init__.py new file mode 100644 index 000000000000..bd13cc67afb6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._jobs_operations import JobsOperations +from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin +from ._service_operations import ServiceOperations + +__all__ = [ + 'Operations', + 'JobsOperations', + 'DataBoxManagementClientOperationsMixin', + 'ServiceOperations', +] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_data_box_management_client_operations.py new file mode 100644 index 000000000000..f06160f231db --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_data_box_management_client_operations.py @@ -0,0 +1,129 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_mitigate_request( + job_name: str, + subscription_id: str, + resource_group_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate') + path_format_arguments = { + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class DataBoxManagementClientOperationsMixin(object): + + @distributed_trace + def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: "_models.MitigateJobRequest", + **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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. + :type mitigate_job_request: ~azure.mgmt.databox.v2021_05_01.models.MitigateJobRequest + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(mitigate_job_request, 'MitigateJobRequest') + + request = build_mitigate_request( + job_name=job_name, + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + content_type=content_type, + json=_json, + template_url=self.mitigate.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + 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'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_jobs_operations.py new file mode 100644 index 000000000000..2c8a51285458 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_jobs_operations.py @@ -0,0 +1,1153 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_book_shipment_pick_up_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_credentials_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class JobsOperations(object): + """JobsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_05_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: + """Lists all the jobs available under the subscription. + + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": + """Gets information about the specified job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_05_01.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + def _create_initial( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource: Job details from request body. + :type job_resource: ~azure.mgmt.databox.v2021_05_01.models.JobResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_05_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2021_05_01.models.JobResourceUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_05_01.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + if_match=if_match, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. + :type shipment_pick_up_request: ~azure.mgmt.databox.v2021_05_01.models.ShipmentPickUpRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_05_01.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + + @distributed_trace + def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param cancellation_reason: Reason for cancellation. + :type cancellation_reason: ~azure.mgmt.databox.v2021_05_01.models.CancellationReason + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + + @distributed_trace + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentialsList"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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("UnencryptedCredentialsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_operations.py new file mode 100644 index 000000000000..6eef1a724587 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_operations.py @@ -0,0 +1,135 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +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: + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.DataBox/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_05_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.OperationList"]: + """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 OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_service_operations.py new file mode 100644 index 000000000000..bc781021a27c --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/operations/_service_operations.py @@ -0,0 +1,688 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_available_skus_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_address_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-05-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class ServiceOperations(object): + """ServiceOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_05_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> Iterable["_models.AvailableSkusResult"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param available_sku_request: Filters for showing the available skus. + :type available_sku_request: ~azure.mgmt.databox.v2021_05_01.models.AvailableSkuRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_05_01.models.AvailableSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + + @distributed_trace + def validate_address( + self, + location: str, + validate_address: "_models.ValidateAddress", + **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. + :type location: str + :param validate_address: Shipping address of the customer. + :type validate_address: ~azure.mgmt.databox.v2021_05_01.models.ValidateAddress + :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.v2021_05_01.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') + + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_05_01.models.ValidationRequest + :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.v2021_05_01.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def validate_inputs( + self, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_05_01.models.ValidationRequest + :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.v2021_05_01.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def region_configuration( + self, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationRequest + :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.v2021_05_01.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_05_01.models.RegionConfigurationRequest + :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.v2021_05_01.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_05_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/__init__.py new file mode 100644 index 000000000000..72afe00aa0a1 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/__init__.py @@ -0,0 +1,18 @@ +# 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 +__all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_configuration.py new file mode 100644 index 000000000000..9530a0762b9c --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_configuration.py @@ -0,0 +1,68 @@ +# 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): + """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. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + 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 = "2021-08-01-preview" + 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 # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_data_box_management_client.py new file mode 100644 index 000000000000..0a74036b6a3b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_data_box_management_client.py @@ -0,0 +1,99 @@ +# 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, Optional, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +from . import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): + """The DataBox Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databox.v2021_08_01_preview.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databox.v2021_08_01_preview.operations.JobsOperations + :ivar service: ServiceOperations operations + :vartype service: azure.mgmt.databox.v2021_08_01_preview.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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(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, # type: 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/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataBoxManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_metadata.json b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_metadata.json new file mode 100644 index 000000000000..03f04823ec9b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_metadata.json @@ -0,0 +1,122 @@ +{ + "chosen_version": "2021-08-01-preview", + "total_api_version_list": ["2021-08-01-preview"], + "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": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"DataBoxManagementClientConfiguration\"], \"._operations_mixin\": [\"DataBoxManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The Subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The Subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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" + }, + "operation_mixins": { + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "operations": { + "mitigate" : { + "sync": { + "signature": "def mitigate(\n self,\n job_name, # type: str\n resource_group_name, # type: str\n mitigate_job_request, # type: \"_models.MitigateJobRequest\"\n **kwargs # type: Any\n):\n # type: (...) -\u003e None\n", + "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n:type job_name: str\n:param resource_group_name: The Resource Group Name.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_08_01_preview.models.MitigateJobRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def mitigate(\n self,\n job_name: str,\n resource_group_name: str,\n mitigate_job_request: \"_models.MitigateJobRequest\",\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Request to mitigate for a given job.\n\n:param job_name: The name of the job Resource within the specified resource group. job names\n must be between 3 and 24 characters in length and use any alphanumeric and underscore only.\n:type job_name: str\n:param resource_group_name: The Resource Group Name.\n:type resource_group_name: str\n:param mitigate_job_request: Mitigation Request.\n:type mitigate_job_request: ~azure.mgmt.databox.v2021_08_01_preview.models.MitigateJobRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "job_name, resource_group_name, mitigate_job_request" + } + } + } +} \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_vendor.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.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: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_version.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/_version.py @@ -0,0 +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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/__init__.py new file mode 100644 index 000000000000..c57c5574bdd0 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/__init__.py @@ -0,0 +1,15 @@ +# 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 +__all__ = ['DataBoxManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_configuration.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_configuration.py new file mode 100644 index 000000000000..54fa27ab8688 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class DataBoxManagementClientConfiguration(Configuration): + """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. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(DataBoxManagementClientConfiguration, self).__init__(**kwargs) + 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 = "2021-08-01-preview" + 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) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_data_box_management_client.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_data_box_management_client.py new file mode 100644 index 000000000000..50a9dbfa6a14 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_data_box_management_client.py @@ -0,0 +1,96 @@ +# 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, Optional, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from .. import models +from ._configuration import DataBoxManagementClientConfiguration +from .operations import DataBoxManagementClientOperationsMixin, JobsOperations, Operations, ServiceOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class DataBoxManagementClient(DataBoxManagementClientOperationsMixin): + """The DataBox Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databox.v2021_08_01_preview.aio.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databox.v2021_08_01_preview.aio.operations.JobsOperations + :ivar service: ServiceOperations operations + :vartype service: azure.mgmt.databox.v2021_08_01_preview.aio.operations.ServiceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription Id. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: 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(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/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :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) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_patch.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..bd13cc67afb6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._jobs_operations import JobsOperations +from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin +from ._service_operations import ServiceOperations + +__all__ = [ + 'Operations', + 'JobsOperations', + 'DataBoxManagementClientOperationsMixin', + 'ServiceOperations', +] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_data_box_management_client_operations.py new file mode 100644 index 000000000000..d50b2cc9bc69 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_data_box_management_client_operations.py @@ -0,0 +1,82 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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_async import distributed_trace_async +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 +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DataBoxManagementClientOperationsMixin: + + @distributed_trace_async + async def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: "_models.MitigateJobRequest", + **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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. + :type mitigate_job_request: ~azure.mgmt.databox.v2021_08_01_preview.models.MitigateJobRequest + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(mitigate_job_request, 'MitigateJobRequest') + + request = build_mitigate_request( + job_name=job_name, + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + content_type=content_type, + json=_json, + template_url=self.mitigate.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + 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'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_jobs_operations.py new file mode 100644 index 000000000000..eccb93ad4510 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_jobs_operations.py @@ -0,0 +1,854 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +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.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._jobs_operations import build_book_shipment_pick_up_request, build_cancel_request, build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_credentials_request, build_list_request, build_mark_devices_shipped_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.JobResourceList"]: + """Lists all the jobs available under the subscription. + + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace_async + async def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: "_models.MarkDevicesShippedRequest", + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. + :type mark_devices_shipped_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.MarkDevicesShippedRequest + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(mark_devices_shipped_request, 'MarkDevicesShippedRequest') + + request = build_mark_devices_shipped_request( + job_name=job_name, + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + content_type=content_type, + json=_json, + template_url=self.mark_devices_shipped.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + mark_devices_shipped.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped'} # type: ignore + + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.JobResourceList"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": + """Gets information about the specified job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + async def _create_initial( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.JobResource"]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource: Job details from request body. + :type job_resource: ~azure.mgmt.databox.v2021_08_01_preview.models.JobResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_08_01_preview.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller["_models.JobResource"]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2021_08_01_preview.models.JobResourceUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databox.v2021_08_01_preview.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + if_match=if_match, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace_async + async def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. + :type shipment_pick_up_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.ShipmentPickUpRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + + @distributed_trace_async + async def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param cancellation_reason: Reason for cancellation. + :type cancellation_reason: ~azure.mgmt.databox.v2021_08_01_preview.models.CancellationReason + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + + @distributed_trace + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.UnencryptedCredentialsList"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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("UnencryptedCredentialsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_operations.py new file mode 100644 index 000000000000..a12ae9580244 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_operations.py @@ -0,0 +1,110 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.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: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationList"]: + """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 OperationList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_service_operations.py new file mode 100644 index 000000000000..cd25e4388eef --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/aio/operations/_service_operations.py @@ -0,0 +1,428 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.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, 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: + """ServiceOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> AsyncIterable["_models.AvailableSkusResult"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param available_sku_request: Filters for showing the available skus. + :type available_sku_request: ~azure.mgmt.databox.v2021_08_01_preview.models.AvailableSkuRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.AvailableSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + @distributed_trace_async + async def validate_address( + self, + location: str, + validate_address: "_models.ValidateAddress", + **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. + :type location: str + :param validate_address: Shipping address of the customer. + :type validate_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidateAddress + :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.v2021_08_01_preview.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') + + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationRequest + :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.v2021_08_01_preview.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def validate_inputs( + self, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationRequest + :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.v2021_08_01_preview.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def region_configuration( + self, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationRequest + :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.v2021_08_01_preview.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace_async + async def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationRequest + :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.v2021_08_01_preview.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/__init__.py new file mode 100644 index 000000000000..baddcdfefb8a --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/__init__.py @@ -0,0 +1,303 @@ +# 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 CustomerDiskJobSecrets +from ._models_py3 import DataAccountDetails +from ._models_py3 import DataBoxAccountCopyLogDetails +from ._models_py3 import DataBoxCustomerDiskCopyLogDetails +from ._models_py3 import DataBoxCustomerDiskCopyProgress +from ._models_py3 import DataBoxCustomerDiskJobDetails +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 DatacenterAddressInstructionResponse +from ._models_py3 import DatacenterAddressLocationResponse +from ._models_py3 import DatacenterAddressRequest +from ._models_py3 import DatacenterAddressResponse +from ._models_py3 import DcAccessSecurityCode +from ._models_py3 import Details +from ._models_py3 import DiskScheduleAvailabilityRequest +from ._models_py3 import DiskSecret +from ._models_py3 import EncryptionPreferences +from ._models_py3 import ErrorDetail +from ._models_py3 import ExportDiskDetails +from ._models_py3 import FilterFileDetails +from ._models_py3 import HeavyScheduleAvailabilityRequest +from ._models_py3 import IdentityProperties +from ._models_py3 import ImportDiskDetails +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 LastMitigationActionOnJob +from ._models_py3 import ManagedDiskDetails +from ._models_py3 import MarkDevicesShippedRequest +from ._models_py3 import MitigateJobRequest +from ._models_py3 import NotificationPreference +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationList +from ._models_py3 import PackageCarrierDetails +from ._models_py3 import PackageCarrierInfo +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 SystemData +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 UserAssignedIdentity +from ._models_py3 import UserAssignedProperties +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, + AddressType, + AddressValidationStatus, + ClassDiscriminator, + CopyStatus, + CustomerResolutionCode, + DataAccountType, + DataCenterCode, + DatacenterAddressType, + DoubleEncryption, + FilterFileType, + JobDeliveryType, + KekType, + LogCollectionLevel, + NotificationStageName, + OverallValidationStatus, + ShareDestinationFormatType, + SkuDisabledReason, + SkuName, + StageName, + StageStatus, + TransferConfigurationType, + TransferType, + TransportShipmentTypes, + ValidationInputDiscriminator, + ValidationStatus, +) + +__all__ = [ + 'AccountCredentialDetails', + 'AdditionalErrorInfo', + 'AddressValidationOutput', + 'AddressValidationProperties', + 'ApiError', + 'ApplianceNetworkConfiguration', + 'ArmBaseObject', + 'AvailableSkuRequest', + 'AvailableSkusResult', + 'AzureFileFilterDetails', + 'BlobFilterDetails', + 'CancellationReason', + 'CloudError', + 'ContactDetails', + 'CopyLogDetails', + 'CopyProgress', + 'CreateJobValidations', + 'CreateOrderLimitForSubscriptionValidationRequest', + 'CreateOrderLimitForSubscriptionValidationResponseProperties', + 'CustomerDiskJobSecrets', + 'DataAccountDetails', + 'DataBoxAccountCopyLogDetails', + 'DataBoxCustomerDiskCopyLogDetails', + 'DataBoxCustomerDiskCopyProgress', + 'DataBoxCustomerDiskJobDetails', + 'DataBoxDiskCopyLogDetails', + 'DataBoxDiskCopyProgress', + 'DataBoxDiskJobDetails', + 'DataBoxDiskJobSecrets', + 'DataBoxHeavyAccountCopyLogDetails', + 'DataBoxHeavyJobDetails', + 'DataBoxHeavyJobSecrets', + 'DataBoxHeavySecret', + 'DataBoxJobDetails', + 'DataBoxScheduleAvailabilityRequest', + 'DataBoxSecret', + 'DataExportDetails', + 'DataImportDetails', + 'DataLocationToServiceLocationMap', + 'DataTransferDetailsValidationRequest', + 'DataTransferDetailsValidationResponseProperties', + 'DataboxJobSecrets', + 'DatacenterAddressInstructionResponse', + 'DatacenterAddressLocationResponse', + 'DatacenterAddressRequest', + 'DatacenterAddressResponse', + 'DcAccessSecurityCode', + 'Details', + 'DiskScheduleAvailabilityRequest', + 'DiskSecret', + 'EncryptionPreferences', + 'ErrorDetail', + 'ExportDiskDetails', + 'FilterFileDetails', + 'HeavyScheduleAvailabilityRequest', + 'IdentityProperties', + 'ImportDiskDetails', + 'JobDeliveryInfo', + 'JobDetails', + 'JobResource', + 'JobResourceList', + 'JobResourceUpdateParameter', + 'JobSecrets', + 'JobStages', + 'KeyEncryptionKey', + 'LastMitigationActionOnJob', + 'ManagedDiskDetails', + 'MarkDevicesShippedRequest', + 'MitigateJobRequest', + 'NotificationPreference', + 'Operation', + 'OperationDisplay', + 'OperationList', + 'PackageCarrierDetails', + 'PackageCarrierInfo', + 'PackageShippingDetails', + 'Preferences', + 'PreferencesValidationRequest', + 'PreferencesValidationResponseProperties', + 'RegionConfigurationRequest', + 'RegionConfigurationResponse', + 'Resource', + 'ResourceIdentity', + 'ScheduleAvailabilityRequest', + 'ScheduleAvailabilityResponse', + 'ShareCredentialDetails', + 'ShipmentPickUpRequest', + 'ShipmentPickUpResponse', + 'ShippingAddress', + 'Sku', + 'SkuAvailabilityValidationRequest', + 'SkuAvailabilityValidationResponseProperties', + 'SkuCapacity', + 'SkuCost', + 'SkuInformation', + 'StorageAccountDetails', + 'SubscriptionIsAllowedToCreateJobValidationRequest', + 'SubscriptionIsAllowedToCreateJobValidationResponseProperties', + 'SystemData', + 'TransferAllDetails', + 'TransferConfiguration', + 'TransferConfigurationTransferAllDetails', + 'TransferConfigurationTransferFilterDetails', + 'TransferFilterDetails', + 'TransportAvailabilityDetails', + 'TransportAvailabilityRequest', + 'TransportAvailabilityResponse', + 'TransportPreferences', + 'UnencryptedCredentials', + 'UnencryptedCredentialsList', + 'UpdateJobDetails', + 'UserAssignedIdentity', + 'UserAssignedProperties', + 'ValidateAddress', + 'ValidationInputRequest', + 'ValidationInputResponse', + 'ValidationRequest', + 'ValidationResponse', + 'AccessProtocol', + 'AddressType', + 'AddressValidationStatus', + 'ClassDiscriminator', + 'CopyStatus', + 'CustomerResolutionCode', + 'DataAccountType', + 'DataCenterCode', + 'DatacenterAddressType', + 'DoubleEncryption', + 'FilterFileType', + 'JobDeliveryType', + 'KekType', + 'LogCollectionLevel', + 'NotificationStageName', + 'OverallValidationStatus', + 'ShareDestinationFormatType', + 'SkuDisabledReason', + 'SkuName', + 'StageName', + 'StageStatus', + 'TransferConfigurationType', + 'TransferType', + 'TransportShipmentTypes', + 'ValidationInputDiscriminator', + 'ValidationStatus', +] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_data_box_management_client_enums.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_data_box_management_client_enums.py new file mode 100644 index 000000000000..c07a44d7f94b --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_data_box_management_client_enums.py @@ -0,0 +1,434 @@ +# 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 six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class AccessProtocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Server Message Block protocol(SMB). + SMB = "SMB" + #: Network File System protocol(NFS). + NFS = "NFS" + +class AddressType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of address. + """ + + #: Address type not known. + NONE = "None" + #: Residential Address. + RESIDENTIAL = "Residential" + #: Commercial Address. + COMMERCIAL = "Commercial" + +class AddressValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The address validation status. + """ + + #: Address provided is valid. + VALID = "Valid" + #: Address provided is invalid or not supported. + INVALID = "Invalid" + #: Address provided is ambiguous, please choose one of the alternate addresses returned. + AMBIGUOUS = "Ambiguous" + +class ClassDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the type of job details. + """ + + #: Data Box orders. + DATA_BOX = "DataBox" + #: Data Box Disk orders. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy orders. + DATA_BOX_HEAVY = "DataBoxHeavy" + #: Data Box Customer Disk orders. + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + +class CopyStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The Status of the copy + """ + + #: Data copy hasn't started yet. + NOT_STARTED = "NotStarted" + #: Data copy is in progress. + IN_PROGRESS = "InProgress" + #: Data copy completed. + COMPLETED = "Completed" + #: Data copy completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Data copy failed. No data was copied. + FAILED = "Failed" + #: No copy triggered as device was not returned. + NOT_RETURNED = "NotReturned" + #: The Device has hit hardware issues. + HARDWARE_ERROR = "HardwareError" + #: Data copy failed. The Device was formatted by user. + DEVICE_FORMATTED = "DeviceFormatted" + #: Data copy failed. Device metadata was modified by user. + DEVICE_METADATA_MODIFIED = "DeviceMetadataModified" + #: Data copy failed. Storage Account was not accessible during copy. + STORAGE_ACCOUNT_NOT_ACCESSIBLE = "StorageAccountNotAccessible" + #: Data copy failed. The Device data content is not supported. + UNSUPPORTED_DATA = "UnsupportedData" + #: No copy triggered as device was not received. + DRIVE_NOT_RECEIVED = "DriveNotReceived" + #: No copy triggered as device type is not supported. + UNSUPPORTED_DRIVE = "UnsupportedDrive" + #: Copy failed due to service error. + OTHER_SERVICE_ERROR = "OtherServiceError" + #: Copy failed due to user error. + OTHER_USER_ERROR = "OtherUserError" + #: Copy failed due to disk detection error. + DRIVE_NOT_DETECTED = "DriveNotDetected" + #: Copy failed due to corrupted drive. + DRIVE_CORRUPTED = "DriveCorrupted" + #: Copy failed due to modified or removed metadata files. + METADATA_FILES_MODIFIED_OR_REMOVED = "MetadataFilesModifiedOrRemoved" + +class CustomerResolutionCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: No Resolution Yet. + NONE = "None" + #: Clean the device. + MOVE_TO_CLEAN_UP_DEVICE = "MoveToCleanUpDevice" + #: Resume the job to same stage. + RESUME = "Resume" + +class DataAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the account. + """ + + #: Storage Accounts . + STORAGE_ACCOUNT = "StorageAccount" + #: Azure Managed disk storage. + MANAGED_DISK = "ManagedDisk" + +class DatacenterAddressType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Data center address type + """ + + #: Data center address location. + DATACENTER_ADDRESS_LOCATION = "DatacenterAddressLocation" + #: Data center address instruction. + DATACENTER_ADDRESS_INSTRUCTION = "DatacenterAddressInstruction" + +class DataCenterCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """DataCenter code. + """ + + INVALID = "Invalid" + BY2 = "BY2" + BY1 = "BY1" + ORK70 = "ORK70" + AM2 = "AM2" + AMS20 = "AMS20" + BY21 = "BY21" + BY24 = "BY24" + MWH01 = "MWH01" + AMS06 = "AMS06" + SSE90 = "SSE90" + SYD03 = "SYD03" + SYD23 = "SYD23" + CBR20 = "CBR20" + YTO20 = "YTO20" + CWL20 = "CWL20" + LON24 = "LON24" + BOM01 = "BOM01" + BL20 = "BL20" + BL7 = "BL7" + SEL20 = "SEL20" + TYO01 = "TYO01" + BN1 = "BN1" + SN5 = "SN5" + CYS04 = "CYS04" + TYO22 = "TYO22" + YTO21 = "YTO21" + YQB20 = "YQB20" + FRA22 = "FRA22" + MAA01 = "MAA01" + CPQ02 = "CPQ02" + CPQ20 = "CPQ20" + SIN20 = "SIN20" + HKG20 = "HKG20" + SG2 = "SG2" + MEL23 = "MEL23" + SEL21 = "SEL21" + OSA20 = "OSA20" + SHA03 = "SHA03" + BJB = "BJB" + JNB22 = "JNB22" + JNB21 = "JNB21" + MNZ21 = "MNZ21" + SN8 = "SN8" + AUH20 = "AUH20" + ZRH20 = "ZRH20" + PUS20 = "PUS20" + AD_HOC = "AdHoc" + CH1 = "CH1" + DSM05 = "DSM05" + BN7 = "BN7" + SN6 = "SN6" + PAR22 = "PAR22" + +class DoubleEncryption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Defines secondary layer of software-based encryption enablement. + """ + + #: Software-based encryption is enabled. + ENABLED = "Enabled" + #: Software-based encryption is disabled. + DISABLED = "Disabled" + +class FilterFileType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the filter file. + """ + + #: Filter file is of the type AzureBlob. + AZURE_BLOB = "AzureBlob" + #: Filter file is of the type AzureFiles. + AZURE_FILE = "AzureFile" + +class JobDeliveryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Delivery type of Job. + """ + + #: Non Scheduled job. + NON_SCHEDULED = "NonScheduled" + #: Scheduled job. + SCHEDULED = "Scheduled" + +class KekType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of encryption key used for key encryption. + """ + + #: Key encryption key is managed by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + #: Key encryption key is managed by the Customer. + CUSTOMER_MANAGED = "CustomerManaged" + +class LogCollectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Level of the logs to be collected. + """ + + #: Only Errors will be collected in the logs. + ERROR = "Error" + #: Verbose logging (includes Errors, CRC, size information and others). + VERBOSE = "Verbose" + +class NotificationStageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage. + """ + + #: Notification at device prepared stage. + DEVICE_PREPARED = "DevicePrepared" + #: Notification at device dispatched stage. + DISPATCHED = "Dispatched" + #: Notification at device delivered stage. + DELIVERED = "Delivered" + #: Notification at device picked up from user stage. + PICKED_UP = "PickedUp" + #: Notification at device received at Azure datacenter stage. + AT_AZURE_DC = "AtAzureDC" + #: Notification at data copy started stage. + DATA_COPY = "DataCopy" + #: Notification at job created stage. + CREATED = "Created" + #: Notification at shipped devices to customer stage. + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + +class OverallValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Overall validation status. + """ + + #: Every input request is valid. + ALL_VALID_TO_PROCEED = "AllValidToProceed" + #: Some input requests are not valid. + INPUTS_REVISIT_REQUIRED = "InputsRevisitRequired" + #: Certain input validations skipped. + CERTAIN_INPUT_VALIDATIONS_SKIPPED = "CertainInputValidationsSkipped" + +class ShareDestinationFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the share. + """ + + #: Unknown format. + UNKNOWN_TYPE = "UnknownType" + #: Storsimple data format. + HCS = "HCS" + #: Azure storage block blob format. + BLOCK_BLOB = "BlockBlob" + #: Azure storage page blob format. + PAGE_BLOB = "PageBlob" + #: Azure storage file format. + AZURE_FILE = "AzureFile" + #: Azure Compute Disk. + MANAGED_DISK = "ManagedDisk" + +class SkuDisabledReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Reason why the Sku is disabled. + """ + + #: SKU is not disabled. + NONE = "None" + #: SKU is not available in the requested country. + COUNTRY = "Country" + #: SKU is not available to push data to the requested Azure region. + REGION = "Region" + #: Required features are not enabled for the SKU. + FEATURE = "Feature" + #: Subscription does not have required offer types for the SKU. + OFFER_TYPE = "OfferType" + #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification. + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + #: Data Box. + DATA_BOX = "DataBox" + #: Data Box Disk. + DATA_BOX_DISK = "DataBoxDisk" + #: Data Box Heavy. + DATA_BOX_HEAVY = "DataBoxHeavy" + #: Data Box Customer Disk. + DATA_BOX_CUSTOMER_DISK = "DataBoxCustomerDisk" + +class StageName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Name of the stage which is in progress. + """ + + #: An order has been created. + DEVICE_ORDERED = "DeviceOrdered" + #: A device has been prepared for the order. + DEVICE_PREPARED = "DevicePrepared" + #: Device has been dispatched to the user of the order. + DISPATCHED = "Dispatched" + #: Device has been delivered to the user of the order. + DELIVERED = "Delivered" + #: Device has been picked up from user and in transit to Azure datacenter. + PICKED_UP = "PickedUp" + #: Device has been received at Azure datacenter from the user. + AT_AZURE_DC = "AtAzureDC" + #: Data copy from the device at Azure datacenter. + DATA_COPY = "DataCopy" + #: Order has completed. + COMPLETED = "Completed" + #: Order has completed with errors. + COMPLETED_WITH_ERRORS = "CompletedWithErrors" + #: Order has been cancelled. + CANCELLED = "Cancelled" + #: Order has failed due to issue reported by user. + FAILED_ISSUE_REPORTED_AT_CUSTOMER = "Failed_IssueReportedAtCustomer" + #: Order has failed due to issue detected at Azure datacenter. + FAILED_ISSUE_DETECTED_AT_AZURE_DC = "Failed_IssueDetectedAtAzureDC" + #: Order has been aborted. + ABORTED = "Aborted" + #: Order has completed with warnings. + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + #: Device is ready to be handed to customer from Azure DC. + READY_TO_DISPATCH_FROM_AZURE_DC = "ReadyToDispatchFromAzureDC" + #: Device can be dropped off at Azure DC. + READY_TO_RECEIVE_AT_AZURE_DC = "ReadyToReceiveAtAzureDC" + #: Job created by the customer. + CREATED = "Created" + #: User shipped the device to AzureDC. + SHIPPED_TO_AZURE_DC = "ShippedToAzureDC" + #: Awaiting shipment details of device from customer. + AWAITING_SHIPMENT_DETAILS = "AwaitingShipmentDetails" + #: Preparing the device to ship to customer. + PREPARING_TO_SHIP_FROM_AZURE_DC = "PreparingToShipFromAzureDC" + #: Shipped the device to customer. + SHIPPED_TO_CUSTOMER = "ShippedToCustomer" + +class StageStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Status of the job stage. + """ + + #: No status available yet. + NONE = "None" + #: Stage is in progress. + IN_PROGRESS = "InProgress" + #: Stage has succeeded. + SUCCEEDED = "Succeeded" + #: Stage has failed. + FAILED = "Failed" + #: Stage has been cancelled. + CANCELLED = "Cancelled" + #: Stage is cancelling. + CANCELLING = "Cancelling" + #: Stage has succeeded with errors. + SUCCEEDED_WITH_ERRORS = "SucceededWithErrors" + #: Stage is stuck until customer takes some action. + WAITING_FOR_CUSTOMER_ACTION = "WaitingForCustomerAction" + #: Stage has succeeded with warnings. + SUCCEEDED_WITH_WARNINGS = "SucceededWithWarnings" + #: Stage is waiting for customer action for kek action items. + WAITING_FOR_CUSTOMER_ACTION_FOR_KEK = "WaitingForCustomerActionForKek" + #: Stage is waiting for customer action for clean up. + WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP = "WaitingForCustomerActionForCleanUp" + #: Stage has performed customer action for clean up. + CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP = "CustomerActionPerformedForCleanUp" + +class TransferConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the configuration for transfer. + """ + + #: Transfer all the data. + TRANSFER_ALL = "TransferAll" + #: Transfer using filter. + TRANSFER_USING_FILTER = "TransferUsingFilter" + +class TransferType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the transfer. + """ + + #: Import data to azure. + IMPORT_TO_AZURE = "ImportToAzure" + #: Export data from azure. + EXPORT_FROM_AZURE = "ExportFromAzure" + +class TransportShipmentTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Transport Shipment Type supported for given region. + """ + + #: Shipment Logistics is handled by the customer. + CUSTOMER_MANAGED = "CustomerManaged" + #: Shipment Logistics is handled by Microsoft. + MICROSOFT_MANAGED = "MicrosoftManaged" + +class ValidationInputDiscriminator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Identifies the type of validation request. + """ + + #: Identify request and response of address validation. + VALIDATE_ADDRESS = "ValidateAddress" + #: Identify request and response for validation of subscription permission to create job. + VALIDATE_SUBSCRIPTION_IS_ALLOWED_TO_CREATE_JOB = "ValidateSubscriptionIsAllowedToCreateJob" + #: Identify request and response of preference validation. + VALIDATE_PREFERENCES = "ValidatePreferences" + #: Identify request and response of create order limit for subscription validation. + VALIDATE_CREATE_ORDER_LIMIT = "ValidateCreateOrderLimit" + #: Identify request and response of active job limit for sku availability. + VALIDATE_SKU_AVAILABILITY = "ValidateSkuAvailability" + #: Identify request and response of data transfer details validation. + VALIDATE_DATA_TRANSFER_DETAILS = "ValidateDataTransferDetails" + +class ValidationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Create order limit validation status. + """ + + #: Validation is successful. + VALID = "Valid" + #: Validation is not successful. + INVALID = "Invalid" + #: Validation is skipped. + SKIPPED = "Skipped" diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_models_py3.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..18f5acde58a1 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/models/_models_py3.py @@ -0,0 +1,6108 @@ +# 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. +# -------------------------------------------------------------------------- + +import datetime +from typing import Any, Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._data_box_management_client_enums import * + + +class AccountCredentialDetails(msrest.serialization.Model): + """Credential details of the account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar account_name: Name of the account. + :vartype account_name: str + :ivar data_account_type: Type of the account. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :ivar account_connection_string: Connection string of the account endpoint to use the account + as a storage endpoint on the device. + :vartype account_connection_string: str + :ivar share_credential_details: Per share level unencrypted access credentials. + :vartype share_credential_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ShareCredentialDetails] + """ + + _validation = { + 'account_name': {'readonly': True}, + 'data_account_type': {'readonly': True}, + 'account_connection_string': {'readonly': True}, + 'share_credential_details': {'readonly': True}, + } + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'account_connection_string': {'key': 'accountConnectionString', 'type': 'str'}, + 'share_credential_details': {'key': 'shareCredentialDetails', 'type': '[ShareCredentialDetails]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(AccountCredentialDetails, self).__init__(**kwargs) + self.account_name = None + self.data_account_type = None + self.account_connection_string = None + self.share_credential_details = None + + +class AdditionalErrorInfo(msrest.serialization.Model): + """Additional error info. + + :ivar type: Additional error type. + :vartype type: str + :ivar info: Additional error info. + :vartype info: any + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + info: Optional[Any] = None, + **kwargs + ): + """ + :keyword type: Additional error type. + :paramtype type: str + :keyword info: Additional error info. + :paramtype info: any + """ + super(AdditionalErrorInfo, self).__init__(**kwargs) + self.type = type + self.info = info + + +class AddressValidationOutput(msrest.serialization.Model): + """Output of the address validation api. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar validation_type: Identifies the type of validation response.Constant filled by server. + Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationStatus + :ivar alternate_addresses: List of alternate addresses. + :vartype alternate_addresses: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress] + """ + + _validation = { + 'error': {'readonly': True}, + 'validation_status': {'readonly': True}, + 'alternate_addresses': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'properties.validationType', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, + 'validation_status': {'key': 'properties.validationStatus', 'type': 'str'}, + 'alternate_addresses': {'key': 'properties.alternateAddresses', 'type': '[ShippingAddress]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(AddressValidationOutput, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + self.validation_status = None + self.alternate_addresses = None + + +class ValidationInputResponse(msrest.serialization.Model): + """Minimum properties that should be present in each individual validation response. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AddressValidationProperties, CreateOrderLimitForSubscriptionValidationResponseProperties, DataTransferDetailsValidationResponseProperties, PreferencesValidationResponseProperties, SkuAvailabilityValidationResponseProperties, SubscriptionIsAllowedToCreateJobValidationResponseProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + } + + _subtype_map = { + 'validation_type': {'ValidateAddress': 'AddressValidationProperties', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationResponseProperties', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationResponseProperties', 'ValidatePreferences': 'PreferencesValidationResponseProperties', 'ValidateSkuAvailability': 'SkuAvailabilityValidationResponseProperties', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationResponseProperties'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ValidationInputResponse, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] + self.error = None + + +class AddressValidationProperties(ValidationInputResponse): + """The address validation output. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar validation_status: The address validation status. Possible values include: "Valid", + "Invalid", "Ambiguous". + :vartype validation_status: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.AddressValidationStatus + :ivar alternate_addresses: List of alternate addresses. + :vartype alternate_addresses: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress] + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'validation_status': {'readonly': True}, + 'alternate_addresses': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'validation_status': {'key': 'validationStatus', 'type': 'str'}, + 'alternate_addresses': {'key': 'alternateAddresses', 'type': '[ShippingAddress]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(AddressValidationProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateAddress' # type: str + self.validation_status = None + self.alternate_addresses = None + + +class ApiError(msrest.serialization.Model): + """ApiError. + + All required parameters must be populated in order to send to Azure. + + :ivar error: Required. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.ErrorDetail + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: "ErrorDetail", + **kwargs + ): + """ + :keyword error: Required. + :paramtype error: ~azure.mgmt.databox.v2021_08_01_preview.models.ErrorDetail + """ + super(ApiError, self).__init__(**kwargs) + self.error = error + + +class ApplianceNetworkConfiguration(msrest.serialization.Model): + """The Network Adapter configuration of a DataBox. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the network. + :vartype name: str + :ivar mac_address: Mac Address. + :vartype mac_address: str + """ + + _validation = { + 'name': {'readonly': True}, + 'mac_address': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ApplianceNetworkConfiguration, self).__init__(**kwargs) + self.name = None + self.mac_address = None + + +class ArmBaseObject(msrest.serialization.Model): + """Base class for all objects under resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ArmBaseObject, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + + +class AvailableSkuRequest(msrest.serialization.Model): + """The filters for showing the available skus. + + All required parameters must be populated in order to send to Azure. + + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype location: str + :ivar sku_names: Sku Names to filter for available skus. + :vartype sku_names: list[str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName] + """ + + _validation = { + 'transfer_type': {'required': True}, + 'country': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'transfer_type': {'key': 'transferType', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku_names': {'key': 'skuNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + transfer_type: Union[str, "TransferType"], + country: str, + location: str, + sku_names: Optional[List[Union[str, "SkuName"]]] = None, + **kwargs + ): + """ + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + :keyword sku_names: Sku Names to filter for available skus. + :paramtype sku_names: list[str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName] + """ + super(AvailableSkuRequest, self).__init__(**kwargs) + self.transfer_type = transfer_type + self.country = country + self.location = location + self.sku_names = sku_names + + +class AvailableSkusResult(msrest.serialization.Model): + """The available skus operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of available skus. + :vartype value: list[~azure.mgmt.databox.v2021_08_01_preview.models.SkuInformation] + :ivar next_link: Link for the next set of skus. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInformation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword next_link: Link for the next set of skus. + :paramtype next_link: str + """ + super(AvailableSkusResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class AzureFileFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure files. + + :ivar file_prefix_list: Prefix list of the Azure files to be transferred. + :vartype file_prefix_list: list[str] + :ivar file_path_list: List of full path of the files to be transferred. + :vartype file_path_list: list[str] + :ivar file_share_list: List of file shares to be transferred. + :vartype file_share_list: list[str] + """ + + _attribute_map = { + 'file_prefix_list': {'key': 'filePrefixList', 'type': '[str]'}, + 'file_path_list': {'key': 'filePathList', 'type': '[str]'}, + 'file_share_list': {'key': 'fileShareList', 'type': '[str]'}, + } + + def __init__( + self, + *, + file_prefix_list: Optional[List[str]] = None, + file_path_list: Optional[List[str]] = None, + file_share_list: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword file_prefix_list: Prefix list of the Azure files to be transferred. + :paramtype file_prefix_list: list[str] + :keyword file_path_list: List of full path of the files to be transferred. + :paramtype file_path_list: list[str] + :keyword file_share_list: List of file shares to be transferred. + :paramtype file_share_list: list[str] + """ + super(AzureFileFilterDetails, self).__init__(**kwargs) + self.file_prefix_list = file_prefix_list + self.file_path_list = file_path_list + self.file_share_list = file_share_list + + +class BlobFilterDetails(msrest.serialization.Model): + """Filter details to transfer Azure Blobs. + + :ivar blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :vartype blob_prefix_list: list[str] + :ivar blob_path_list: List of full path of the blobs to be transferred. + :vartype blob_path_list: list[str] + :ivar container_list: List of blob containers to be transferred. + :vartype container_list: list[str] + """ + + _attribute_map = { + 'blob_prefix_list': {'key': 'blobPrefixList', 'type': '[str]'}, + 'blob_path_list': {'key': 'blobPathList', 'type': '[str]'}, + 'container_list': {'key': 'containerList', 'type': '[str]'}, + } + + def __init__( + self, + *, + blob_prefix_list: Optional[List[str]] = None, + blob_path_list: Optional[List[str]] = None, + container_list: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword blob_prefix_list: Prefix list of the Azure blobs to be transferred. + :paramtype blob_prefix_list: list[str] + :keyword blob_path_list: List of full path of the blobs to be transferred. + :paramtype blob_path_list: list[str] + :keyword container_list: List of blob containers to be transferred. + :paramtype container_list: list[str] + """ + super(BlobFilterDetails, self).__init__(**kwargs) + self.blob_prefix_list = blob_prefix_list + self.blob_path_list = blob_path_list + self.container_list = container_list + + +class CancellationReason(msrest.serialization.Model): + """Reason for cancellation. + + All required parameters must be populated in order to send to Azure. + + :ivar reason: Required. Reason for cancellation. + :vartype reason: str + """ + + _validation = { + 'reason': {'required': True}, + } + + _attribute_map = { + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + *, + reason: str, + **kwargs + ): + """ + :keyword reason: Required. Reason for cancellation. + :paramtype reason: str + """ + super(CancellationReason, self).__init__(**kwargs) + self.reason = reason + + +class CloudError(msrest.serialization.Model): + """Cloud error. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Cloud error code. + :vartype code: str + :ivar message: Cloud error message. + :vartype message: str + :ivar target: Cloud error target. + :vartype target: str + :ivar details: Cloud error details. + :vartype details: list[~azure.mgmt.databox.v2021_08_01_preview.models.CloudError] + :ivar additional_info: Cloud error additional info. + :vartype additional_info: + list[~azure.mgmt.databox.v2021_08_01_preview.models.AdditionalErrorInfo] + """ + + _validation = { + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudError]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[AdditionalErrorInfo]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + **kwargs + ): + """ + :keyword code: Cloud error code. + :paramtype code: str + :keyword message: Cloud error message. + :paramtype message: str + :keyword target: Cloud error target. + :paramtype target: str + """ + super(CloudError, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = None + self.additional_info = None + + +class ContactDetails(msrest.serialization.Model): + """Contact Details. + + All required parameters must be populated in order to send to Azure. + + :ivar contact_name: Required. Contact name of the person. + :vartype contact_name: str + :ivar phone: Required. Phone number of the contact person. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: Required. List of Email-ids to be notified about job progress. + :vartype email_list: list[str] + :ivar notification_preference: Notification preference for a job stage. + :vartype notification_preference: + list[~azure.mgmt.databox.v2021_08_01_preview.models.NotificationPreference] + """ + + _validation = { + 'contact_name': {'required': True}, + 'phone': {'required': True}, + 'email_list': {'required': True}, + } + + _attribute_map = { + 'contact_name': {'key': 'contactName', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'phone_extension': {'key': 'phoneExtension', 'type': 'str'}, + 'mobile': {'key': 'mobile', 'type': 'str'}, + 'email_list': {'key': 'emailList', 'type': '[str]'}, + 'notification_preference': {'key': 'notificationPreference', 'type': '[NotificationPreference]'}, + } + + def __init__( + self, + *, + contact_name: str, + phone: str, + email_list: List[str], + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + notification_preference: Optional[List["NotificationPreference"]] = None, + **kwargs + ): + """ + :keyword contact_name: Required. Contact name of the person. + :paramtype contact_name: str + :keyword phone: Required. Phone number of the contact person. + :paramtype phone: str + :keyword phone_extension: Phone extension number of the contact person. + :paramtype phone_extension: str + :keyword mobile: Mobile number of the contact person. + :paramtype mobile: str + :keyword email_list: Required. List of Email-ids to be notified about job progress. + :paramtype email_list: list[str] + :keyword notification_preference: Notification preference for a job stage. + :paramtype notification_preference: + list[~azure.mgmt.databox.v2021_08_01_preview.models.NotificationPreference] + """ + super(ContactDetails, self).__init__(**kwargs) + self.contact_name = contact_name + self.phone = phone + self.phone_extension = phone_extension + self.mobile = mobile + self.email_list = email_list + self.notification_preference = notification_preference + + +class CopyLogDetails(msrest.serialization.Model): + """Details for log generated during copy. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DataBoxAccountCopyLogDetails, DataBoxCustomerDiskCopyLogDetails, DataBoxDiskCopyLogDetails, DataBoxHeavyAccountCopyLogDetails. + + All required parameters must be populated in order to send to Azure. + + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + """ + + _validation = { + 'copy_log_details_type': {'required': True}, + } + + _attribute_map = { + 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, + } + + _subtype_map = { + 'copy_log_details_type': {'DataBox': 'DataBoxAccountCopyLogDetails', 'DataBoxCustomerDisk': 'DataBoxCustomerDiskCopyLogDetails', 'DataBoxDisk': 'DataBoxDiskCopyLogDetails', 'DataBoxHeavy': 'DataBoxHeavyAccountCopyLogDetails'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(CopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = None # type: Optional[str] + + +class CopyProgress(msrest.serialization.Model): + """Copy progress. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_account_name: Name of the storage account. This will be empty for data account + types other than storage account. + :vartype storage_account_name: str + :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: long + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: long + :ivar files_processed: Number of files processed. + :vartype files_processed: long + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: long + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: long + :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming + conventions which were processed by automatic renaming. + :vartype invalid_file_bytes_uploaded: long + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: long + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: long + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: long + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: long + :ivar is_enumeration_in_progress: To indicate if enumeration of data is in progress. + Until this is true, the TotalBytesToProcess may not be valid. + :vartype is_enumeration_in_progress: bool + """ + + _validation = { + 'storage_account_name': {'readonly': True}, + 'transfer_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, + 'account_id': {'readonly': True}, + 'bytes_processed': {'readonly': True}, + 'total_bytes_to_process': {'readonly': True}, + 'files_processed': {'readonly': True}, + 'total_files_to_process': {'readonly': True}, + 'invalid_files_processed': {'readonly': True}, + 'invalid_file_bytes_uploaded': {'readonly': True}, + 'renamed_container_count': {'readonly': True}, + 'files_errored_out': {'readonly': True}, + 'directories_errored_out': {'readonly': True}, + 'invalid_directories_processed': {'readonly': True}, + 'is_enumeration_in_progress': {'readonly': True}, + } + + _attribute_map = { + 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'bytes_processed': {'key': 'bytesProcessed', 'type': 'long'}, + 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, + 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, + 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, + 'invalid_files_processed': {'key': 'invalidFilesProcessed', 'type': 'long'}, + 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, + 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, + 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, + 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, + 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, + 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(CopyProgress, self).__init__(**kwargs) + self.storage_account_name = None + self.transfer_type = None + self.data_account_type = None + self.account_id = None + self.bytes_processed = None + self.total_bytes_to_process = None + self.files_processed = None + self.total_files_to_process = None + self.invalid_files_processed = None + self.invalid_file_bytes_uploaded = None + self.renamed_container_count = None + self.files_errored_out = None + self.directories_errored_out = None + self.invalid_directories_processed = None + self.is_enumeration_in_progress = None + + +class ValidationRequest(msrest.serialization.Model): + """Minimum request requirement of any validation category. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CreateJobValidations. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_category: Required. Identify the nature of validation.Constant filled by + server. + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :vartype individual_request_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputRequest] + """ + + _validation = { + 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, + } + + _attribute_map = { + 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, + } + + _subtype_map = { + 'validation_category': {'JobCreationValidation': 'CreateJobValidations'} + } + + def __init__( + self, + *, + individual_request_details: List["ValidationInputRequest"], + **kwargs + ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputRequest] + """ + super(ValidationRequest, self).__init__(**kwargs) + self.validation_category = None # type: Optional[str] + self.individual_request_details = individual_request_details + + +class CreateJobValidations(ValidationRequest): + """It does all pre-job creation validations. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_category: Required. Identify the nature of validation.Constant filled by + server. + :vartype validation_category: str + :ivar individual_request_details: Required. List of request details contain validationType and + its request as key and value respectively. + :vartype individual_request_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputRequest] + """ + + _validation = { + 'validation_category': {'required': True}, + 'individual_request_details': {'required': True}, + } + + _attribute_map = { + 'validation_category': {'key': 'validationCategory', 'type': 'str'}, + 'individual_request_details': {'key': 'individualRequestDetails', 'type': '[ValidationInputRequest]'}, + } + + def __init__( + self, + *, + individual_request_details: List["ValidationInputRequest"], + **kwargs + ): + """ + :keyword individual_request_details: Required. List of request details contain validationType + and its request as key and value respectively. + :paramtype individual_request_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputRequest] + """ + super(CreateJobValidations, self).__init__(individual_request_details=individual_request_details, **kwargs) + self.validation_category = 'JobCreationValidation' # type: str + + +class ValidationInputRequest(msrest.serialization.Model): + """Minimum fields that must be present in any type of validation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ValidateAddress, CreateOrderLimitForSubscriptionValidationRequest, DataTransferDetailsValidationRequest, PreferencesValidationRequest, SkuAvailabilityValidationRequest, SubscriptionIsAllowedToCreateJobValidationRequest. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + """ + + _validation = { + 'validation_type': {'required': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + } + + _subtype_map = { + 'validation_type': {'ValidateAddress': 'ValidateAddress', 'ValidateCreateOrderLimit': 'CreateOrderLimitForSubscriptionValidationRequest', 'ValidateDataTransferDetails': 'DataTransferDetailsValidationRequest', 'ValidatePreferences': 'PreferencesValidationRequest', 'ValidateSkuAvailability': 'SkuAvailabilityValidationRequest', 'ValidateSubscriptionIsAllowedToCreateJob': 'SubscriptionIsAllowedToCreateJobValidationRequest'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ValidationInputRequest, self).__init__(**kwargs) + self.validation_type = None # type: Optional[str] + + +class CreateOrderLimitForSubscriptionValidationRequest(ValidationInputRequest): + """Request to validate create order limit for current subscription. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + """ + + _validation = { + 'validation_type': {'required': True}, + 'device_type': {'required': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + } + + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + **kwargs + ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + """ + super(CreateOrderLimitForSubscriptionValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateCreateOrderLimit' # type: str + self.device_type = device_type + + +class CreateOrderLimitForSubscriptionValidationResponseProperties(ValidationInputResponse): + """Properties of create order limit for subscription validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar status: Create order limit validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationStatus + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(CreateOrderLimitForSubscriptionValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateCreateOrderLimit' # type: str + self.status = None + + +class JobSecrets(msrest.serialization.Model): + """The base class for the secrets. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DataboxJobSecrets, CustomerDiskJobSecrets, DataBoxDiskJobSecrets, DataBoxHeavyJobSecrets. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype job_secrets_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: + ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + """ + + _validation = { + 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + } + + _subtype_map = { + 'job_secrets_type': {'DataBox': 'DataboxJobSecrets', 'DataBoxCustomerDisk': 'CustomerDiskJobSecrets', 'DataBoxDisk': 'DataBoxDiskJobSecrets', 'DataBoxHeavy': 'DataBoxHeavyJobSecrets'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(JobSecrets, self).__init__(**kwargs) + self.job_secrets_type = None # type: Optional[str] + self.dc_access_security_code = None + self.error = None + + +class CustomerDiskJobSecrets(JobSecrets): + """The secrets related to customer disk job. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype job_secrets_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: + ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar disk_secrets: Contains the list of secrets object for that device. + :vartype disk_secrets: list[~azure.mgmt.databox.v2021_08_01_preview.models.DiskSecret] + :ivar carrier_account_number: Carrier Account Number of the customer. + :vartype carrier_account_number: str + """ + + _validation = { + 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, + 'disk_secrets': {'readonly': True}, + 'carrier_account_number': {'readonly': True}, + } + + _attribute_map = { + 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, + 'carrier_account_number': {'key': 'carrierAccountNumber', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(CustomerDiskJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxCustomerDisk' # type: str + self.disk_secrets = None + self.carrier_account_number = None + + +class DataAccountDetails(msrest.serialization.Model): + """Account details of the data to be transferred. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ManagedDiskDetails, StorageAccountDetails. + + All required parameters must be populated in order to send to Azure. + + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :vartype share_password: str + """ + + _validation = { + 'data_account_type': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + } + + _subtype_map = { + 'data_account_type': {'ManagedDisk': 'ManagedDiskDetails', 'StorageAccount': 'StorageAccountDetails'} + } + + def __init__( + self, + *, + share_password: Optional[str] = None, + **kwargs + ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + """ + super(DataAccountDetails, self).__init__(**kwargs) + self.data_account_type = None # type: Optional[str] + self.share_password = share_password + + +class DataBoxAccountCopyLogDetails(CopyLogDetails): + """Copy log details for a storage account of a DataBox job. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar account_name: Account name. + :vartype account_name: str + :ivar copy_log_link: Link for copy logs. + :vartype copy_log_link: str + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when + LogCollectionLevel is set to Verbose. + :vartype copy_verbose_log_link: str + """ + + _validation = { + 'copy_log_details_type': {'required': True}, + 'account_name': {'readonly': True}, + 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, + } + + _attribute_map = { + 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'copy_log_link': {'key': 'copyLogLink', 'type': 'str'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBox' # type: str + self.account_name = None + self.copy_log_link = None + self.copy_verbose_log_link = None + + +class DataBoxCustomerDiskCopyLogDetails(CopyLogDetails): + """Copy Log Details for customer disk. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar error_log_link: Link for copy error logs. + :vartype error_log_link: str + :ivar verbose_log_link: Link for copy verbose logs. + :vartype verbose_log_link: str + """ + + _validation = { + 'copy_log_details_type': {'required': True}, + 'serial_number': {'readonly': True}, + 'error_log_link': {'readonly': True}, + 'verbose_log_link': {'readonly': True}, + } + + _attribute_map = { + 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'error_log_link': {'key': 'errorLogLink', 'type': 'str'}, + 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxCustomerDiskCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxCustomerDisk' # type: str + self.serial_number = None + self.error_log_link = None + self.verbose_log_link = None + + +class DataBoxCustomerDiskCopyProgress(CopyProgress): + """DataBox CustomerDisk Copy Progress. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar storage_account_name: Name of the storage account. This will be empty for data account + types other than storage account. + :vartype storage_account_name: str + :ivar transfer_type: Transfer type of data. Possible values include: "ImportToAzure", + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + :ivar data_account_type: Data Account Type. Possible values include: "StorageAccount", + "ManagedDisk". + :vartype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :ivar account_id: Id of the account where the data needs to be uploaded. + :vartype account_id: str + :ivar bytes_processed: To indicate bytes transferred. + :vartype bytes_processed: long + :ivar total_bytes_to_process: Total amount of data to be processed by the job. + :vartype total_bytes_to_process: long + :ivar files_processed: Number of files processed. + :vartype files_processed: long + :ivar total_files_to_process: Total files to process. + :vartype total_files_to_process: long + :ivar invalid_files_processed: Number of files not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype invalid_files_processed: long + :ivar invalid_file_bytes_uploaded: Total amount of data not adhering to azure naming + conventions which were processed by automatic renaming. + :vartype invalid_file_bytes_uploaded: long + :ivar renamed_container_count: Number of folders not adhering to azure naming conventions which + were processed by automatic renaming. + :vartype renamed_container_count: long + :ivar files_errored_out: Number of files which could not be copied. + :vartype files_errored_out: long + :ivar directories_errored_out: To indicate directories errored out in the job. + :vartype directories_errored_out: long + :ivar invalid_directories_processed: To indicate directories renamed. + :vartype invalid_directories_processed: long + :ivar is_enumeration_in_progress: To indicate if enumeration of data is in progress. + Until this is true, the TotalBytesToProcess may not be valid. + :vartype is_enumeration_in_progress: bool + :ivar serial_number: Disk Serial Number. + :vartype serial_number: str + :ivar copy_status: The Status of the copy. Possible values include: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", + "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", + "DriveNotDetected", "DriveCorrupted", "MetadataFilesModifiedOrRemoved". + :vartype copy_status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.CopyStatus + """ + + _validation = { + 'storage_account_name': {'readonly': True}, + 'transfer_type': {'readonly': True}, + 'data_account_type': {'readonly': True}, + 'account_id': {'readonly': True}, + 'bytes_processed': {'readonly': True}, + 'total_bytes_to_process': {'readonly': True}, + 'files_processed': {'readonly': True}, + 'total_files_to_process': {'readonly': True}, + 'invalid_files_processed': {'readonly': True}, + 'invalid_file_bytes_uploaded': {'readonly': True}, + 'renamed_container_count': {'readonly': True}, + 'files_errored_out': {'readonly': True}, + 'directories_errored_out': {'readonly': True}, + 'invalid_directories_processed': {'readonly': True}, + 'is_enumeration_in_progress': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'copy_status': {'readonly': True}, + } + + _attribute_map = { + 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'bytes_processed': {'key': 'bytesProcessed', 'type': 'long'}, + 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, + 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, + 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, + 'invalid_files_processed': {'key': 'invalidFilesProcessed', 'type': 'long'}, + 'invalid_file_bytes_uploaded': {'key': 'invalidFileBytesUploaded', 'type': 'long'}, + 'renamed_container_count': {'key': 'renamedContainerCount', 'type': 'long'}, + 'files_errored_out': {'key': 'filesErroredOut', 'type': 'long'}, + 'directories_errored_out': {'key': 'directoriesErroredOut', 'type': 'long'}, + 'invalid_directories_processed': {'key': 'invalidDirectoriesProcessed', 'type': 'long'}, + 'is_enumeration_in_progress': {'key': 'isEnumerationInProgress', 'type': 'bool'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'copy_status': {'key': 'copyStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxCustomerDiskCopyProgress, self).__init__(**kwargs) + self.serial_number = None + self.copy_status = None + + +class JobDetails(msrest.serialization.Model): + """Job details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DataBoxJobDetails, DataBoxCustomerDiskJobDetails, DataBoxDiskJobDetails, DataBoxHeavyJobDetails. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype job_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :ivar copy_log_details: List of copy log details. + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. + :vartype reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or + ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Possible values include: "Invalid", "BY2", "BY1", + "ORK70", "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", + "YTO20", "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", + "TYO22", "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", + "MEL23", "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", + "PUS20", "AdHoc", "CH1", "DSM05", "BN7", "SN6", "PAR22". + :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.models.DataCenterCode + """ + + _validation = { + 'job_stages': {'readonly': True}, + 'contact_details': {'required': True}, + 'delivery_package': {'readonly': True}, + 'return_package': {'readonly': True}, + 'job_details_type': {'required': True}, + 'copy_log_details': {'readonly': True}, + 'reverse_shipment_label_sas_key': {'readonly': True}, + 'chain_of_custody_sas_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, + 'datacenter_address': {'readonly': True}, + 'data_center_code': {'readonly': True}, + } + + _attribute_map = { + 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, + 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, + 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'preferences': {'key': 'preferences', 'type': 'Preferences'}, + 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, + 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, + 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, + 'datacenter_address': {'key': 'datacenterAddress', 'type': 'DatacenterAddressResponse'}, + 'data_center_code': {'key': 'dataCenterCode', 'type': 'str'}, + } + + _subtype_map = { + 'job_details_type': {'DataBox': 'DataBoxJobDetails', 'DataBoxCustomerDisk': 'DataBoxCustomerDiskJobDetails', 'DataBoxDisk': 'DataBoxDiskJobDetails', 'DataBoxHeavy': 'DataBoxHeavyJobDetails'} + } + + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + **kwargs + ): + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ + super(JobDetails, self).__init__(**kwargs) + self.job_stages = None + self.contact_details = contact_details + self.shipping_address = shipping_address + self.delivery_package = None + self.return_package = None + self.data_import_details = data_import_details + self.data_export_details = data_export_details + self.job_details_type = None # type: Optional[str] + self.preferences = preferences + self.copy_log_details = None + self.reverse_shipment_label_sas_key = None + self.chain_of_custody_sas_key = None + self.key_encryption_key = key_encryption_key + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes + self.actions = None + self.last_mitigation_action_on_job = None + self.datacenter_address = None + self.data_center_code = None + + +class DataBoxCustomerDiskJobDetails(JobDetails): + """Customer disk job details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype job_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :ivar copy_log_details: List of copy log details. + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. + :vartype reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or + ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Possible values include: "Invalid", "BY2", "BY1", + "ORK70", "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", + "YTO20", "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", + "TYO22", "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", + "MEL23", "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", + "PUS20", "AdHoc", "CH1", "DSM05", "BN7", "SN6", "PAR22". + :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.models.DataCenterCode + :ivar import_disk_details_collection: Contains the map of disk serial number to the disk + details for import jobs. + :vartype import_disk_details_collection: dict[str, + ~azure.mgmt.databox.v2021_08_01_preview.models.ImportDiskDetails] + :ivar export_disk_details_collection: Contains the map of disk serial number to the disk + details for export jobs. + :vartype export_disk_details_collection: dict[str, + ~azure.mgmt.databox.v2021_08_01_preview.models.ExportDiskDetails] + :ivar copy_progress: Copy progress per disk. + :vartype copy_progress: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataBoxCustomerDiskCopyProgress] + :ivar deliver_to_dc_package_details: Delivery package shipping details. + :vartype deliver_to_dc_package_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierInfo + :ivar return_to_customer_package_details: Required. Return package shipping details. + :vartype return_to_customer_package_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierDetails + :ivar enable_manifest_backup: Flag to indicate if disk manifest should be backed-up in the + Storage Account. + :vartype enable_manifest_backup: bool + """ + + _validation = { + 'job_stages': {'readonly': True}, + 'contact_details': {'required': True}, + 'delivery_package': {'readonly': True}, + 'return_package': {'readonly': True}, + 'job_details_type': {'required': True}, + 'copy_log_details': {'readonly': True}, + 'reverse_shipment_label_sas_key': {'readonly': True}, + 'chain_of_custody_sas_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, + 'datacenter_address': {'readonly': True}, + 'data_center_code': {'readonly': True}, + 'export_disk_details_collection': {'readonly': True}, + 'copy_progress': {'readonly': True}, + 'deliver_to_dc_package_details': {'readonly': True}, + 'return_to_customer_package_details': {'required': True}, + } + + _attribute_map = { + 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, + 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, + 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'preferences': {'key': 'preferences', 'type': 'Preferences'}, + 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, + 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, + 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, + 'datacenter_address': {'key': 'datacenterAddress', 'type': 'DatacenterAddressResponse'}, + 'data_center_code': {'key': 'dataCenterCode', 'type': 'str'}, + 'import_disk_details_collection': {'key': 'importDiskDetailsCollection', 'type': '{ImportDiskDetails}'}, + 'export_disk_details_collection': {'key': 'exportDiskDetailsCollection', 'type': '{ExportDiskDetails}'}, + 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxCustomerDiskCopyProgress]'}, + 'deliver_to_dc_package_details': {'key': 'deliverToDcPackageDetails', 'type': 'PackageCarrierInfo'}, + 'return_to_customer_package_details': {'key': 'returnToCustomerPackageDetails', 'type': 'PackageCarrierDetails'}, + 'enable_manifest_backup': {'key': 'enableManifestBackup', 'type': 'bool'}, + } + + def __init__( + self, + *, + contact_details: "ContactDetails", + return_to_customer_package_details: "PackageCarrierDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + import_disk_details_collection: Optional[Dict[str, "ImportDiskDetails"]] = None, + enable_manifest_backup: Optional[bool] = False, + **kwargs + ): + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword import_disk_details_collection: Contains the map of disk serial number to the disk + details for import jobs. + :paramtype import_disk_details_collection: dict[str, + ~azure.mgmt.databox.v2021_08_01_preview.models.ImportDiskDetails] + :keyword return_to_customer_package_details: Required. Return package shipping details. + :paramtype return_to_customer_package_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierDetails + :keyword enable_manifest_backup: Flag to indicate if disk manifest should be backed-up in the + Storage Account. + :paramtype enable_manifest_backup: bool + """ + super(DataBoxCustomerDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) + self.job_details_type = 'DataBoxCustomerDisk' # type: str + self.import_disk_details_collection = import_disk_details_collection + self.export_disk_details_collection = None + self.copy_progress = None + self.deliver_to_dc_package_details = None + self.return_to_customer_package_details = return_to_customer_package_details + self.enable_manifest_backup = enable_manifest_backup + + +class DataBoxDiskCopyLogDetails(CopyLogDetails): + """Copy Log Details for a disk. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar disk_serial_number: Disk Serial Number. + :vartype disk_serial_number: str + :ivar error_log_link: Link for copy error logs. + :vartype error_log_link: str + :ivar verbose_log_link: Link for copy verbose logs. + :vartype verbose_log_link: str + """ + + _validation = { + 'copy_log_details_type': {'required': True}, + 'disk_serial_number': {'readonly': True}, + 'error_log_link': {'readonly': True}, + 'verbose_log_link': {'readonly': True}, + } + + _attribute_map = { + 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, + 'disk_serial_number': {'key': 'diskSerialNumber', 'type': 'str'}, + 'error_log_link': {'key': 'errorLogLink', 'type': 'str'}, + 'verbose_log_link': {'key': 'verboseLogLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxDiskCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxDisk' # type: str + self.disk_serial_number = None + self.error_log_link = None + self.verbose_log_link = None + + +class DataBoxDiskCopyProgress(msrest.serialization.Model): + """DataBox Disk Copy Progress. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar serial_number: The serial number of the disk. + :vartype serial_number: str + :ivar bytes_copied: Bytes copied during the copy of disk. + :vartype bytes_copied: long + :ivar percent_complete: Indicates the percentage completed for the copy of the disk. + :vartype percent_complete: int + :ivar status: The Status of the copy. Possible values include: "NotStarted", "InProgress", + "Completed", "CompletedWithErrors", "Failed", "NotReturned", "HardwareError", + "DeviceFormatted", "DeviceMetadataModified", "StorageAccountNotAccessible", "UnsupportedData", + "DriveNotReceived", "UnsupportedDrive", "OtherServiceError", "OtherUserError", + "DriveNotDetected", "DriveCorrupted", "MetadataFilesModifiedOrRemoved". + :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.CopyStatus + """ + + _validation = { + 'serial_number': {'readonly': True}, + 'bytes_copied': {'readonly': True}, + 'percent_complete': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'bytes_copied': {'key': 'bytesCopied', 'type': 'long'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxDiskCopyProgress, self).__init__(**kwargs) + self.serial_number = None + self.bytes_copied = None + self.percent_complete = None + self.status = None + + +class DataBoxDiskJobDetails(JobDetails): + """DataBox Disk Job Details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype job_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :ivar copy_log_details: List of copy log details. + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. + :vartype reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or + ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Possible values include: "Invalid", "BY2", "BY1", + "ORK70", "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", + "YTO20", "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", + "TYO22", "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", + "MEL23", "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", + "PUS20", "AdHoc", "CH1", "DSM05", "BN7", "SN6", "PAR22". + :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.models.DataCenterCode + :ivar preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. + :vartype preferred_disks: dict[str, int] + :ivar copy_progress: Copy progress per disk. + :vartype copy_progress: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataBoxDiskCopyProgress] + :ivar disks_and_size_details: Contains the map of disk serial number to the disk size being + used for the job. Is returned only after the disks are shipped to the customer. + :vartype disks_and_size_details: dict[str, int] + :ivar passkey: User entered passkey for DataBox Disk job. + :vartype passkey: str + """ + + _validation = { + 'job_stages': {'readonly': True}, + 'contact_details': {'required': True}, + 'delivery_package': {'readonly': True}, + 'return_package': {'readonly': True}, + 'job_details_type': {'required': True}, + 'copy_log_details': {'readonly': True}, + 'reverse_shipment_label_sas_key': {'readonly': True}, + 'chain_of_custody_sas_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, + 'datacenter_address': {'readonly': True}, + 'data_center_code': {'readonly': True}, + 'copy_progress': {'readonly': True}, + 'disks_and_size_details': {'readonly': True}, + } + + _attribute_map = { + 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, + 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, + 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'preferences': {'key': 'preferences', 'type': 'Preferences'}, + 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, + 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, + 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, + 'datacenter_address': {'key': 'datacenterAddress', 'type': 'DatacenterAddressResponse'}, + 'data_center_code': {'key': 'dataCenterCode', 'type': 'str'}, + 'preferred_disks': {'key': 'preferredDisks', 'type': '{int}'}, + 'copy_progress': {'key': 'copyProgress', 'type': '[DataBoxDiskCopyProgress]'}, + 'disks_and_size_details': {'key': 'disksAndSizeDetails', 'type': '{int}'}, + 'passkey': {'key': 'passkey', 'type': 'str'}, + } + + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + preferred_disks: Optional[Dict[str, int]] = None, + passkey: Optional[str] = None, + **kwargs + ): + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword preferred_disks: User preference on what size disks are needed for the job. The map is + from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but + will be checked against an int. + :paramtype preferred_disks: dict[str, int] + :keyword passkey: User entered passkey for DataBox Disk job. + :paramtype passkey: str + """ + super(DataBoxDiskJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) + self.job_details_type = 'DataBoxDisk' # type: str + self.preferred_disks = preferred_disks + self.copy_progress = None + self.disks_and_size_details = None + self.passkey = passkey + + +class DataBoxDiskJobSecrets(JobSecrets): + """The secrets related to disk job. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype job_secrets_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: + ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar disk_secrets: Contains the list of secrets object for that device. + :vartype disk_secrets: list[~azure.mgmt.databox.v2021_08_01_preview.models.DiskSecret] + :ivar pass_key: PassKey for the disk Job. + :vartype pass_key: str + :ivar is_passkey_user_defined: Whether passkey was provided by user. + :vartype is_passkey_user_defined: bool + """ + + _validation = { + 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, + 'disk_secrets': {'readonly': True}, + 'pass_key': {'readonly': True}, + 'is_passkey_user_defined': {'readonly': True}, + } + + _attribute_map = { + 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'disk_secrets': {'key': 'diskSecrets', 'type': '[DiskSecret]'}, + 'pass_key': {'key': 'passKey', 'type': 'str'}, + 'is_passkey_user_defined': {'key': 'isPasskeyUserDefined', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxDiskJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxDisk' # type: str + self.disk_secrets = None + self.pass_key = None + self.is_passkey_user_defined = None + + +class DataBoxHeavyAccountCopyLogDetails(CopyLogDetails): + """Copy log details for a storage account for Databox heavy. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar copy_log_details_type: Required. Indicates the type of job details.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype copy_log_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar account_name: Account name. + :vartype account_name: str + :ivar copy_log_link: Link for copy logs. + :vartype copy_log_link: list[str] + :ivar copy_verbose_log_link: Link for copy verbose logs. This will be set only when the + LogCollectionLevel is set to verbose. + :vartype copy_verbose_log_link: list[str] + """ + + _validation = { + 'copy_log_details_type': {'required': True}, + 'account_name': {'readonly': True}, + 'copy_log_link': {'readonly': True}, + 'copy_verbose_log_link': {'readonly': True}, + } + + _attribute_map = { + 'copy_log_details_type': {'key': 'copyLogDetailsType', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'copy_log_link': {'key': 'copyLogLink', 'type': '[str]'}, + 'copy_verbose_log_link': {'key': 'copyVerboseLogLink', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxHeavyAccountCopyLogDetails, self).__init__(**kwargs) + self.copy_log_details_type = 'DataBoxHeavy' # type: str + self.account_name = None + self.copy_log_link = None + self.copy_verbose_log_link = None + + +class DataBoxHeavyJobDetails(JobDetails): + """Databox Heavy Device Job Details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype job_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :ivar copy_log_details: List of copy log details. + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. + :vartype reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or + ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Possible values include: "Invalid", "BY2", "BY1", + "ORK70", "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", + "YTO20", "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", + "TYO22", "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", + "MEL23", "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", + "PUS20", "AdHoc", "CH1", "DSM05", "BN7", "SN6", "PAR22". + :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.models.DataCenterCode + :ivar copy_progress: Copy progress per account. + :vartype copy_progress: list[~azure.mgmt.databox.v2021_08_01_preview.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :vartype device_password: str + """ + + _validation = { + 'job_stages': {'readonly': True}, + 'contact_details': {'required': True}, + 'delivery_package': {'readonly': True}, + 'return_package': {'readonly': True}, + 'job_details_type': {'required': True}, + 'copy_log_details': {'readonly': True}, + 'reverse_shipment_label_sas_key': {'readonly': True}, + 'chain_of_custody_sas_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, + 'datacenter_address': {'readonly': True}, + 'data_center_code': {'readonly': True}, + 'copy_progress': {'readonly': True}, + } + + _attribute_map = { + 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, + 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, + 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'preferences': {'key': 'preferences', 'type': 'Preferences'}, + 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, + 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, + 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, + 'datacenter_address': {'key': 'datacenterAddress', 'type': 'DatacenterAddressResponse'}, + 'data_center_code': {'key': 'dataCenterCode', 'type': 'str'}, + 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, + 'device_password': {'key': 'devicePassword', 'type': 'str'}, + } + + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + device_password: Optional[str] = None, + **kwargs + ): + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox Heavy. Should not be passed + for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxHeavyJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) + self.job_details_type = 'DataBoxHeavy' # type: str + self.copy_progress = None + self.device_password = device_password + + +class DataBoxHeavyJobSecrets(JobSecrets): + """The secrets related to a databox heavy job. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype job_secrets_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: + ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar cabinet_pod_secrets: Contains the list of secret objects for a databox heavy job. + :vartype cabinet_pod_secrets: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataBoxHeavySecret] + """ + + _validation = { + 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, + 'cabinet_pod_secrets': {'readonly': True}, + } + + _attribute_map = { + 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'cabinet_pod_secrets': {'key': 'cabinetPodSecrets', 'type': '[DataBoxHeavySecret]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxHeavyJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBoxHeavy' # type: str + self.cabinet_pod_secrets = None + + +class DataBoxHeavySecret(msrest.serialization.Model): + """The secrets related to a databox heavy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar device_serial_number: Serial number of the assigned device. + :vartype device_serial_number: str + :ivar device_password: Password for out of the box experience on device. + :vartype device_password: str + :ivar network_configurations: Network configuration of the appliance. + :vartype network_configurations: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. + :vartype encoded_validation_cert_pub_key: str + :ivar account_credential_details: Per account level access credentials. + :vartype account_credential_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.AccountCredentialDetails] + """ + + _validation = { + 'device_serial_number': {'readonly': True}, + 'device_password': {'readonly': True}, + 'network_configurations': {'readonly': True}, + 'encoded_validation_cert_pub_key': {'readonly': True}, + 'account_credential_details': {'readonly': True}, + } + + _attribute_map = { + 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, + 'device_password': {'key': 'devicePassword', 'type': 'str'}, + 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, + 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, + 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxHeavySecret, self).__init__(**kwargs) + self.device_serial_number = None + self.device_password = None + self.network_configurations = None + self.encoded_validation_cert_pub_key = None + self.account_credential_details = None + + +class DataBoxJobDetails(JobDetails): + """Databox Job Details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_stages: List of stages that run in the job. + :vartype job_stages: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobStages] + :ivar contact_details: Required. Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :ivar delivery_package: Delivery package shipping details. + :vartype delivery_package: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar return_package: Return package shipping details. + :vartype return_package: ~azure.mgmt.databox.v2021_08_01_preview.models.PackageShippingDetails + :ivar data_import_details: Details of the data to be imported into azure. + :vartype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :ivar data_export_details: Details of the data to be exported from azure. + :vartype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :ivar job_details_type: Required. Indicates the type of job details.Constant filled by server. + Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype job_details_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar preferences: Preferences for the order. + :vartype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :ivar copy_log_details: List of copy log details. + :vartype copy_log_details: list[~azure.mgmt.databox.v2021_08_01_preview.models.CopyLogDetails] + :ivar reverse_shipment_label_sas_key: Shared access key to download the return shipment label. + :vartype reverse_shipment_label_sas_key: str + :ivar chain_of_custody_sas_key: Shared access key to download the chain of custody logs. + :vartype chain_of_custody_sas_key: str + :ivar key_encryption_key: Details about which key encryption type is being used. + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :ivar expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + :ivar actions: Available actions on the job. + :vartype actions: list[str or + ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode] + :ivar last_mitigation_action_on_job: Last mitigation action performed on the job. + :vartype last_mitigation_action_on_job: + ~azure.mgmt.databox.v2021_08_01_preview.models.LastMitigationActionOnJob + :ivar datacenter_address: Datacenter address to ship to, for the given sku and storage + location. + :vartype datacenter_address: + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressResponse + :ivar data_center_code: DataCenter code. Possible values include: "Invalid", "BY2", "BY1", + "ORK70", "AM2", "AMS20", "BY21", "BY24", "MWH01", "AMS06", "SSE90", "SYD03", "SYD23", "CBR20", + "YTO20", "CWL20", "LON24", "BOM01", "BL20", "BL7", "SEL20", "TYO01", "BN1", "SN5", "CYS04", + "TYO22", "YTO21", "YQB20", "FRA22", "MAA01", "CPQ02", "CPQ20", "SIN20", "HKG20", "SG2", + "MEL23", "SEL21", "OSA20", "SHA03", "BJB", "JNB22", "JNB21", "MNZ21", "SN8", "AUH20", "ZRH20", + "PUS20", "AdHoc", "CH1", "DSM05", "BN7", "SN6", "PAR22". + :vartype data_center_code: str or ~azure.mgmt.databox.v2021_08_01_preview.models.DataCenterCode + :ivar copy_progress: Copy progress per storage account. + :vartype copy_progress: list[~azure.mgmt.databox.v2021_08_01_preview.models.CopyProgress] + :ivar device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :vartype device_password: str + """ + + _validation = { + 'job_stages': {'readonly': True}, + 'contact_details': {'required': True}, + 'delivery_package': {'readonly': True}, + 'return_package': {'readonly': True}, + 'job_details_type': {'required': True}, + 'copy_log_details': {'readonly': True}, + 'reverse_shipment_label_sas_key': {'readonly': True}, + 'chain_of_custody_sas_key': {'readonly': True}, + 'actions': {'readonly': True}, + 'last_mitigation_action_on_job': {'readonly': True}, + 'datacenter_address': {'readonly': True}, + 'data_center_code': {'readonly': True}, + 'copy_progress': {'readonly': True}, + } + + _attribute_map = { + 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, + 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageShippingDetails'}, + 'return_package': {'key': 'returnPackage', 'type': 'PackageShippingDetails'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'job_details_type': {'key': 'jobDetailsType', 'type': 'str'}, + 'preferences': {'key': 'preferences', 'type': 'Preferences'}, + 'copy_log_details': {'key': 'copyLogDetails', 'type': '[CopyLogDetails]'}, + 'reverse_shipment_label_sas_key': {'key': 'reverseShipmentLabelSasKey', 'type': 'str'}, + 'chain_of_custody_sas_key': {'key': 'chainOfCustodySasKey', 'type': 'str'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + 'actions': {'key': 'actions', 'type': '[str]'}, + 'last_mitigation_action_on_job': {'key': 'lastMitigationActionOnJob', 'type': 'LastMitigationActionOnJob'}, + 'datacenter_address': {'key': 'datacenterAddress', 'type': 'DatacenterAddressResponse'}, + 'data_center_code': {'key': 'dataCenterCode', 'type': 'str'}, + 'copy_progress': {'key': 'copyProgress', 'type': '[CopyProgress]'}, + 'device_password': {'key': 'devicePassword', 'type': 'str'}, + } + + def __init__( + self, + *, + contact_details: "ContactDetails", + shipping_address: Optional["ShippingAddress"] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + data_export_details: Optional[List["DataExportDetails"]] = None, + preferences: Optional["Preferences"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + expected_data_size_in_tera_bytes: Optional[int] = None, + device_password: Optional[str] = None, + **kwargs + ): + """ + :keyword contact_details: Required. Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :keyword data_import_details: Details of the data to be imported into azure. + :paramtype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :keyword data_export_details: Details of the data to be exported from azure. + :paramtype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :keyword preferences: Preferences for the order. + :paramtype preferences: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :keyword key_encryption_key: Details about which key encryption type is being used. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :keyword expected_data_size_in_tera_bytes: The expected size of the data, which needs to be + transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + :keyword device_password: Set Device password for unlocking Databox. Should not be passed for + TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password + itself. This will not be returned in Get Call. Password Requirements : Password must be + minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, + one number and one special character. Password cannot have the following characters : IilLoO0 + Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype device_password: str + """ + super(DataBoxJobDetails, self).__init__(contact_details=contact_details, shipping_address=shipping_address, data_import_details=data_import_details, data_export_details=data_export_details, preferences=preferences, key_encryption_key=key_encryption_key, expected_data_size_in_tera_bytes=expected_data_size_in_tera_bytes, **kwargs) + self.job_details_type = 'DataBox' # type: str + self.copy_progress = None + self.device_password = device_password + + +class DataboxJobSecrets(JobSecrets): + """The secrets related to a databox job. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar job_secrets_type: Required. Used to indicate what type of job secrets object.Constant + filled by server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype job_secrets_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ClassDiscriminator + :ivar dc_access_security_code: Dc Access Security Code for Customer Managed Shipping. + :vartype dc_access_security_code: + ~azure.mgmt.databox.v2021_08_01_preview.models.DcAccessSecurityCode + :ivar error: Error while fetching the secrets. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar pod_secrets: Contains the list of secret objects for a job. + :vartype pod_secrets: list[~azure.mgmt.databox.v2021_08_01_preview.models.DataBoxSecret] + """ + + _validation = { + 'job_secrets_type': {'required': True}, + 'dc_access_security_code': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, + 'dc_access_security_code': {'key': 'dcAccessSecurityCode', 'type': 'DcAccessSecurityCode'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, + } + + def __init__( + self, + *, + pod_secrets: Optional[List["DataBoxSecret"]] = None, + **kwargs + ): + """ + :keyword pod_secrets: Contains the list of secret objects for a job. + :paramtype pod_secrets: list[~azure.mgmt.databox.v2021_08_01_preview.models.DataBoxSecret] + """ + super(DataboxJobSecrets, self).__init__(**kwargs) + self.job_secrets_type = 'DataBox' # type: str + self.pod_secrets = pod_secrets + + +class ScheduleAvailabilityRequest(msrest.serialization.Model): + """Request body to get the availability for scheduling orders. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DataBoxScheduleAvailabilityRequest, DiskScheduleAvailabilityRequest, HeavyScheduleAvailabilityRequest. + + All required parameters must be populated in order to send to Azure. + + :ivar storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str + """ + + _validation = { + 'storage_location': {'required': True}, + 'sku_name': {'required': True}, + } + + _attribute_map = { + 'storage_location': {'key': 'storageLocation', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + _subtype_map = { + 'sku_name': {'DataBox': 'DataBoxScheduleAvailabilityRequest', 'DataBoxDisk': 'DiskScheduleAvailabilityRequest', 'DataBoxHeavy': 'HeavyScheduleAvailabilityRequest'} + } + + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + **kwargs + ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ + super(ScheduleAvailabilityRequest, self).__init__(**kwargs) + self.storage_location = storage_location + self.sku_name = None # type: Optional[str] + self.country = country + + +class DataBoxScheduleAvailabilityRequest(ScheduleAvailabilityRequest): + """Request body to get the availability for scheduling data box orders orders. + + All required parameters must be populated in order to send to Azure. + + :ivar storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str + """ + + _validation = { + 'storage_location': {'required': True}, + 'sku_name': {'required': True}, + } + + _attribute_map = { + 'storage_location': {'key': 'storageLocation', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + **kwargs + ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ + super(DataBoxScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) + self.sku_name = 'DataBox' # type: str + + +class DataBoxSecret(msrest.serialization.Model): + """The secrets related to a DataBox. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar device_serial_number: Serial number of the assigned device. + :vartype device_serial_number: str + :ivar device_password: Password for out of the box experience on device. + :vartype device_password: str + :ivar network_configurations: Network configuration of the appliance. + :vartype network_configurations: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ApplianceNetworkConfiguration] + :ivar encoded_validation_cert_pub_key: The base 64 encoded public key to authenticate with the + device. + :vartype encoded_validation_cert_pub_key: str + :ivar account_credential_details: Per account level access credentials. + :vartype account_credential_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.AccountCredentialDetails] + """ + + _validation = { + 'device_serial_number': {'readonly': True}, + 'device_password': {'readonly': True}, + 'network_configurations': {'readonly': True}, + 'encoded_validation_cert_pub_key': {'readonly': True}, + 'account_credential_details': {'readonly': True}, + } + + _attribute_map = { + 'device_serial_number': {'key': 'deviceSerialNumber', 'type': 'str'}, + 'device_password': {'key': 'devicePassword', 'type': 'str'}, + 'network_configurations': {'key': 'networkConfigurations', 'type': '[ApplianceNetworkConfiguration]'}, + 'encoded_validation_cert_pub_key': {'key': 'encodedValidationCertPubKey', 'type': 'str'}, + 'account_credential_details': {'key': 'accountCredentialDetails', 'type': '[AccountCredentialDetails]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataBoxSecret, self).__init__(**kwargs) + self.device_serial_number = None + self.device_password = None + self.network_configurations = None + self.encoded_validation_cert_pub_key = None + self.account_credential_details = None + + +class DatacenterAddressResponse(msrest.serialization.Model): + """Datacenter address for given storage location. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DatacenterAddressInstructionResponse, DatacenterAddressLocationResponse. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar datacenter_address_type: Required. Data center address type.Constant filled by server. + Possible values include: "DatacenterAddressLocation", "DatacenterAddressInstruction". + :vartype datacenter_address_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressType + :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. + :vartype supported_carriers_for_return_shipment: list[str] + :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. + :vartype data_center_azure_location: str + """ + + _validation = { + 'datacenter_address_type': {'required': True}, + 'supported_carriers_for_return_shipment': {'readonly': True}, + 'data_center_azure_location': {'readonly': True}, + } + + _attribute_map = { + 'datacenter_address_type': {'key': 'datacenterAddressType', 'type': 'str'}, + 'supported_carriers_for_return_shipment': {'key': 'supportedCarriersForReturnShipment', 'type': '[str]'}, + 'data_center_azure_location': {'key': 'dataCenterAzureLocation', 'type': 'str'}, + } + + _subtype_map = { + 'datacenter_address_type': {'DatacenterAddressInstruction': 'DatacenterAddressInstructionResponse', 'DatacenterAddressLocation': 'DatacenterAddressLocationResponse'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DatacenterAddressResponse, self).__init__(**kwargs) + self.datacenter_address_type = None # type: Optional[str] + self.supported_carriers_for_return_shipment = None + self.data_center_azure_location = None + + +class DatacenterAddressInstructionResponse(DatacenterAddressResponse): + """Datacenter instruction for given storage location. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar datacenter_address_type: Required. Data center address type.Constant filled by server. + Possible values include: "DatacenterAddressLocation", "DatacenterAddressInstruction". + :vartype datacenter_address_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressType + :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. + :vartype supported_carriers_for_return_shipment: list[str] + :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. + :vartype data_center_azure_location: str + :ivar communication_instruction: Data center communication instruction. + :vartype communication_instruction: str + """ + + _validation = { + 'datacenter_address_type': {'required': True}, + 'supported_carriers_for_return_shipment': {'readonly': True}, + 'data_center_azure_location': {'readonly': True}, + 'communication_instruction': {'readonly': True}, + } + + _attribute_map = { + 'datacenter_address_type': {'key': 'datacenterAddressType', 'type': 'str'}, + 'supported_carriers_for_return_shipment': {'key': 'supportedCarriersForReturnShipment', 'type': '[str]'}, + 'data_center_azure_location': {'key': 'dataCenterAzureLocation', 'type': 'str'}, + 'communication_instruction': {'key': 'communicationInstruction', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DatacenterAddressInstructionResponse, self).__init__(**kwargs) + self.datacenter_address_type = 'DatacenterAddressInstruction' # type: str + self.communication_instruction = None + + +class DatacenterAddressLocationResponse(DatacenterAddressResponse): + """Datacenter address for given storage location. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar datacenter_address_type: Required. Data center address type.Constant filled by server. + Possible values include: "DatacenterAddressLocation", "DatacenterAddressInstruction". + :vartype datacenter_address_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressType + :ivar supported_carriers_for_return_shipment: List of supported carriers for return shipment. + :vartype supported_carriers_for_return_shipment: list[str] + :ivar data_center_azure_location: Azure Location where the Data Center serves primarily. + :vartype data_center_azure_location: str + :ivar contact_person_name: Contact person name. + :vartype contact_person_name: str + :ivar company: Company name. + :vartype company: str + :ivar street1: Street address line 1. + :vartype street1: str + :ivar street2: Street address line 2. + :vartype street2: str + :ivar street3: Street address line 3. + :vartype street3: str + :ivar city: City name. + :vartype city: str + :ivar state: name of the state. + :vartype state: str + :ivar zip: Zip code. + :vartype zip: str + :ivar country: name of the country. + :vartype country: str + :ivar phone: Phone number. + :vartype phone: str + :ivar phone_extension: Phone extension. + :vartype phone_extension: str + :ivar address_type: Address type. + :vartype address_type: str + :ivar additional_shipping_information: Special instruction for shipping. + :vartype additional_shipping_information: str + """ + + _validation = { + 'datacenter_address_type': {'required': True}, + 'supported_carriers_for_return_shipment': {'readonly': True}, + 'data_center_azure_location': {'readonly': True}, + 'contact_person_name': {'readonly': True}, + 'company': {'readonly': True}, + 'street1': {'readonly': True}, + 'street2': {'readonly': True}, + 'street3': {'readonly': True}, + 'city': {'readonly': True}, + 'state': {'readonly': True}, + 'zip': {'readonly': True}, + 'country': {'readonly': True}, + 'phone': {'readonly': True}, + 'phone_extension': {'readonly': True}, + 'address_type': {'readonly': True}, + 'additional_shipping_information': {'readonly': True}, + } + + _attribute_map = { + 'datacenter_address_type': {'key': 'datacenterAddressType', 'type': 'str'}, + 'supported_carriers_for_return_shipment': {'key': 'supportedCarriersForReturnShipment', 'type': '[str]'}, + 'data_center_azure_location': {'key': 'dataCenterAzureLocation', 'type': 'str'}, + 'contact_person_name': {'key': 'contactPersonName', 'type': 'str'}, + 'company': {'key': 'company', 'type': 'str'}, + 'street1': {'key': 'street1', 'type': 'str'}, + 'street2': {'key': 'street2', 'type': 'str'}, + 'street3': {'key': 'street3', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'zip': {'key': 'zip', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'phone_extension': {'key': 'phoneExtension', 'type': 'str'}, + 'address_type': {'key': 'addressType', 'type': 'str'}, + 'additional_shipping_information': {'key': 'additionalShippingInformation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DatacenterAddressLocationResponse, self).__init__(**kwargs) + self.datacenter_address_type = 'DatacenterAddressLocation' # type: str + self.contact_person_name = None + self.company = None + self.street1 = None + self.street2 = None + self.street3 = None + self.city = None + self.state = None + self.zip = None + self.country = None + self.phone = None + self.phone_extension = None + self.address_type = None + self.additional_shipping_information = None + + +class DatacenterAddressRequest(msrest.serialization.Model): + """Request body to get the datacenter address. + + All required parameters must be populated in order to send to Azure. + + :ivar storage_location: Required. Storage location. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the data center address requested. Possible values + include: "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + """ + + _validation = { + 'storage_location': {'required': True}, + 'sku_name': {'required': True}, + } + + _attribute_map = { + 'storage_location': {'key': 'storageLocation', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_location: str, + sku_name: Union[str, "SkuName"], + **kwargs + ): + """ + :keyword storage_location: Required. Storage location. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword sku_name: Required. Sku Name for which the data center address requested. Possible + values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :paramtype sku_name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + """ + super(DatacenterAddressRequest, self).__init__(**kwargs) + self.storage_location = storage_location + self.sku_name = sku_name + + +class DataExportDetails(msrest.serialization.Model): + """Details of the data to be used for exporting data from azure. + + All required parameters must be populated in order to send to Azure. + + :ivar transfer_configuration: Required. Configuration for the data transfer. + :vartype transfer_configuration: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransferConfiguration + :ivar log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". + :vartype log_collection_level: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.LogCollectionLevel + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountDetails + """ + + _validation = { + 'transfer_configuration': {'required': True}, + 'account_details': {'required': True}, + } + + _attribute_map = { + 'transfer_configuration': {'key': 'transferConfiguration', 'type': 'TransferConfiguration'}, + 'log_collection_level': {'key': 'logCollectionLevel', 'type': 'str'}, + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, + } + + def __init__( + self, + *, + transfer_configuration: "TransferConfiguration", + account_details: "DataAccountDetails", + log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = None, + **kwargs + ): + """ + :keyword transfer_configuration: Required. Configuration for the data transfer. + :paramtype transfer_configuration: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransferConfiguration + :keyword log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". + :paramtype log_collection_level: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.LogCollectionLevel + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountDetails + """ + super(DataExportDetails, self).__init__(**kwargs) + self.transfer_configuration = transfer_configuration + self.log_collection_level = log_collection_level + self.account_details = account_details + + +class DataImportDetails(msrest.serialization.Model): + """Details of the data to be used for importing data to azure. + + All required parameters must be populated in order to send to Azure. + + :ivar account_details: Required. Account details of the data to be transferred. + :vartype account_details: ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountDetails + :ivar log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". + :vartype log_collection_level: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.LogCollectionLevel + """ + + _validation = { + 'account_details': {'required': True}, + } + + _attribute_map = { + 'account_details': {'key': 'accountDetails', 'type': 'DataAccountDetails'}, + 'log_collection_level': {'key': 'logCollectionLevel', 'type': 'str'}, + } + + def __init__( + self, + *, + account_details: "DataAccountDetails", + log_collection_level: Optional[Union[str, "LogCollectionLevel"]] = None, + **kwargs + ): + """ + :keyword account_details: Required. Account details of the data to be transferred. + :paramtype account_details: ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountDetails + :keyword log_collection_level: Level of the logs to be collected. Possible values include: + "Error", "Verbose". + :paramtype log_collection_level: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.LogCollectionLevel + """ + super(DataImportDetails, self).__init__(**kwargs) + self.account_details = account_details + self.log_collection_level = log_collection_level + + +class DataLocationToServiceLocationMap(msrest.serialization.Model): + """Map of data location to service location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar data_location: Location of the data. + :vartype data_location: str + :ivar service_location: Location of the service. + :vartype service_location: str + """ + + _validation = { + 'data_location': {'readonly': True}, + 'service_location': {'readonly': True}, + } + + _attribute_map = { + 'data_location': {'key': 'dataLocation', 'type': 'str'}, + 'service_location': {'key': 'serviceLocation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataLocationToServiceLocationMap, self).__init__(**kwargs) + self.data_location = None + self.service_location = None + + +class DataTransferDetailsValidationRequest(ValidationInputRequest): + """Request to validate export and import data details. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar data_export_details: List of DataTransfer details to be used to export data from azure. + :vartype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :ivar data_import_details: List of DataTransfer details to be used to import data to azure. + :vartype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :ivar device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + """ + + _validation = { + 'validation_type': {'required': True}, + 'device_type': {'required': True}, + 'transfer_type': {'required': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'data_export_details': {'key': 'dataExportDetails', 'type': '[DataExportDetails]'}, + 'data_import_details': {'key': 'dataImportDetails', 'type': '[DataImportDetails]'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, + } + + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + data_export_details: Optional[List["DataExportDetails"]] = None, + data_import_details: Optional[List["DataImportDetails"]] = None, + **kwargs + ): + """ + :keyword data_export_details: List of DataTransfer details to be used to export data from + azure. + :paramtype data_export_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataExportDetails] + :keyword data_import_details: List of DataTransfer details to be used to import data to azure. + :paramtype data_import_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataImportDetails] + :keyword device_type: Required. Device type. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + """ + super(DataTransferDetailsValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.data_export_details = data_export_details + self.data_import_details = data_import_details + self.device_type = device_type + self.transfer_type = transfer_type + + +class DataTransferDetailsValidationResponseProperties(ValidationInputResponse): + """Properties of data transfer details validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar status: Data transfer details validation status. Possible values include: "Valid", + "Invalid", "Skipped". + :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationStatus + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DataTransferDetailsValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateDataTransferDetails' # type: str + self.status = None + + +class DcAccessSecurityCode(msrest.serialization.Model): + """Dc access security code. + + :ivar reverse_dc_access_code: Reverse Dc access security code. + :vartype reverse_dc_access_code: str + :ivar forward_dc_access_code: Forward Dc access security code. + :vartype forward_dc_access_code: str + """ + + _attribute_map = { + 'reverse_dc_access_code': {'key': 'reverseDCAccessCode', 'type': 'str'}, + 'forward_dc_access_code': {'key': 'forwardDCAccessCode', 'type': 'str'}, + } + + def __init__( + self, + *, + reverse_dc_access_code: Optional[str] = None, + forward_dc_access_code: Optional[str] = None, + **kwargs + ): + """ + :keyword reverse_dc_access_code: Reverse Dc access security code. + :paramtype reverse_dc_access_code: str + :keyword forward_dc_access_code: Forward Dc access security code. + :paramtype forward_dc_access_code: str + """ + super(DcAccessSecurityCode, self).__init__(**kwargs) + self.reverse_dc_access_code = reverse_dc_access_code + self.forward_dc_access_code = forward_dc_access_code + + +class Details(msrest.serialization.Model): + """Details. + + All required parameters must be populated in order to send to Azure. + + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: str, + message: str, + **kwargs + ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + """ + super(Details, self).__init__(**kwargs) + self.code = code + self.message = message + + +class DiskScheduleAvailabilityRequest(ScheduleAvailabilityRequest): + """Request body to get the availability for scheduling disk orders. + + All required parameters must be populated in order to send to Azure. + + :ivar storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str + :ivar expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs to + be transferred in this job, in terabytes. + :vartype expected_data_size_in_tera_bytes: int + """ + + _validation = { + 'storage_location': {'required': True}, + 'sku_name': {'required': True}, + 'expected_data_size_in_tera_bytes': {'required': True}, + } + + _attribute_map = { + 'storage_location': {'key': 'storageLocation', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'expected_data_size_in_tera_bytes': {'key': 'expectedDataSizeInTeraBytes', 'type': 'int'}, + } + + def __init__( + self, + *, + storage_location: str, + expected_data_size_in_tera_bytes: int, + country: Optional[str] = None, + **kwargs + ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + :keyword expected_data_size_in_tera_bytes: Required. The expected size of the data, which needs + to be transferred in this job, in terabytes. + :paramtype expected_data_size_in_tera_bytes: int + """ + super(DiskScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) + self.sku_name = 'DataBoxDisk' # type: str + self.expected_data_size_in_tera_bytes = expected_data_size_in_tera_bytes + + +class DiskSecret(msrest.serialization.Model): + """Contains all the secrets of a Disk. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar disk_serial_number: Serial number of the assigned disk. + :vartype disk_serial_number: str + :ivar bit_locker_key: Bit Locker key of the disk which can be used to unlock the disk to copy + data. + :vartype bit_locker_key: str + """ + + _validation = { + 'disk_serial_number': {'readonly': True}, + 'bit_locker_key': {'readonly': True}, + } + + _attribute_map = { + 'disk_serial_number': {'key': 'diskSerialNumber', 'type': 'str'}, + 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DiskSecret, self).__init__(**kwargs) + self.disk_serial_number = None + self.bit_locker_key = None + + +class EncryptionPreferences(msrest.serialization.Model): + """Preferences related to the Encryption. + + :ivar double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :vartype double_encryption: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DoubleEncryption + """ + + _attribute_map = { + 'double_encryption': {'key': 'doubleEncryption', 'type': 'str'}, + } + + def __init__( + self, + *, + double_encryption: Optional[Union[str, "DoubleEncryption"]] = "Disabled", + **kwargs + ): + """ + :keyword double_encryption: Defines secondary layer of software-based encryption enablement. + Possible values include: "Enabled", "Disabled". Default value: "Disabled". + :paramtype double_encryption: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DoubleEncryption + """ + super(EncryptionPreferences, self).__init__(**kwargs) + self.double_encryption = double_encryption + + +class ErrorDetail(msrest.serialization.Model): + """ErrorDetail. + + All required parameters must be populated in order to send to Azure. + + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar details: + :vartype details: list[~azure.mgmt.databox.v2021_08_01_preview.models.Details] + :ivar target: + :vartype target: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Details]'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + *, + code: str, + message: str, + details: Optional[List["Details"]] = None, + target: Optional[str] = None, + **kwargs + ): + """ + :keyword code: Required. + :paramtype code: str + :keyword message: Required. + :paramtype message: str + :keyword details: + :paramtype details: list[~azure.mgmt.databox.v2021_08_01_preview.models.Details] + :keyword target: + :paramtype target: str + """ + super(ErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + self.target = target + + +class ExportDiskDetails(msrest.serialization.Model): + """Export disk details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar manifest_file: The relative path of the manifest file on the disk. + :vartype manifest_file: str + :ivar manifest_hash: The Base16-encoded MD5 hash of the manifest file on the disk. + :vartype manifest_hash: str + :ivar backup_manifest_cloud_path: Path to backed up manifest, only returned if + enableManifestBackup is true. + :vartype backup_manifest_cloud_path: str + """ + + _validation = { + 'manifest_file': {'readonly': True}, + 'manifest_hash': {'readonly': True}, + 'backup_manifest_cloud_path': {'readonly': True}, + } + + _attribute_map = { + 'manifest_file': {'key': 'manifestFile', 'type': 'str'}, + 'manifest_hash': {'key': 'manifestHash', 'type': 'str'}, + 'backup_manifest_cloud_path': {'key': 'backupManifestCloudPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ExportDiskDetails, self).__init__(**kwargs) + self.manifest_file = None + self.manifest_hash = None + self.backup_manifest_cloud_path = None + + +class FilterFileDetails(msrest.serialization.Model): + """Details of the filter files to be used for data transfer. + + All required parameters must be populated in order to send to Azure. + + :ivar filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :vartype filter_file_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.FilterFileType + :ivar filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :vartype filter_file_path: str + """ + + _validation = { + 'filter_file_type': {'required': True}, + 'filter_file_path': {'required': True}, + } + + _attribute_map = { + 'filter_file_type': {'key': 'filterFileType', 'type': 'str'}, + 'filter_file_path': {'key': 'filterFilePath', 'type': 'str'}, + } + + def __init__( + self, + *, + filter_file_type: Union[str, "FilterFileType"], + filter_file_path: str, + **kwargs + ): + """ + :keyword filter_file_type: Required. Type of the filter file. Possible values include: + "AzureBlob", "AzureFile". + :paramtype filter_file_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.FilterFileType + :keyword filter_file_path: Required. Path of the file that contains the details of all items to + transfer. + :paramtype filter_file_path: str + """ + super(FilterFileDetails, self).__init__(**kwargs) + self.filter_file_type = filter_file_type + self.filter_file_path = filter_file_path + + +class HeavyScheduleAvailabilityRequest(ScheduleAvailabilityRequest): + """Request body to get the availability for scheduling heavy orders. + + All required parameters must be populated in order to send to Azure. + + :ivar storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype storage_location: str + :ivar sku_name: Required. Sku Name for which the order is to be scheduled.Constant filled by + server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy", + "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :ivar country: Country in which storage location should be supported. + :vartype country: str + """ + + _validation = { + 'storage_location': {'required': True}, + 'sku_name': {'required': True}, + } + + _attribute_map = { + 'storage_location': {'key': 'storageLocation', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_location: str, + country: Optional[str] = None, + **kwargs + ): + """ + :keyword storage_location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype storage_location: str + :keyword country: Country in which storage location should be supported. + :paramtype country: str + """ + super(HeavyScheduleAvailabilityRequest, self).__init__(storage_location=storage_location, country=country, **kwargs) + self.sku_name = 'DataBoxHeavy' # type: str + + +class IdentityProperties(msrest.serialization.Model): + """Managed identity properties. + + :ivar type: Managed service identity type. + :vartype type: str + :ivar user_assigned: User assigned identity properties. + :vartype user_assigned: ~azure.mgmt.databox.v2021_08_01_preview.models.UserAssignedProperties + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned': {'key': 'userAssigned', 'type': 'UserAssignedProperties'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + user_assigned: Optional["UserAssignedProperties"] = None, + **kwargs + ): + """ + :keyword type: Managed service identity type. + :paramtype type: str + :keyword user_assigned: User assigned identity properties. + :paramtype user_assigned: ~azure.mgmt.databox.v2021_08_01_preview.models.UserAssignedProperties + """ + super(IdentityProperties, self).__init__(**kwargs) + self.type = type + self.user_assigned = user_assigned + + +class ImportDiskDetails(msrest.serialization.Model): + """Import disk details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar manifest_file: Required. The relative path of the manifest file on the disk. + :vartype manifest_file: str + :ivar manifest_hash: Required. The Base16-encoded MD5 hash of the manifest file on the disk. + :vartype manifest_hash: str + :ivar bit_locker_key: Required. BitLocker key used to encrypt the disk. + :vartype bit_locker_key: str + :ivar backup_manifest_cloud_path: Path to backed up manifest, only returned if + enableManifestBackup is true. + :vartype backup_manifest_cloud_path: str + """ + + _validation = { + 'manifest_file': {'required': True}, + 'manifest_hash': {'required': True}, + 'bit_locker_key': {'required': True}, + 'backup_manifest_cloud_path': {'readonly': True}, + } + + _attribute_map = { + 'manifest_file': {'key': 'manifestFile', 'type': 'str'}, + 'manifest_hash': {'key': 'manifestHash', 'type': 'str'}, + 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, + 'backup_manifest_cloud_path': {'key': 'backupManifestCloudPath', 'type': 'str'}, + } + + def __init__( + self, + *, + manifest_file: str, + manifest_hash: str, + bit_locker_key: str, + **kwargs + ): + """ + :keyword manifest_file: Required. The relative path of the manifest file on the disk. + :paramtype manifest_file: str + :keyword manifest_hash: Required. The Base16-encoded MD5 hash of the manifest file on the disk. + :paramtype manifest_hash: str + :keyword bit_locker_key: Required. BitLocker key used to encrypt the disk. + :paramtype bit_locker_key: str + """ + super(ImportDiskDetails, self).__init__(**kwargs) + self.manifest_file = manifest_file + self.manifest_hash = manifest_hash + self.bit_locker_key = bit_locker_key + self.backup_manifest_cloud_path = None + + +class JobDeliveryInfo(msrest.serialization.Model): + """Additional delivery info. + + :ivar scheduled_date_time: Scheduled date time. + :vartype scheduled_date_time: ~datetime.datetime + """ + + _attribute_map = { + 'scheduled_date_time': {'key': 'scheduledDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + scheduled_date_time: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword scheduled_date_time: Scheduled date time. + :paramtype scheduled_date_time: ~datetime.datetime + """ + super(JobDeliveryInfo, self).__init__(**kwargs) + self.scheduled_date_time = scheduled_date_time + + +class Resource(msrest.serialization.Model): + """Model of the Resource. + + All required parameters must be populated in order to send to Azure. + + :ivar location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2021_08_01_preview.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2021_08_01_preview.models.ResourceIdentity + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + } + + def __init__( + self, + *, + location: str, + sku: "Sku", + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + **kwargs + ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2021_08_01_preview.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2021_08_01_preview.models.ResourceIdentity + """ + super(Resource, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.sku = sku + self.identity = identity + + +class JobResource(Resource): + """Job Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar location: Required. The location of the resource. This will be one of the supported and + registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :vartype location: str + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). + :vartype tags: dict[str, str] + :ivar sku: Required. The sku type. + :vartype sku: ~azure.mgmt.databox.v2021_08_01_preview.models.Sku + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2021_08_01_preview.models.ResourceIdentity + :ivar name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.databox.v2021_08_01_preview.models.SystemData + :ivar transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + :ivar is_cancellable: Describes whether the job is cancellable or not. + :vartype is_cancellable: bool + :ivar is_deletable: Describes whether the job is deletable or not. + :vartype is_deletable: bool + :ivar is_shipping_address_editable: Describes whether the shipping address is editable or not. + :vartype is_shipping_address_editable: bool + :ivar is_prepare_to_ship_enabled: Is Prepare To Ship Enabled on this job. + :vartype is_prepare_to_ship_enabled: bool + :ivar status: Name of the stage which is in progress. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", + "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", "ShippedToCustomer". + :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.StageName + :ivar start_time: Time at which the job was started in UTC ISO 8601 format. + :vartype start_time: ~datetime.datetime + :ivar error: Top level error for the job. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar details: Details of a job run. This field will only be sent for expand details filter. + :vartype details: ~azure.mgmt.databox.v2021_08_01_preview.models.JobDetails + :ivar cancellation_reason: Reason for cancellation. + :vartype cancellation_reason: str + :ivar delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :vartype delivery_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.JobDeliveryType + :ivar delivery_info: Delivery Info of Job. + :vartype delivery_info: ~azure.mgmt.databox.v2021_08_01_preview.models.JobDeliveryInfo + :ivar is_cancellable_without_fee: Flag to indicate cancellation of scheduled job. + :vartype is_cancellable_without_fee: bool + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'transfer_type': {'required': True}, + 'is_cancellable': {'readonly': True}, + 'is_deletable': {'readonly': True}, + 'is_shipping_address_editable': {'readonly': True}, + 'is_prepare_to_ship_enabled': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'error': {'readonly': True}, + 'cancellation_reason': {'readonly': True}, + 'is_cancellable_without_fee': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'transfer_type': {'key': 'properties.transferType', 'type': 'str'}, + 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, + 'is_deletable': {'key': 'properties.isDeletable', 'type': 'bool'}, + 'is_shipping_address_editable': {'key': 'properties.isShippingAddressEditable', 'type': 'bool'}, + 'is_prepare_to_ship_enabled': {'key': 'properties.isPrepareToShipEnabled', 'type': 'bool'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'error': {'key': 'properties.error', 'type': 'CloudError'}, + 'details': {'key': 'properties.details', 'type': 'JobDetails'}, + 'cancellation_reason': {'key': 'properties.cancellationReason', 'type': 'str'}, + 'delivery_type': {'key': 'properties.deliveryType', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'JobDeliveryInfo'}, + 'is_cancellable_without_fee': {'key': 'properties.isCancellableWithoutFee', 'type': 'bool'}, + } + + def __init__( + self, + *, + location: str, + sku: "Sku", + transfer_type: Union[str, "TransferType"], + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + details: Optional["JobDetails"] = None, + delivery_type: Optional[Union[str, "JobDeliveryType"]] = "NonScheduled", + delivery_info: Optional["JobDeliveryInfo"] = None, + **kwargs + ): + """ + :keyword location: Required. The location of the resource. This will be one of the supported + and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a + resource cannot be changed once it is created, but if an identical region is specified on + update the request will succeed. + :paramtype location: str + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword sku: Required. The sku type. + :paramtype sku: ~azure.mgmt.databox.v2021_08_01_preview.models.Sku + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2021_08_01_preview.models.ResourceIdentity + :keyword transfer_type: Required. Type of the data transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + :keyword details: Details of a job run. This field will only be sent for expand details filter. + :paramtype details: ~azure.mgmt.databox.v2021_08_01_preview.models.JobDetails + :keyword delivery_type: Delivery type of Job. Possible values include: "NonScheduled", + "Scheduled". Default value: "NonScheduled". + :paramtype delivery_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.JobDeliveryType + :keyword delivery_info: Delivery Info of Job. + :paramtype delivery_info: ~azure.mgmt.databox.v2021_08_01_preview.models.JobDeliveryInfo + """ + super(JobResource, self).__init__(location=location, tags=tags, sku=sku, identity=identity, **kwargs) + self.name = None + self.id = None + self.type = None + self.system_data = None + self.transfer_type = transfer_type + self.is_cancellable = None + self.is_deletable = None + self.is_shipping_address_editable = None + self.is_prepare_to_ship_enabled = None + self.status = None + self.start_time = None + self.error = None + self.details = details + self.cancellation_reason = None + self.delivery_type = delivery_type + self.delivery_info = delivery_info + self.is_cancellable_without_fee = None + + +class JobResourceList(msrest.serialization.Model): + """Job Resource Collection. + + :ivar value: List of job resources. + :vartype value: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobResource] + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["JobResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: List of job resources. + :paramtype value: list[~azure.mgmt.databox.v2021_08_01_preview.models.JobResource] + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ + super(JobResourceList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class JobResourceUpdateParameter(msrest.serialization.Model): + """The JobResourceUpdateParameter. + + :ivar tags: A set of tags. The list of key value pairs that describe the resource. These tags + can be used in viewing and grouping this resource (across resource groups). + :vartype tags: dict[str, str] + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.databox.v2021_08_01_preview.models.ResourceIdentity + :ivar details: Details of a job to be updated. + :vartype details: ~azure.mgmt.databox.v2021_08_01_preview.models.UpdateJobDetails + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'details': {'key': 'properties.details', 'type': 'UpdateJobDetails'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ResourceIdentity"] = None, + details: Optional["UpdateJobDetails"] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource (across resource groups). + :paramtype tags: dict[str, str] + :keyword identity: Msi identity of the resource. + :paramtype identity: ~azure.mgmt.databox.v2021_08_01_preview.models.ResourceIdentity + :keyword details: Details of a job to be updated. + :paramtype details: ~azure.mgmt.databox.v2021_08_01_preview.models.UpdateJobDetails + """ + super(JobResourceUpdateParameter, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + self.details = details + + +class JobStages(msrest.serialization.Model): + """Job stages. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar stage_name: Name of the job stage. Possible values include: "DeviceOrdered", + "DevicePrepared", "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Completed", + "CompletedWithErrors", "Cancelled", "Failed_IssueReportedAtCustomer", + "Failed_IssueDetectedAtAzureDC", "Aborted", "CompletedWithWarnings", + "ReadyToDispatchFromAzureDC", "ReadyToReceiveAtAzureDC", "Created", "ShippedToAzureDC", + "AwaitingShipmentDetails", "PreparingToShipFromAzureDC", "ShippedToCustomer". + :vartype stage_name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.StageName + :ivar display_name: Display name of the job stage. + :vartype display_name: str + :ivar stage_status: Status of the job stage. Possible values include: "None", "InProgress", + "Succeeded", "Failed", "Cancelled", "Cancelling", "SucceededWithErrors", + "WaitingForCustomerAction", "SucceededWithWarnings", "WaitingForCustomerActionForKek", + "WaitingForCustomerActionForCleanUp", "CustomerActionPerformedForCleanUp". + :vartype stage_status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.StageStatus + :ivar stage_time: Time for the job stage in UTC ISO 8601 format. + :vartype stage_time: ~datetime.datetime + :ivar job_stage_details: Job Stage Details. + :vartype job_stage_details: any + """ + + _validation = { + 'stage_name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'stage_status': {'readonly': True}, + 'stage_time': {'readonly': True}, + 'job_stage_details': {'readonly': True}, + } + + _attribute_map = { + 'stage_name': {'key': 'stageName', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'stage_status': {'key': 'stageStatus', 'type': 'str'}, + 'stage_time': {'key': 'stageTime', 'type': 'iso-8601'}, + 'job_stage_details': {'key': 'jobStageDetails', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(JobStages, self).__init__(**kwargs) + self.stage_name = None + self.display_name = None + self.stage_status = None + self.stage_time = None + self.job_stage_details = None + + +class KeyEncryptionKey(msrest.serialization.Model): + """Encryption key containing details about key to encrypt different keys. + + All required parameters must be populated in order to send to Azure. + + :ivar kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :vartype kek_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.KekType + :ivar identity_properties: Managed identity properties used for key encryption. + :vartype identity_properties: ~azure.mgmt.databox.v2021_08_01_preview.models.IdentityProperties + :ivar kek_url: Key encryption key. It is required in case of Customer managed KekType. + :vartype kek_url: str + :ivar kek_vault_resource_id: Kek vault resource id. It is required in case of Customer managed + KekType. + :vartype kek_vault_resource_id: str + """ + + _validation = { + 'kek_type': {'required': True}, + } + + _attribute_map = { + 'kek_type': {'key': 'kekType', 'type': 'str'}, + 'identity_properties': {'key': 'identityProperties', 'type': 'IdentityProperties'}, + 'kek_url': {'key': 'kekUrl', 'type': 'str'}, + 'kek_vault_resource_id': {'key': 'kekVaultResourceID', 'type': 'str'}, + } + + def __init__( + self, + *, + kek_type: Union[str, "KekType"] = "MicrosoftManaged", + identity_properties: Optional["IdentityProperties"] = None, + kek_url: Optional[str] = None, + kek_vault_resource_id: Optional[str] = None, + **kwargs + ): + """ + :keyword kek_type: Required. Type of encryption key used for key encryption. Possible values + include: "MicrosoftManaged", "CustomerManaged". Default value: "MicrosoftManaged". + :paramtype kek_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.KekType + :keyword identity_properties: Managed identity properties used for key encryption. + :paramtype identity_properties: + ~azure.mgmt.databox.v2021_08_01_preview.models.IdentityProperties + :keyword kek_url: Key encryption key. It is required in case of Customer managed KekType. + :paramtype kek_url: str + :keyword kek_vault_resource_id: Kek vault resource id. It is required in case of Customer + managed KekType. + :paramtype kek_vault_resource_id: str + """ + super(KeyEncryptionKey, self).__init__(**kwargs) + self.kek_type = kek_type + self.identity_properties = identity_properties + self.kek_url = kek_url + self.kek_vault_resource_id = kek_vault_resource_id + + +class LastMitigationActionOnJob(msrest.serialization.Model): + """Last Mitigation Action Performed On Job. + + :ivar action_date_time_in_utc: Action performed date time. + :vartype action_date_time_in_utc: ~datetime.datetime + :ivar is_performed_by_customer: Action performed by customer, + possibility is that mitigation might happen by customer or service or by ops. + :vartype is_performed_by_customer: bool + :ivar customer_resolution: Resolution code provided by customer. Possible values include: + "None", "MoveToCleanUpDevice", "Resume". + :vartype customer_resolution: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode + """ + + _attribute_map = { + 'action_date_time_in_utc': {'key': 'actionDateTimeInUtc', 'type': 'iso-8601'}, + 'is_performed_by_customer': {'key': 'isPerformedByCustomer', 'type': 'bool'}, + 'customer_resolution': {'key': 'customerResolution', 'type': 'str'}, + } + + def __init__( + self, + *, + action_date_time_in_utc: Optional[datetime.datetime] = None, + is_performed_by_customer: Optional[bool] = None, + customer_resolution: Optional[Union[str, "CustomerResolutionCode"]] = None, + **kwargs + ): + """ + :keyword action_date_time_in_utc: Action performed date time. + :paramtype action_date_time_in_utc: ~datetime.datetime + :keyword is_performed_by_customer: Action performed by customer, + possibility is that mitigation might happen by customer or service or by ops. + :paramtype is_performed_by_customer: bool + :keyword customer_resolution: Resolution code provided by customer. Possible values include: + "None", "MoveToCleanUpDevice", "Resume". + :paramtype customer_resolution: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode + """ + super(LastMitigationActionOnJob, self).__init__(**kwargs) + self.action_date_time_in_utc = action_date_time_in_utc + self.is_performed_by_customer = is_performed_by_customer + self.customer_resolution = customer_resolution + + +class ManagedDiskDetails(DataAccountDetails): + """Details of the managed disks. + + All required parameters must be populated in order to send to Azure. + + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :vartype share_password: str + :ivar resource_group_id: Required. Resource Group Id of the compute disks. + :vartype resource_group_id: str + :ivar staging_storage_account_id: Required. Resource Id of the storage account that can be used + to copy the vhd for staging. + :vartype staging_storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'resource_group_id': {'required': True}, + 'staging_storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, + 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_group_id: str, + staging_storage_account_id: str, + share_password: Optional[str] = None, + **kwargs + ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword resource_group_id: Required. Resource Group Id of the compute disks. + :paramtype resource_group_id: str + :keyword staging_storage_account_id: Required. Resource Id of the storage account that can be + used to copy the vhd for staging. + :paramtype staging_storage_account_id: str + """ + super(ManagedDiskDetails, self).__init__(share_password=share_password, **kwargs) + self.data_account_type = 'ManagedDisk' # type: str + self.resource_group_id = resource_group_id + self.staging_storage_account_id = staging_storage_account_id + + +class MarkDevicesShippedRequest(msrest.serialization.Model): + """The request body to provide the delivery package details of job. + + All required parameters must be populated in order to send to Azure. + + :ivar deliver_to_dc_package_details: Required. Delivery package details. + :vartype deliver_to_dc_package_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierInfo + """ + + _validation = { + 'deliver_to_dc_package_details': {'required': True}, + } + + _attribute_map = { + 'deliver_to_dc_package_details': {'key': 'deliverToDcPackageDetails', 'type': 'PackageCarrierInfo'}, + } + + def __init__( + self, + *, + deliver_to_dc_package_details: "PackageCarrierInfo", + **kwargs + ): + """ + :keyword deliver_to_dc_package_details: Required. Delivery package details. + :paramtype deliver_to_dc_package_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierInfo + """ + super(MarkDevicesShippedRequest, self).__init__(**kwargs) + self.deliver_to_dc_package_details = deliver_to_dc_package_details + + +class MitigateJobRequest(msrest.serialization.Model): + """The Mitigate Job captured from request body for Mitigate API. + + All required parameters must be populated in order to send to Azure. + + :ivar customer_resolution_code: Required. Resolution code for the job. Possible values include: + "None", "MoveToCleanUpDevice", "Resume". + :vartype customer_resolution_code: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode + """ + + _validation = { + 'customer_resolution_code': {'required': True}, + } + + _attribute_map = { + 'customer_resolution_code': {'key': 'customerResolutionCode', 'type': 'str'}, + } + + def __init__( + self, + *, + customer_resolution_code: Union[str, "CustomerResolutionCode"], + **kwargs + ): + """ + :keyword customer_resolution_code: Required. Resolution code for the job. Possible values + include: "None", "MoveToCleanUpDevice", "Resume". + :paramtype customer_resolution_code: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.CustomerResolutionCode + """ + super(MitigateJobRequest, self).__init__(**kwargs) + self.customer_resolution_code = customer_resolution_code + + +class NotificationPreference(msrest.serialization.Model): + """Notification preference for a job stage. + + All required parameters must be populated in order to send to Azure. + + :ivar stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Created", "ShippedToCustomer". + :vartype stage_name: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.NotificationStageName + :ivar send_notification: Required. Notification is required or not. + :vartype send_notification: bool + """ + + _validation = { + 'stage_name': {'required': True}, + 'send_notification': {'required': True}, + } + + _attribute_map = { + 'stage_name': {'key': 'stageName', 'type': 'str'}, + 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, + } + + def __init__( + self, + *, + stage_name: Union[str, "NotificationStageName"], + send_notification: bool = True, + **kwargs + ): + """ + :keyword stage_name: Required. Name of the stage. Possible values include: "DevicePrepared", + "Dispatched", "Delivered", "PickedUp", "AtAzureDC", "DataCopy", "Created", "ShippedToCustomer". + :paramtype stage_name: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.NotificationStageName + :keyword send_notification: Required. Notification is required or not. + :paramtype send_notification: bool + """ + super(NotificationPreference, self).__init__(**kwargs) + self.stage_name = stage_name + self.send_notification = send_notification + + +class Operation(msrest.serialization.Model): + """Operation entity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the operation. Format: + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. + :vartype name: str + :ivar display: Operation display values. + :vartype display: ~azure.mgmt.databox.v2021_08_01_preview.models.OperationDisplay + :ivar properties: Operation properties. + :vartype properties: any + :ivar origin: Origin of the operation. Can be : user|system|user,system. + :vartype origin: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + 'properties': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'properties': {'key': 'properties', 'type': 'object'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__( + self, + *, + is_data_action: Optional[bool] = None, + **kwargs + ): + """ + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + """ + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + self.properties = None + self.origin = None + self.is_data_action = is_data_action + + +class OperationDisplay(msrest.serialization.Model): + """Operation display. + + :ivar provider: Provider name. + :vartype provider: str + :ivar resource: Resource name. + :vartype resource: str + :ivar operation: Localized name of the operation for display purpose. + :vartype operation: str + :ivar description: Localized description of the operation for display purpose. + :vartype description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + """ + :keyword provider: Provider name. + :paramtype provider: str + :keyword resource: Resource name. + :paramtype resource: str + :keyword operation: Localized name of the operation for display purpose. + :paramtype operation: str + :keyword description: Localized description of the operation for display purpose. + :paramtype description: str + """ + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationList(msrest.serialization.Model): + """Operation Collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations. + :vartype value: list[~azure.mgmt.databox.v2021_08_01_preview.models.Operation] + :ivar next_link: Link for the next set of operations. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword next_link: Link for the next set of operations. + :paramtype next_link: str + """ + super(OperationList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class PackageCarrierDetails(msrest.serialization.Model): + """Package carrier details. + + :ivar carrier_account_number: Carrier Account Number of customer for customer disk. + :vartype carrier_account_number: str + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar tracking_id: Tracking Id of shipment. + :vartype tracking_id: str + """ + + _attribute_map = { + 'carrier_account_number': {'key': 'carrierAccountNumber', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + } + + def __init__( + self, + *, + carrier_account_number: Optional[str] = None, + carrier_name: Optional[str] = None, + tracking_id: Optional[str] = None, + **kwargs + ): + """ + :keyword carrier_account_number: Carrier Account Number of customer for customer disk. + :paramtype carrier_account_number: str + :keyword carrier_name: Name of the carrier. + :paramtype carrier_name: str + :keyword tracking_id: Tracking Id of shipment. + :paramtype tracking_id: str + """ + super(PackageCarrierDetails, self).__init__(**kwargs) + self.carrier_account_number = carrier_account_number + self.carrier_name = carrier_name + self.tracking_id = tracking_id + + +class PackageCarrierInfo(msrest.serialization.Model): + """package carrier info. + + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar tracking_id: Tracking Id of shipment. + :vartype tracking_id: str + """ + + _attribute_map = { + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + } + + def __init__( + self, + *, + carrier_name: Optional[str] = None, + tracking_id: Optional[str] = None, + **kwargs + ): + """ + :keyword carrier_name: Name of the carrier. + :paramtype carrier_name: str + :keyword tracking_id: Tracking Id of shipment. + :paramtype tracking_id: str + """ + super(PackageCarrierInfo, self).__init__(**kwargs) + self.carrier_name = carrier_name + self.tracking_id = tracking_id + + +class PackageShippingDetails(msrest.serialization.Model): + """package shipping details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tracking_url: Url where shipment can be tracked. + :vartype tracking_url: str + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar tracking_id: Tracking Id of shipment. + :vartype tracking_id: str + """ + + _validation = { + 'tracking_url': {'readonly': True}, + 'carrier_name': {'readonly': True}, + 'tracking_id': {'readonly': True}, + } + + _attribute_map = { + 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(PackageShippingDetails, self).__init__(**kwargs) + self.tracking_url = None + self.carrier_name = None + self.tracking_id = None + + +class Preferences(msrest.serialization.Model): + """Preferences related to the order. + + :ivar preferred_data_center_region: Preferred data center region. + :vartype preferred_data_center_region: list[str] + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportPreferences + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: + ~azure.mgmt.databox.v2021_08_01_preview.models.EncryptionPreferences + """ + + _attribute_map = { + 'preferred_data_center_region': {'key': 'preferredDataCenterRegion', 'type': '[str]'}, + 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, + 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, + } + + def __init__( + self, + *, + preferred_data_center_region: Optional[List[str]] = None, + transport_preferences: Optional["TransportPreferences"] = None, + encryption_preferences: Optional["EncryptionPreferences"] = None, + **kwargs + ): + """ + :keyword preferred_data_center_region: Preferred data center region. + :paramtype preferred_data_center_region: list[str] + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportPreferences + :keyword encryption_preferences: Preferences related to the Encryption. + :paramtype encryption_preferences: + ~azure.mgmt.databox.v2021_08_01_preview.models.EncryptionPreferences + """ + super(Preferences, self).__init__(**kwargs) + self.preferred_data_center_region = preferred_data_center_region + self.transport_preferences = transport_preferences + self.encryption_preferences = encryption_preferences + + +class PreferencesValidationRequest(ValidationInputRequest): + """Request to validate preference of transport and data center. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar preference: Preference of transport and data center. + :vartype preference: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :ivar device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + """ + + _validation = { + 'validation_type': {'required': True}, + 'device_type': {'required': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'preference': {'key': 'preference', 'type': 'Preferences'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + } + + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + preference: Optional["Preferences"] = None, + **kwargs + ): + """ + :keyword preference: Preference of transport and data center. + :paramtype preference: ~azure.mgmt.databox.v2021_08_01_preview.models.Preferences + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + """ + super(PreferencesValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str + self.preference = preference + self.device_type = device_type + + +class PreferencesValidationResponseProperties(ValidationInputResponse): + """Properties of data center and transport preference validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar status: Validation status of requested data center and transport. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationStatus + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(PreferencesValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidatePreferences' # type: str + self.status = None + + +class RegionConfigurationRequest(msrest.serialization.Model): + """Request body to get the configuration for the region. + + :ivar schedule_availability_request: Request body to get the availability for scheduling + orders. + :vartype schedule_availability_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.ScheduleAvailabilityRequest + :ivar transport_availability_request: Request body to get the transport availability for given + sku. + :vartype transport_availability_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportAvailabilityRequest + :ivar datacenter_address_request: Request body to get the datacenter address for given sku. + :vartype datacenter_address_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressRequest + """ + + _attribute_map = { + 'schedule_availability_request': {'key': 'scheduleAvailabilityRequest', 'type': 'ScheduleAvailabilityRequest'}, + 'transport_availability_request': {'key': 'transportAvailabilityRequest', 'type': 'TransportAvailabilityRequest'}, + 'datacenter_address_request': {'key': 'datacenterAddressRequest', 'type': 'DatacenterAddressRequest'}, + } + + def __init__( + self, + *, + schedule_availability_request: Optional["ScheduleAvailabilityRequest"] = None, + transport_availability_request: Optional["TransportAvailabilityRequest"] = None, + datacenter_address_request: Optional["DatacenterAddressRequest"] = None, + **kwargs + ): + """ + :keyword schedule_availability_request: Request body to get the availability for scheduling + orders. + :paramtype schedule_availability_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.ScheduleAvailabilityRequest + :keyword transport_availability_request: Request body to get the transport availability for + given sku. + :paramtype transport_availability_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportAvailabilityRequest + :keyword datacenter_address_request: Request body to get the datacenter address for given sku. + :paramtype datacenter_address_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressRequest + """ + super(RegionConfigurationRequest, self).__init__(**kwargs) + self.schedule_availability_request = schedule_availability_request + self.transport_availability_request = transport_availability_request + self.datacenter_address_request = datacenter_address_request + + +class RegionConfigurationResponse(msrest.serialization.Model): + """Configuration response specific to a region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar schedule_availability_response: Schedule availability for given sku in a region. + :vartype schedule_availability_response: + ~azure.mgmt.databox.v2021_08_01_preview.models.ScheduleAvailabilityResponse + :ivar transport_availability_response: Transport options available for given sku in a region. + :vartype transport_availability_response: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportAvailabilityResponse + :ivar datacenter_address_response: Datacenter address for given sku in a region. + :vartype datacenter_address_response: + ~azure.mgmt.databox.v2021_08_01_preview.models.DatacenterAddressResponse + """ + + _validation = { + 'schedule_availability_response': {'readonly': True}, + 'transport_availability_response': {'readonly': True}, + 'datacenter_address_response': {'readonly': True}, + } + + _attribute_map = { + 'schedule_availability_response': {'key': 'scheduleAvailabilityResponse', 'type': 'ScheduleAvailabilityResponse'}, + 'transport_availability_response': {'key': 'transportAvailabilityResponse', 'type': 'TransportAvailabilityResponse'}, + 'datacenter_address_response': {'key': 'datacenterAddressResponse', 'type': 'DatacenterAddressResponse'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(RegionConfigurationResponse, self).__init__(**kwargs) + self.schedule_availability_response = None + self.transport_availability_response = None + self.datacenter_address_response = None + + +class ResourceIdentity(msrest.serialization.Model): + """Msi identity details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Identity type. + :vartype type: str + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :ivar user_assigned_identities: User Assigned Identities. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.databox.v2021_08_01_preview.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + type: Optional[str] = "None", + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): + """ + :keyword type: Identity type. + :paramtype type: str + :keyword user_assigned_identities: User Assigned Identities. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.databox.v2021_08_01_preview.models.UserAssignedIdentity] + """ + super(ResourceIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + self.user_assigned_identities = user_assigned_identities + + +class ScheduleAvailabilityResponse(msrest.serialization.Model): + """Schedule availability for given sku in a region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar available_dates: List of dates available to schedule. + :vartype available_dates: list[~datetime.datetime] + """ + + _validation = { + 'available_dates': {'readonly': True}, + } + + _attribute_map = { + 'available_dates': {'key': 'availableDates', 'type': '[iso-8601]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ScheduleAvailabilityResponse, self).__init__(**kwargs) + self.available_dates = None + + +class ShareCredentialDetails(msrest.serialization.Model): + """Credential details of the shares in account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar share_name: Name of the share. + :vartype share_name: str + :ivar share_type: Type of the share. Possible values include: "UnknownType", "HCS", + "BlockBlob", "PageBlob", "AzureFile", "ManagedDisk". + :vartype share_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ShareDestinationFormatType + :ivar user_name: User name for the share. + :vartype user_name: str + :ivar password: Password for the share. + :vartype password: str + :ivar supported_access_protocols: Access protocols supported on the device. + :vartype supported_access_protocols: list[str or + ~azure.mgmt.databox.v2021_08_01_preview.models.AccessProtocol] + """ + + _validation = { + 'share_name': {'readonly': True}, + 'share_type': {'readonly': True}, + 'user_name': {'readonly': True}, + 'password': {'readonly': True}, + 'supported_access_protocols': {'readonly': True}, + } + + _attribute_map = { + 'share_name': {'key': 'shareName', 'type': 'str'}, + 'share_type': {'key': 'shareType', 'type': 'str'}, + 'user_name': {'key': 'userName', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'supported_access_protocols': {'key': 'supportedAccessProtocols', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ShareCredentialDetails, self).__init__(**kwargs) + self.share_name = None + self.share_type = None + self.user_name = None + self.password = None + self.supported_access_protocols = None + + +class ShipmentPickUpRequest(msrest.serialization.Model): + """Shipment pick up request details. + + All required parameters must be populated in order to send to Azure. + + :ivar start_time: Required. Minimum date after which the pick up should commence, this must be + in local time of pick up area. + :vartype start_time: ~datetime.datetime + :ivar end_time: Required. Maximum date before which the pick up should commence, this must be + in local time of pick up area. + :vartype end_time: ~datetime.datetime + :ivar shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :vartype shipment_location: str + """ + + _validation = { + 'start_time': {'required': True}, + 'end_time': {'required': True}, + 'shipment_location': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'shipment_location': {'key': 'shipmentLocation', 'type': 'str'}, + } + + def __init__( + self, + *, + start_time: datetime.datetime, + end_time: datetime.datetime, + shipment_location: str, + **kwargs + ): + """ + :keyword start_time: Required. Minimum date after which the pick up should commence, this must + be in local time of pick up area. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Required. Maximum date before which the pick up should commence, this must + be in local time of pick up area. + :paramtype end_time: ~datetime.datetime + :keyword shipment_location: Required. Shipment Location in the pickup place. Eg.front desk. + :paramtype shipment_location: str + """ + super(ShipmentPickUpRequest, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.shipment_location = shipment_location + + +class ShipmentPickUpResponse(msrest.serialization.Model): + """Shipment pick up response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar confirmation_number: Confirmation number for the pick up request. + :vartype confirmation_number: str + :ivar ready_by_time: Time by which shipment should be ready for pick up, this is in local time + of pick up area. + :vartype ready_by_time: ~datetime.datetime + """ + + _validation = { + 'confirmation_number': {'readonly': True}, + 'ready_by_time': {'readonly': True}, + } + + _attribute_map = { + 'confirmation_number': {'key': 'confirmationNumber', 'type': 'str'}, + 'ready_by_time': {'key': 'readyByTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ShipmentPickUpResponse, self).__init__(**kwargs) + self.confirmation_number = None + self.ready_by_time = None + + +class ShippingAddress(msrest.serialization.Model): + """Shipping address where customer wishes to receive the device. + + All required parameters must be populated in order to send to Azure. + + :ivar street_address1: Required. Street Address line 1. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: Required. Name of the Country. + :vartype country: str + :ivar postal_code: Postal code. + :vartype postal_code: str + :ivar zip_extended_code: Extended Zip Code. + :vartype zip_extended_code: str + :ivar company_name: Name of the company. + :vartype company_name: str + :ivar address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :vartype address_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.AddressType + """ + + _validation = { + 'street_address1': {'required': True}, + 'country': {'required': True}, + } + + _attribute_map = { + 'street_address1': {'key': 'streetAddress1', 'type': 'str'}, + 'street_address2': {'key': 'streetAddress2', 'type': 'str'}, + 'street_address3': {'key': 'streetAddress3', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state_or_province': {'key': 'stateOrProvince', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'zip_extended_code': {'key': 'zipExtendedCode', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'address_type': {'key': 'addressType', 'type': 'str'}, + } + + def __init__( + self, + *, + street_address1: str, + country: str, + street_address2: Optional[str] = None, + street_address3: Optional[str] = None, + city: Optional[str] = None, + state_or_province: Optional[str] = None, + postal_code: Optional[str] = None, + zip_extended_code: Optional[str] = None, + company_name: Optional[str] = None, + address_type: Optional[Union[str, "AddressType"]] = "None", + **kwargs + ): + """ + :keyword street_address1: Required. Street Address line 1. + :paramtype street_address1: str + :keyword street_address2: Street Address line 2. + :paramtype street_address2: str + :keyword street_address3: Street Address line 3. + :paramtype street_address3: str + :keyword city: Name of the City. + :paramtype city: str + :keyword state_or_province: Name of the State or Province. + :paramtype state_or_province: str + :keyword country: Required. Name of the Country. + :paramtype country: str + :keyword postal_code: Postal code. + :paramtype postal_code: str + :keyword zip_extended_code: Extended Zip Code. + :paramtype zip_extended_code: str + :keyword company_name: Name of the company. + :paramtype company_name: str + :keyword address_type: Type of address. Possible values include: "None", "Residential", + "Commercial". Default value: "None". + :paramtype address_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.AddressType + """ + super(ShippingAddress, self).__init__(**kwargs) + self.street_address1 = street_address1 + self.street_address2 = street_address2 + self.street_address3 = street_address3 + self.city = city + self.state_or_province = state_or_province + self.country = country + self.postal_code = postal_code + self.zip_extended_code = zip_extended_code + self.company_name = company_name + self.address_type = address_type + + +class Sku(msrest.serialization.Model): + """The Sku. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :ivar display_name: The display name of the sku. + :vartype display_name: str + :ivar family: The sku family. + :vartype family: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Union[str, "SkuName"], + display_name: Optional[str] = None, + family: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Required. The sku name. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk". + :paramtype name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :keyword display_name: The display name of the sku. + :paramtype display_name: str + :keyword family: The sku family. + :paramtype family: str + """ + super(Sku, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.family = family + + +class SkuAvailabilityValidationRequest(ValidationInputRequest): + """Request to validate sku availability. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :ivar transfer_type: Required. Type of the transfer. Possible values include: "ImportToAzure", + "ExportFromAzure". + :vartype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + :ivar country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :vartype country: str + :ivar location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :vartype location: str + """ + + _validation = { + 'validation_type': {'required': True}, + 'device_type': {'required': True}, + 'transfer_type': {'required': True}, + 'country': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'transfer_type': {'key': 'transferType', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + device_type: Union[str, "SkuName"], + transfer_type: Union[str, "TransferType"], + country: str, + location: str, + **kwargs + ): + """ + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :keyword transfer_type: Required. Type of the transfer. Possible values include: + "ImportToAzure", "ExportFromAzure". + :paramtype transfer_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.TransferType + :keyword country: Required. ISO country code. Country for hardware shipment. For codes check: + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + :paramtype country: str + :keyword location: Required. Location for data transfer. For locations check: + https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + :paramtype location: str + """ + super(SkuAvailabilityValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateSkuAvailability' # type: str + self.device_type = device_type + self.transfer_type = transfer_type + self.country = country + self.location = location + + +class SkuAvailabilityValidationResponseProperties(ValidationInputResponse): + """Properties of sku availability validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar status: Sku availability validation status. Possible values include: "Valid", "Invalid", + "Skipped". + :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationStatus + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SkuAvailabilityValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSkuAvailability' # type: str + self.status = None + + +class SkuCapacity(msrest.serialization.Model): + """Capacity of the sku. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar usable: Usable capacity in TB. + :vartype usable: str + :ivar maximum: Maximum capacity in TB. + :vartype maximum: str + """ + + _validation = { + 'usable': {'readonly': True}, + 'maximum': {'readonly': True}, + } + + _attribute_map = { + 'usable': {'key': 'usable', 'type': 'str'}, + 'maximum': {'key': 'maximum', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SkuCapacity, self).__init__(**kwargs) + self.usable = None + self.maximum = None + + +class SkuCost(msrest.serialization.Model): + """Describes metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_id: Meter id of the Sku. + :vartype meter_id: str + :ivar meter_type: The type of the meter. + :vartype meter_type: str + :ivar multiplier: Multiplier specifies the region specific value to be multiplied with 1$ guid. + Eg: Our new regions will be using 1$ shipping guid with appropriate multiplier specific to + region. + :vartype multiplier: float + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'meter_type': {'readonly': True}, + 'multiplier': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'meter_type': {'key': 'meterType', 'type': 'str'}, + 'multiplier': {'key': 'multiplier', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.meter_type = None + self.multiplier = None + + +class SkuInformation(msrest.serialization.Model): + """Information of the sku. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar sku: The Sku. + :vartype sku: ~azure.mgmt.databox.v2021_08_01_preview.models.Sku + :ivar enabled: The sku is enabled or not. + :vartype enabled: bool + :ivar data_location_to_service_location_map: The map of data location to service location. + :vartype data_location_to_service_location_map: + list[~azure.mgmt.databox.v2021_08_01_preview.models.DataLocationToServiceLocationMap] + :ivar capacity: Capacity of the Sku. + :vartype capacity: ~azure.mgmt.databox.v2021_08_01_preview.models.SkuCapacity + :ivar costs: Cost of the Sku. + :vartype costs: list[~azure.mgmt.databox.v2021_08_01_preview.models.SkuCost] + :ivar api_versions: Api versions that support this Sku. + :vartype api_versions: list[str] + :ivar disabled_reason: Reason why the Sku is disabled. Possible values include: "None", + "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo". + :vartype disabled_reason: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.SkuDisabledReason + :ivar disabled_reason_message: Message for why the Sku is disabled. + :vartype disabled_reason_message: str + :ivar required_feature: Required feature to access the sku. + :vartype required_feature: str + """ + + _validation = { + 'sku': {'readonly': True}, + 'enabled': {'readonly': True}, + 'data_location_to_service_location_map': {'readonly': True}, + 'capacity': {'readonly': True}, + 'costs': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'disabled_reason': {'readonly': True}, + 'disabled_reason_message': {'readonly': True}, + 'required_feature': {'readonly': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'data_location_to_service_location_map': {'key': 'properties.dataLocationToServiceLocationMap', 'type': '[DataLocationToServiceLocationMap]'}, + 'capacity': {'key': 'properties.capacity', 'type': 'SkuCapacity'}, + 'costs': {'key': 'properties.costs', 'type': '[SkuCost]'}, + 'api_versions': {'key': 'properties.apiVersions', 'type': '[str]'}, + 'disabled_reason': {'key': 'properties.disabledReason', 'type': 'str'}, + 'disabled_reason_message': {'key': 'properties.disabledReasonMessage', 'type': 'str'}, + 'required_feature': {'key': 'properties.requiredFeature', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SkuInformation, self).__init__(**kwargs) + self.sku = None + self.enabled = None + self.data_location_to_service_location_map = None + self.capacity = None + self.costs = None + self.api_versions = None + self.disabled_reason = None + self.disabled_reason_message = None + self.required_feature = None + + +class StorageAccountDetails(DataAccountDetails): + """Details for the storage account. + + All required parameters must be populated in order to send to Azure. + + :ivar data_account_type: Required. Account Type of the data to be transferred.Constant filled + by server. Possible values include: "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :ivar share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :vartype share_password: str + :ivar storage_account_id: Required. Storage Account Resource Id. + :vartype storage_account_id: str + """ + + _validation = { + 'data_account_type': {'required': True}, + 'storage_account_id': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'share_password': {'key': 'sharePassword', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_id: str, + share_password: Optional[str] = None, + **kwargs + ): + """ + :keyword share_password: Password for all the shares to be created on the device. Should not be + passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate + password itself. This will not be returned in Get Call. Password Requirements : Password must + be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase + alphabet, one number and one special character. Password cannot have the following characters : + IilLoO0 Password can have only alphabets, numbers and these characters : @#-$%^!+=;:_()]+. + :paramtype share_password: str + :keyword storage_account_id: Required. Storage Account Resource Id. + :paramtype storage_account_id: str + """ + super(StorageAccountDetails, self).__init__(share_password=share_password, **kwargs) + self.data_account_type = 'StorageAccount' # type: str + self.storage_account_id = storage_account_id + + +class SubscriptionIsAllowedToCreateJobValidationRequest(ValidationInputRequest): + """Request to validate subscription permission to create jobs. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + """ + + _validation = { + 'validation_type': {'required': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SubscriptionIsAllowedToCreateJobValidationRequest, self).__init__(**kwargs) + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str + + +class SubscriptionIsAllowedToCreateJobValidationResponseProperties(ValidationInputResponse): + """Properties of subscription permission to create job validation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation response.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar error: Error code and message of validation response. + :vartype error: ~azure.mgmt.databox.v2021_08_01_preview.models.CloudError + :ivar status: Validation status of subscription permission to create job. Possible values + include: "Valid", "Invalid", "Skipped". + :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationStatus + """ + + _validation = { + 'validation_type': {'required': True}, + 'error': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CloudError'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SubscriptionIsAllowedToCreateJobValidationResponseProperties, self).__init__(**kwargs) + self.validation_type = 'ValidateSubscriptionIsAllowedToCreateJob' # type: str + self.status = None + + +class SystemData(msrest.serialization.Model): + """Provides details about resource creation and update time. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_by: A string identifier for the identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource: user, application, + managedIdentity. + :vartype created_by_type: str + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: A string identifier for the identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource: user, + application, managedIdentity. + :vartype last_modified_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None + + +class TransferAllDetails(msrest.serialization.Model): + """Details to transfer all data. + + All required parameters must be populated in order to send to Azure. + + :ivar data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :ivar transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :vartype transfer_all_blobs: bool + :ivar transfer_all_files: To indicate if all Azure Files have to be transferred. + :vartype transfer_all_files: bool + """ + + _validation = { + 'data_account_type': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'transfer_all_blobs': {'key': 'transferAllBlobs', 'type': 'bool'}, + 'transfer_all_files': {'key': 'transferAllFiles', 'type': 'bool'}, + } + + def __init__( + self, + *, + data_account_type: Union[str, "DataAccountType"], + transfer_all_blobs: Optional[bool] = None, + transfer_all_files: Optional[bool] = None, + **kwargs + ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :keyword transfer_all_blobs: To indicate if all Azure blobs have to be transferred. + :paramtype transfer_all_blobs: bool + :keyword transfer_all_files: To indicate if all Azure Files have to be transferred. + :paramtype transfer_all_files: bool + """ + super(TransferAllDetails, self).__init__(**kwargs) + self.data_account_type = data_account_type + self.transfer_all_blobs = transfer_all_blobs + self.transfer_all_files = transfer_all_files + + +class TransferConfiguration(msrest.serialization.Model): + """Configuration for defining the transfer of data. + + All required parameters must be populated in order to send to Azure. + + :ivar transfer_configuration_type: Required. Type of the configuration for transfer. Possible + values include: "TransferAll", "TransferUsingFilter". + :vartype transfer_configuration_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.TransferConfigurationType + :ivar transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :vartype transfer_filter_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransferConfigurationTransferFilterDetails + :ivar transfer_all_details: Map of filter type and the details to transfer all data. This field + is required only if the TransferConfigurationType is given as TransferAll. + :vartype transfer_all_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransferConfigurationTransferAllDetails + """ + + _validation = { + 'transfer_configuration_type': {'required': True}, + } + + _attribute_map = { + 'transfer_configuration_type': {'key': 'transferConfigurationType', 'type': 'str'}, + 'transfer_filter_details': {'key': 'transferFilterDetails', 'type': 'TransferConfigurationTransferFilterDetails'}, + 'transfer_all_details': {'key': 'transferAllDetails', 'type': 'TransferConfigurationTransferAllDetails'}, + } + + def __init__( + self, + *, + transfer_configuration_type: Union[str, "TransferConfigurationType"], + transfer_filter_details: Optional["TransferConfigurationTransferFilterDetails"] = None, + transfer_all_details: Optional["TransferConfigurationTransferAllDetails"] = None, + **kwargs + ): + """ + :keyword transfer_configuration_type: Required. Type of the configuration for transfer. + Possible values include: "TransferAll", "TransferUsingFilter". + :paramtype transfer_configuration_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.TransferConfigurationType + :keyword transfer_filter_details: Map of filter type and the details to filter. This field is + required only if the TransferConfigurationType is given as TransferUsingFilter. + :paramtype transfer_filter_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransferConfigurationTransferFilterDetails + :keyword transfer_all_details: Map of filter type and the details to transfer all data. This + field is required only if the TransferConfigurationType is given as TransferAll. + :paramtype transfer_all_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransferConfigurationTransferAllDetails + """ + super(TransferConfiguration, self).__init__(**kwargs) + self.transfer_configuration_type = transfer_configuration_type + self.transfer_filter_details = transfer_filter_details + self.transfer_all_details = transfer_all_details + + +class TransferConfigurationTransferAllDetails(msrest.serialization.Model): + """Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll. + + :ivar include: Details to transfer all data. + :vartype include: ~azure.mgmt.databox.v2021_08_01_preview.models.TransferAllDetails + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': 'TransferAllDetails'}, + } + + def __init__( + self, + *, + include: Optional["TransferAllDetails"] = None, + **kwargs + ): + """ + :keyword include: Details to transfer all data. + :paramtype include: ~azure.mgmt.databox.v2021_08_01_preview.models.TransferAllDetails + """ + super(TransferConfigurationTransferAllDetails, self).__init__(**kwargs) + self.include = include + + +class TransferConfigurationTransferFilterDetails(msrest.serialization.Model): + """Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter. + + :ivar include: Details of the filtering the transfer of data. + :vartype include: ~azure.mgmt.databox.v2021_08_01_preview.models.TransferFilterDetails + """ + + _attribute_map = { + 'include': {'key': 'include', 'type': 'TransferFilterDetails'}, + } + + def __init__( + self, + *, + include: Optional["TransferFilterDetails"] = None, + **kwargs + ): + """ + :keyword include: Details of the filtering the transfer of data. + :paramtype include: ~azure.mgmt.databox.v2021_08_01_preview.models.TransferFilterDetails + """ + super(TransferConfigurationTransferFilterDetails, self).__init__(**kwargs) + self.include = include + + +class TransferFilterDetails(msrest.serialization.Model): + """Details of the filtering the transfer of data. + + All required parameters must be populated in order to send to Azure. + + :ivar data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :vartype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :ivar blob_filter_details: Filter details to transfer blobs. + :vartype blob_filter_details: ~azure.mgmt.databox.v2021_08_01_preview.models.BlobFilterDetails + :ivar azure_file_filter_details: Filter details to transfer Azure files. + :vartype azure_file_filter_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.AzureFileFilterDetails + :ivar filter_file_details: Details of the filter files to be used for data transfer. + :vartype filter_file_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.FilterFileDetails] + """ + + _validation = { + 'data_account_type': {'required': True}, + } + + _attribute_map = { + 'data_account_type': {'key': 'dataAccountType', 'type': 'str'}, + 'blob_filter_details': {'key': 'blobFilterDetails', 'type': 'BlobFilterDetails'}, + 'azure_file_filter_details': {'key': 'azureFileFilterDetails', 'type': 'AzureFileFilterDetails'}, + 'filter_file_details': {'key': 'filterFileDetails', 'type': '[FilterFileDetails]'}, + } + + def __init__( + self, + *, + data_account_type: Union[str, "DataAccountType"], + blob_filter_details: Optional["BlobFilterDetails"] = None, + azure_file_filter_details: Optional["AzureFileFilterDetails"] = None, + filter_file_details: Optional[List["FilterFileDetails"]] = None, + **kwargs + ): + """ + :keyword data_account_type: Required. Type of the account of data. Possible values include: + "StorageAccount", "ManagedDisk". + :paramtype data_account_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.DataAccountType + :keyword blob_filter_details: Filter details to transfer blobs. + :paramtype blob_filter_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.BlobFilterDetails + :keyword azure_file_filter_details: Filter details to transfer Azure files. + :paramtype azure_file_filter_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.AzureFileFilterDetails + :keyword filter_file_details: Details of the filter files to be used for data transfer. + :paramtype filter_file_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.FilterFileDetails] + """ + super(TransferFilterDetails, self).__init__(**kwargs) + self.data_account_type = data_account_type + self.blob_filter_details = blob_filter_details + self.azure_file_filter_details = azure_file_filter_details + self.filter_file_details = filter_file_details + + +class TransportAvailabilityDetails(msrest.serialization.Model): + """Transport options availability details for given region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar shipment_type: Transport Shipment Type supported for given region. Possible values + include: "CustomerManaged", "MicrosoftManaged". + :vartype shipment_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportShipmentTypes + """ + + _validation = { + 'shipment_type': {'readonly': True}, + } + + _attribute_map = { + 'shipment_type': {'key': 'shipmentType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(TransportAvailabilityDetails, self).__init__(**kwargs) + self.shipment_type = None + + +class TransportAvailabilityRequest(msrest.serialization.Model): + """Request body to get the transport availability for given sku. + + :ivar sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype sku_name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + """ + + _attribute_map = { + 'sku_name': {'key': 'skuName', 'type': 'str'}, + } + + def __init__( + self, + *, + sku_name: Optional[Union[str, "SkuName"]] = None, + **kwargs + ): + """ + :keyword sku_name: Type of the device. Possible values include: "DataBox", "DataBoxDisk", + "DataBoxHeavy", "DataBoxCustomerDisk". + :paramtype sku_name: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + """ + super(TransportAvailabilityRequest, self).__init__(**kwargs) + self.sku_name = sku_name + + +class TransportAvailabilityResponse(msrest.serialization.Model): + """Transport options available for given sku in a region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar transport_availability_details: List of transport availability details for given region. + :vartype transport_availability_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.TransportAvailabilityDetails] + """ + + _validation = { + 'transport_availability_details': {'readonly': True}, + } + + _attribute_map = { + 'transport_availability_details': {'key': 'transportAvailabilityDetails', 'type': '[TransportAvailabilityDetails]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(TransportAvailabilityResponse, self).__init__(**kwargs) + self.transport_availability_details = None + + +class TransportPreferences(msrest.serialization.Model): + """Preferences related to the shipment logistics of the sku. + + All required parameters must be populated in order to send to Azure. + + :ivar preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :vartype preferred_shipment_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportShipmentTypes + """ + + _validation = { + 'preferred_shipment_type': {'required': True}, + } + + _attribute_map = { + 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, + } + + def __init__( + self, + *, + preferred_shipment_type: Union[str, "TransportShipmentTypes"], + **kwargs + ): + """ + :keyword preferred_shipment_type: Required. Indicates Shipment Logistics type that the customer + preferred. Possible values include: "CustomerManaged", "MicrosoftManaged". + :paramtype preferred_shipment_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportShipmentTypes + """ + super(TransportPreferences, self).__init__(**kwargs) + self.preferred_shipment_type = preferred_shipment_type + + +class UnencryptedCredentials(msrest.serialization.Model): + """Unencrypted credentials for accessing device. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar job_name: Name of the job. + :vartype job_name: str + :ivar job_secrets: Secrets related to this job. + :vartype job_secrets: ~azure.mgmt.databox.v2021_08_01_preview.models.JobSecrets + """ + + _validation = { + 'job_name': {'readonly': True}, + 'job_secrets': {'readonly': True}, + } + + _attribute_map = { + 'job_name': {'key': 'jobName', 'type': 'str'}, + 'job_secrets': {'key': 'jobSecrets', 'type': 'JobSecrets'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(UnencryptedCredentials, self).__init__(**kwargs) + self.job_name = None + self.job_secrets = None + + +class UnencryptedCredentialsList(msrest.serialization.Model): + """List of unencrypted credentials for accessing device. + + :ivar value: List of unencrypted credentials. + :vartype value: list[~azure.mgmt.databox.v2021_08_01_preview.models.UnencryptedCredentials] + :ivar next_link: Link for the next set of unencrypted credentials. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UnencryptedCredentials]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["UnencryptedCredentials"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: List of unencrypted credentials. + :paramtype value: list[~azure.mgmt.databox.v2021_08_01_preview.models.UnencryptedCredentials] + :keyword next_link: Link for the next set of unencrypted credentials. + :paramtype next_link: str + """ + super(UnencryptedCredentialsList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class UpdateJobDetails(msrest.serialization.Model): + """Job details for update. + + :ivar contact_details: Contact details for notification and shipping. + :vartype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :ivar shipping_address: Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :ivar key_encryption_key: Key encryption key for the job. + :vartype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :ivar return_to_customer_package_details: Return package details of job. + :vartype return_to_customer_package_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierDetails + """ + + _attribute_map = { + 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, + 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, + 'return_to_customer_package_details': {'key': 'returnToCustomerPackageDetails', 'type': 'PackageCarrierDetails'}, + } + + def __init__( + self, + *, + contact_details: Optional["ContactDetails"] = None, + shipping_address: Optional["ShippingAddress"] = None, + key_encryption_key: Optional["KeyEncryptionKey"] = None, + return_to_customer_package_details: Optional["PackageCarrierDetails"] = None, + **kwargs + ): + """ + :keyword contact_details: Contact details for notification and shipping. + :paramtype contact_details: ~azure.mgmt.databox.v2021_08_01_preview.models.ContactDetails + :keyword shipping_address: Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :keyword key_encryption_key: Key encryption key for the job. + :paramtype key_encryption_key: ~azure.mgmt.databox.v2021_08_01_preview.models.KeyEncryptionKey + :keyword return_to_customer_package_details: Return package details of job. + :paramtype return_to_customer_package_details: + ~azure.mgmt.databox.v2021_08_01_preview.models.PackageCarrierDetails + """ + super(UpdateJobDetails, self).__init__(**kwargs) + self.contact_details = contact_details + self.shipping_address = shipping_address + self.key_encryption_key = key_encryption_key + self.return_to_customer_package_details = return_to_customer_package_details + + +class UserAssignedIdentity(msrest.serialization.Model): + """Class defining User assigned identity details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class UserAssignedProperties(msrest.serialization.Model): + """User assigned identity properties. + + :ivar resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :vartype resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + **kwargs + ): + """ + :keyword resource_id: Arm resource id for user assigned identity to be used to fetch MSI token. + :paramtype resource_id: str + """ + super(UserAssignedProperties, self).__init__(**kwargs) + self.resource_id = resource_id + + +class ValidateAddress(ValidationInputRequest): + """The requirements to validate customer address where the device needs to be shipped. + + All required parameters must be populated in order to send to Azure. + + :ivar validation_type: Required. Identifies the type of validation request.Constant filled by + server. Possible values include: "ValidateAddress", "ValidateSubscriptionIsAllowedToCreateJob", + "ValidatePreferences", "ValidateCreateOrderLimit", "ValidateSkuAvailability", + "ValidateDataTransferDetails". + :vartype validation_type: str or + ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputDiscriminator + :ivar shipping_address: Required. Shipping address of the customer. + :vartype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :ivar device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :vartype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :ivar transport_preferences: Preferences related to the shipment logistics of the sku. + :vartype transport_preferences: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportPreferences + """ + + _validation = { + 'validation_type': {'required': True}, + 'shipping_address': {'required': True}, + 'device_type': {'required': True}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, + } + + def __init__( + self, + *, + shipping_address: "ShippingAddress", + device_type: Union[str, "SkuName"], + transport_preferences: Optional["TransportPreferences"] = None, + **kwargs + ): + """ + :keyword shipping_address: Required. Shipping address of the customer. + :paramtype shipping_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ShippingAddress + :keyword device_type: Required. Device type to be used for the job. Possible values include: + "DataBox", "DataBoxDisk", "DataBoxHeavy", "DataBoxCustomerDisk". + :paramtype device_type: str or ~azure.mgmt.databox.v2021_08_01_preview.models.SkuName + :keyword transport_preferences: Preferences related to the shipment logistics of the sku. + :paramtype transport_preferences: + ~azure.mgmt.databox.v2021_08_01_preview.models.TransportPreferences + """ + super(ValidateAddress, self).__init__(**kwargs) + self.validation_type = 'ValidateAddress' # type: str + self.shipping_address = shipping_address + self.device_type = device_type + self.transport_preferences = transport_preferences + + +class ValidationResponse(msrest.serialization.Model): + """Response of pre job creation validations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: Overall validation status. Possible values include: "AllValidToProceed", + "InputsRevisitRequired", "CertainInputValidationsSkipped". + :vartype status: str or ~azure.mgmt.databox.v2021_08_01_preview.models.OverallValidationStatus + :ivar individual_response_details: List of response details contain validationType and its + response as key and value respectively. + :vartype individual_response_details: + list[~azure.mgmt.databox.v2021_08_01_preview.models.ValidationInputResponse] + """ + + _validation = { + 'status': {'readonly': True}, + 'individual_response_details': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'properties.status', 'type': 'str'}, + 'individual_response_details': {'key': 'properties.individualResponseDetails', 'type': '[ValidationInputResponse]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ValidationResponse, self).__init__(**kwargs) + self.status = None + self.individual_response_details = None diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/__init__.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/__init__.py new file mode 100644 index 000000000000..bd13cc67afb6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._jobs_operations import JobsOperations +from ._data_box_management_client_operations import DataBoxManagementClientOperationsMixin +from ._service_operations import ServiceOperations + +__all__ = [ + 'Operations', + 'JobsOperations', + 'DataBoxManagementClientOperationsMixin', + 'ServiceOperations', +] diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_data_box_management_client_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_data_box_management_client_operations.py new file mode 100644 index 000000000000..30b1327de2c6 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_data_box_management_client_operations.py @@ -0,0 +1,129 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_mitigate_request( + job_name: str, + subscription_id: str, + resource_group_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate') + path_format_arguments = { + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class DataBoxManagementClientOperationsMixin(object): + + @distributed_trace + def mitigate( + self, + job_name: str, + resource_group_name: str, + mitigate_job_request: "_models.MitigateJobRequest", + **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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mitigate_job_request: Mitigation Request. + :type mitigate_job_request: ~azure.mgmt.databox.v2021_08_01_preview.models.MitigateJobRequest + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(mitigate_job_request, 'MitigateJobRequest') + + request = build_mitigate_request( + job_name=job_name, + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + content_type=content_type, + json=_json, + template_url=self.mitigate.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + 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'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_jobs_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_jobs_operations.py new file mode 100644 index 000000000000..a7d2c62b0784 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_jobs_operations.py @@ -0,0 +1,1260 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_mark_devices_shipped_request( + job_name: str, + subscription_id: str, + resource_group_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped') + path_format_arguments = { + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + *, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_book_shipment_pick_up_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_cancel_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_credentials_request( + subscription_id: str, + resource_group_name: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class JobsOperations(object): + """JobsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: + """Lists all the jobs available under the subscription. + + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace + def mark_devices_shipped( + self, + job_name: str, + resource_group_name: str, + mark_devices_shipped_request: "_models.MarkDevicesShippedRequest", + **kwargs: Any + ) -> None: + """Request to mark devices for a given job as shipped. + + :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. + :type job_name: str + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param mark_devices_shipped_request: Mark Devices Shipped Request. + :type mark_devices_shipped_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.MarkDevicesShippedRequest + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(mark_devices_shipped_request, 'MarkDevicesShippedRequest') + + request = build_mark_devices_shipped_request( + job_name=job_name, + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + content_type=content_type, + json=_json, + template_url=self.mark_devices_shipped.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + mark_devices_shipped.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped'} # type: ignore + + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobResourceList"]: + """Lists all the jobs available under the given resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of jobs, which provides the next page in + the list of jobs. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either JobResourceList or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + skip_token=skip_token, + template_url=next_link, + ) + 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("JobResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + job_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.JobResource": + """Gets information about the specified job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param expand: $expand is supported on details parameter for job, which provides details on the + job stages. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + def _create_initial( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource, 'JobResource') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + job_name: str, + job_resource: "_models.JobResource", + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: + """Creates a new job with the specified parameters. Existing job cannot be updated with this API + and should instead be updated with the Update job API. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource: Job details from request body. + :type job_resource: ~azure.mgmt.databox.v2021_08_01_preview.models.JobResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_08_01_preview.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource=job_resource, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + job_name=job_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.JobResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.JobResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(job_resource_update_parameter, 'JobResourceUpdateParameter') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + if_match=if_match, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + job_name: str, + job_resource_update_parameter: "_models.JobResourceUpdateParameter", + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller["_models.JobResource"]: + """Updates the properties of an existing job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param job_resource_update_parameter: Job update parameters from request body. + :type job_resource_update_parameter: + ~azure.mgmt.databox.v2021_08_01_preview.models.JobResourceUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the job on the server matches this value. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.databox.v2021_08_01_preview.models.JobResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + job_name=job_name, + job_resource_update_parameter=job_resource_update_parameter, + if_match=if_match, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('JobResource', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}'} # type: ignore + + @distributed_trace + def book_shipment_pick_up( + self, + resource_group_name: str, + job_name: str, + shipment_pick_up_request: "_models.ShipmentPickUpRequest", + **kwargs: Any + ) -> "_models.ShipmentPickUpResponse": + """Book shipment pick up. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param shipment_pick_up_request: Details of shipment pick up request. + :type shipment_pick_up_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.ShipmentPickUpRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShipmentPickUpResponse, or the result of cls(response) + :rtype: ~azure.mgmt.databox.v2021_08_01_preview.models.ShipmentPickUpResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ShipmentPickUpResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(shipment_pick_up_request, 'ShipmentPickUpRequest') + + request = build_book_shipment_pick_up_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.book_shipment_pick_up.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShipmentPickUpResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + book_shipment_pick_up.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp'} # type: ignore + + + @distributed_trace + def cancel( + self, + resource_group_name: str, + job_name: str, + cancellation_reason: "_models.CancellationReason", + **kwargs: Any + ) -> None: + """CancelJob. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :param cancellation_reason: Reason for cancellation. + :type cancellation_reason: ~azure.mgmt.databox.v2021_08_01_preview.models.CancellationReason + :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 + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(cancellation_reason, 'CancellationReason') + + request = build_cancel_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self.cancel.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel'} # type: ignore + + + @distributed_trace + def list_credentials( + self, + resource_group_name: str, + job_name: str, + **kwargs: Any + ) -> Iterable["_models.UnencryptedCredentialsList"]: + """This method gets the unencrypted secrets related to the job. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :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. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UnencryptedCredentialsList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.UnencryptedCredentialsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UnencryptedCredentialsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=self.list_credentials.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_credentials_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + job_name=job_name, + template_url=next_link, + ) + 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("UnencryptedCredentialsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_operations.py new file mode 100644 index 000000000000..211f4c253fe0 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_operations.py @@ -0,0 +1,136 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +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: + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.DataBox/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.OperationList"]: + """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 OperationList or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataBox/operations'} # type: ignore diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_service_operations.py b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_service_operations.py new file mode 100644 index 000000000000..476866bd187d --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/operations/_service_operations.py @@ -0,0 +1,688 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_available_skus_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_address_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_validate_inputs_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_request( + subscription_id: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_region_configuration_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-08-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class ServiceOperations(object): + """ServiceOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.databox.v2021_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_available_skus_by_resource_group( + self, + resource_group_name: str, + location: str, + available_sku_request: "_models.AvailableSkuRequest", + **kwargs: Any + ) -> Iterable["_models.AvailableSkusResult"]: + """This method provides the list of available skus for the given subscription, resource group and + location. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param available_sku_request: Filters for showing the available skus. + :type available_sku_request: ~azure.mgmt.databox.v2021_08_01_preview.models.AvailableSkuRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AvailableSkusResult or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.databox.v2021_08_01_preview.models.AvailableSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.list_available_skus_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + _json = self._serialize.body(available_sku_request, 'AvailableSkuRequest') + + request = build_list_available_skus_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=next_link, + ) + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_available_skus_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus'} # type: ignore + + @distributed_trace + def validate_address( + self, + location: str, + validate_address: "_models.ValidateAddress", + **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. + :type location: str + :param validate_address: Shipping address of the customer. + :type validate_address: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidateAddress + :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.v2021_08_01_preview.models.AddressValidationOutput + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressValidationOutput"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validate_address, 'ValidateAddress') + + request = build_validate_address_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_address.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def validate_inputs_by_resource_group( + self, + resource_group_name: str, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationRequest + :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.v2021_08_01_preview.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def validate_inputs( + self, + location: str, + validation_request: "_models.ValidationRequest", + **kwargs: Any + ) -> "_models.ValidationResponse": + """This method does all necessary pre-job creation validation under subscription. + + :param location: The location of the resource. + :type location: str + :param validation_request: Inputs of the customer. + :type validation_request: ~azure.mgmt.databox.v2021_08_01_preview.models.ValidationRequest + :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.v2021_08_01_preview.models.ValidationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(validation_request, 'ValidationRequest') + + request = build_validate_inputs_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.validate_inputs.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def region_configuration( + self, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Subscription + level. + + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationRequest + :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.v2021_08_01_preview.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, 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'} # type: ignore + + + @distributed_trace + def region_configuration_by_resource_group( + self, + resource_group_name: str, + location: str, + region_configuration_request: "_models.RegionConfigurationRequest", + **kwargs: Any + ) -> "_models.RegionConfigurationResponse": + """This API provides configuration details specific to given region/location at Resource group + level. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param location: The location of the resource. + :type location: str + :param region_configuration_request: Request body to get the configuration for the region at + resource group level. + :type region_configuration_request: + ~azure.mgmt.databox.v2021_08_01_preview.models.RegionConfigurationRequest + :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.v2021_08_01_preview.models.RegionConfigurationResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionConfigurationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(region_configuration_request, 'RegionConfigurationRequest') + + request = build_region_configuration_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.region_configuration_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + error = self._deserialize.failsafe_deserialize(_models.ApiError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RegionConfigurationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + region_configuration_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration'} # type: ignore + diff --git a/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/py.typed b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2021_08_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file