diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json b/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json index c6dafdaa517c..9946907b7792 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json +++ b/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.5", + "commit": "01a40ad3b4b8588e62647b76c85090740d05c802", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest": "3.9.2", "use": [ - "@autorest/python@5.8.4", - "@autorest/modelerfour@4.19.2" + "@autorest/python@6.4.0", + "@autorest/modelerfour@4.24.3" ], - "commit": "cea6492a1e41b3f3b4f8b4f69bdcc10431e79c0e", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/edgeorder/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "autorest_command": "autorest specification/edgeorder/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/edgeorder/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/__init__.py index 9b25065a52f8..f8c8f5232d6b 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/__init__.py @@ -14,3 +14,7 @@ patch_sdk() except ImportError: pass + +from ._version import VERSION + +__version__ = VERSION diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_configuration.py index 99ef324273b8..aa76ce99a726 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_configuration.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_configuration.py @@ -8,18 +8,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 class EdgeOrderManagementClientConfiguration(Configuration): @@ -28,19 +26,18 @@ class EdgeOrderManagementClientConfiguration(Configuration): 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str """ def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any ): - # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -55,9 +52,8 @@ def __init__( def _configure( self, - **kwargs # type: Any + **kwargs: 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) @@ -68,4 +64,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/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py index dd000ceba0d1..bd98f0c74a78 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py @@ -9,22 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, Optional, 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 EdgeOrderManagementClientConfiguration from ._operations_mixin import EdgeOrderManagementClientOperationsMixin +from ._serialization import Deserializer, Serializer if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -44,9 +41,9 @@ class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin, MultiA The api-version parameter sets the default API version if the operation group is not described in the profile. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param api_version: API version to use if no profile is provided, or if missing in profile. :type api_version: str @@ -68,15 +65,13 @@ class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin, MultiA def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - api_version=None, # type: Optional[str] - base_url=None, # type: Optional[str] - profile=KnownProfiles.default, # type: KnownProfiles - **kwargs # type: Any + credential: "TokenCredential", + subscription_id: str, + api_version: Optional[str]=None, + base_url: str = "https://management.azure.com", + profile: KnownProfiles=KnownProfiles.default, + **kwargs: Any ): - if not base_url: - base_url = 'https://management.azure.com' self._config = EdgeOrderManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(EdgeOrderManagementClient, self).__init__( @@ -94,6 +89,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-12-01-preview: :mod:`v2020_12_01_preview.models` * 2021-12-01: :mod:`v2021_12_01.models` + * 2022-05-01-preview: :mod:`v2022_05_01_preview.models` """ if api_version == '2020-12-01-preview': from .v2020_12_01_preview import models @@ -101,8 +97,81 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-12-01': from .v2021_12_01 import models return models + elif api_version == '2022-05-01-preview': + from .v2022_05_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) + @property + def addresses(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`AddressesOperations` + """ + api_version = self._get_api_version('addresses') + if api_version == '2022-05-01-preview': + from .v2022_05_01_preview.operations import AddressesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'addresses'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def operations(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2022-05-01-preview': + from .v2022_05_01_preview.operations import Operations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def order_items(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`OrderItemsOperations` + """ + api_version = self._get_api_version('order_items') + if api_version == '2022-05-01-preview': + from .v2022_05_01_preview.operations import OrderItemsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'order_items'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def orders(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`OrdersOperations` + """ + api_version = self._get_api_version('orders') + if api_version == '2022-05-01-preview': + from .v2022_05_01_preview.operations import OrdersOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'orders'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def products_and_configurations(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`ProductsAndConfigurationsOperations` + """ + api_version = self._get_api_version('products_and_configurations') + if api_version == '2022-05-01-preview': + from .v2022_05_01_preview.operations import ProductsAndConfigurationsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'products_and_configurations'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + def close(self): self._client.close() def __enter__(self): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_metadata.json b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_metadata.json deleted file mode 100644 index 5c00fb13ce9f..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_metadata.json +++ /dev/null @@ -1,444 +0,0 @@ -{ - "chosen_version": "2020-12-01-preview", - "total_api_version_list": ["2020-12-01-preview"], - "client": { - "name": "EdgeOrderManagementClient", - "filename": "_edge_order_management_client", - "description": "Edge Order API\u0027s.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": 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\": [\"EdgeOrderManagementClientConfiguration\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "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 ID of the target subscription.", - "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 ID of the target subscription.", - "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=None, # type: Optional[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: Optional[str] = None,", - "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, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"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\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - }, - "operation_mixins": { - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.mgmt.core.polling.arm_polling\": [\"ARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\", \"Union\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.mgmt.core.polling.async_arm_polling\": [\"AsyncARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", - "operations": { - "list_operations" : { - "sync": { - "signature": "def list_operations(\n self,\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OperationListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.OperationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OperationListResult\"]:\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OperationListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OperationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "" - }, - "list_addresses_at_subscription_level" : { - "sync": { - "signature": "def list_addresses_at_subscription_level(\n self,\n filter=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.AddressResourceList\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "filter, skip_token" - }, - "list_product_families" : { - "sync": { - "signature": "def list_product_families(\n self,\n product_families_request, # type: \"_models.ProductFamiliesRequest\"\n expand=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families.\n:type product_families_request: ~edge_order_management_client.models.ProductFamiliesRequest\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamilies or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.ProductFamilies]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_product_families(\n self,\n product_families_request: \"_models.ProductFamiliesRequest\",\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ProductFamilies\"]:\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families.\n:type product_families_request: ~edge_order_management_client.models.ProductFamiliesRequest\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamilies or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.ProductFamilies]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "product_families_request, expand, skip_token" - }, - "list_configurations" : { - "sync": { - "signature": "def list_configurations(\n self,\n configurations_request, # type: \"_models.ConfigurationsRequest\"\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations.\n:type configurations_request: ~edge_order_management_client.models.ConfigurationsRequest\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configurations or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.Configurations]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_configurations(\n self,\n configurations_request: \"_models.ConfigurationsRequest\",\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.Configurations\"]:\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations.\n:type configurations_request: ~edge_order_management_client.models.ConfigurationsRequest\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configurations or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.Configurations]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "configurations_request, skip_token" - }, - "list_product_families_metadata" : { - "sync": { - "signature": "def list_product_families_metadata(\n self,\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadata or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.ProductFamiliesMetadata]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ProductFamiliesMetadata\"]:\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadata or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.ProductFamiliesMetadata]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "skip_token" - }, - "list_order_at_subscription_level" : { - "sync": { - "signature": "def list_order_at_subscription_level(\n self,\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderResourceList\"]:\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "skip_token" - }, - "list_order_items_at_subscription_level" : { - "sync": { - "signature": "def list_order_items_at_subscription_level(\n self,\n filter=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of orders, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderItemResourceList\"]:\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of orders, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "filter, skip_token" - }, - "list_addresses_at_resource_group_level" : { - "sync": { - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name, # type: str\n filter=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.AddressResourceList\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "resource_group_name, filter, skip_token" - }, - "get_address_by_name" : { - "sync": { - "signature": "def get_address_by_name(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.AddressResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e \"_models.AddressResource\":\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.AddressResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "address_name, resource_group_name" - }, - "_create_address_initial" : { - "sync": { - "signature": "def _create_address_initial(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_resource, # type: \"_models.AddressResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~edge_order_management_client.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: \"_models.AddressResource\",\n **kwargs: Any\n) -\u003e Optional[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~edge_order_management_client.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_resource" - }, - "begin_create_address" : { - "sync": { - "signature": "def begin_create_address(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_resource, # type: \"_models.AddressResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~edge_order_management_client.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~edge_order_management_client.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: \"_models.AddressResource\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~edge_order_management_client.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~edge_order_management_client.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_resource" - }, - "_delete_address_by_name_initial" : { - "sync": { - "signature": "def _delete_address_by_name_initial(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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 _delete_address_by_name_initial(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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": "address_name, resource_group_name" - }, - "begin_delete_address_by_name" : { - "sync": { - "signature": "def begin_delete_address_by_name(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_delete_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "address_name, resource_group_name" - }, - "_update_address_initial" : { - "sync": { - "signature": "def _update_address_initial(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_update_parameter, # type: \"_models.AddressUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~edge_order_management_client.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: \"_models.AddressUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~edge_order_management_client.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_update_parameter, if_match" - }, - "begin_update_address" : { - "sync": { - "signature": "def begin_update_address(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_update_parameter, # type: \"_models.AddressUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~edge_order_management_client.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~edge_order_management_client.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: \"_models.AddressUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~edge_order_management_client.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~edge_order_management_client.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_update_parameter, if_match" - }, - "list_order_at_resource_group_level" : { - "sync": { - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name, # type: str\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderResourceList\"]:\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "resource_group_name, skip_token" - }, - "get_order_by_name" : { - "sync": { - "signature": "def get_order_by_name(\n self,\n order_name, # type: str\n resource_group_name, # type: str\n location, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param location: The name of Azure region.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.OrderResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e \"_models.OrderResource\":\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param location: The name of Azure region.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.OrderResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_name, resource_group_name, location" - }, - "list_order_items_at_resource_group_level" : { - "sync": { - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name, # type: str\n filter=None, # type: Optional[str]\n expand=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details parameter for order item, which provides\n details on the devices of the product.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~edge_order_management_client.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": false, - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderItemResourceList\"]:\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details parameter for order item, which provides\n details on the devices of the product.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "resource_group_name, filter, expand, skip_token" - }, - "get_order_item_by_name" : { - "sync": { - "signature": "def get_order_item_by_name(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n expand=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param expand: $expand is supported on device details parameter for order item, which provides\n details on the devices of the product.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.OrderItemResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.OrderItemResource\":\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param expand: $expand is supported on device details parameter for order item, which provides\n details on the devices of the product.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.OrderItemResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, expand" - }, - "_create_order_item_initial" : { - "sync": { - "signature": "def _create_order_item_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_resource, # type: \"_models.OrderItemResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~edge_order_management_client.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: \"_models.OrderItemResource\",\n **kwargs: Any\n) -\u003e Optional[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~edge_order_management_client.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_resource" - }, - "begin_create_order_item" : { - "sync": { - "signature": "def begin_create_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_resource, # type: \"_models.OrderItemResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~edge_order_management_client.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~edge_order_management_client.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: \"_models.OrderItemResource\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~edge_order_management_client.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~edge_order_management_client.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_resource" - }, - "_delete_order_item_by_name_initial" : { - "sync": { - "signature": "def _delete_order_item_by_name_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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 _delete_order_item_by_name_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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": "order_item_name, resource_group_name" - }, - "begin_delete_order_item_by_name" : { - "sync": { - "signature": "def begin_delete_order_item_by_name(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_delete_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name" - }, - "_update_order_item_initial" : { - "sync": { - "signature": "def _update_order_item_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_update_parameter, # type: \"_models.OrderItemUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~edge_order_management_client.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: \"_models.OrderItemUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~edge_order_management_client.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~edge_order_management_client.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match" - }, - "begin_update_order_item" : { - "sync": { - "signature": "def begin_update_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_update_parameter, # type: \"_models.OrderItemUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~edge_order_management_client.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~edge_order_management_client.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: \"_models.OrderItemUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~edge_order_management_client.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~edge_order_management_client.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match" - }, - "cancel_order_item" : { - "sync": { - "signature": "def cancel_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n cancellation_reason, # type: \"_models.CancellationReason\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation.\n:type cancellation_reason: ~edge_order_management_client.models.CancellationReason\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 cancel_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: \"_models.CancellationReason\",\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation.\n:type cancellation_reason: ~edge_order_management_client.models.CancellationReason\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": "order_item_name, resource_group_name, cancellation_reason" - }, - "_return_order_item_initial" : { - "sync": { - "signature": "def _return_order_item_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n return_order_item_details, # type: \"_models.ReturnOrderItemDetails\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~edge_order_management_client.models.ReturnOrderItemDetails\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 _return_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: \"_models.ReturnOrderItemDetails\",\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~edge_order_management_client.models.ReturnOrderItemDetails\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": "order_item_name, resource_group_name, return_order_item_details" - }, - "begin_return_order_item" : { - "sync": { - "signature": "def begin_return_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n return_order_item_details, # type: \"_models.ReturnOrderItemDetails\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~edge_order_management_client.models.ReturnOrderItemDetails\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: \"_models.ReturnOrderItemDetails\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~edge_order_management_client.models.ReturnOrderItemDetails\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, return_order_item_details" - } - } - } -} \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_operations_mixin.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_operations_mixin.py index 7327f72cb09a..eb12d2f833cc 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_operations_mixin.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_operations_mixin.py @@ -8,50 +8,50 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from msrest import Serializer, Deserializer -from typing import TYPE_CHECKING -import warnings +from ._serialization import Serializer, Deserializer +from typing import Any, IO, Iterable, Optional, Union -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.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling +from azure.core.polling import LROPoller -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +from . import models as _models class EdgeOrderManagementClientOperationsMixin(object): def begin_create_address( self, - address_name, # type: str - resource_group_name, # type: str - address_resource, # type: "_models.AddressResource" - **kwargs # type: Any - ): + address_name: str, + resource_group_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: """Creates a new address with the specified parameters. Existing address can be updated with this API. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_resource: Address details from request body. - :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource + :param address_resource: Address details from request body. Is either a AddressResource type or + a IO type. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) + :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 AddressResource or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -65,6 +65,7 @@ def begin_create_address( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -72,28 +73,37 @@ def begin_create_address( def begin_create_order_item( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_resource, # type: "_models.OrderItemResource" - **kwargs # type: Any - ): + order_item_name: str, + resource_group_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: """Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_resource: Order item details from request body. - :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource + :param order_item_resource: Order item details from request body. Is either a OrderItemResource + type or a IO type. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_create_order_item') @@ -106,6 +116,7 @@ def begin_create_order_item( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -113,24 +124,27 @@ def begin_create_order_item( def begin_delete_address_by_name( self, - address_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): + address_name: str, + resource_group_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: @@ -145,6 +159,7 @@ def begin_delete_address_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -152,22 +167,25 @@ def begin_delete_address_by_name( def begin_delete_order_item_by_name( self, - order_item_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): + order_item_name: str, + resource_group_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: @@ -182,6 +200,7 @@ def begin_delete_order_item_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -189,25 +208,33 @@ def begin_delete_order_item_by_name( def begin_return_order_item( self, - order_item_name, # type: str - resource_group_name, # type: str - return_order_item_details, # type: "_models.ReturnOrderItemDetails" - **kwargs # type: Any - ): + order_item_name: str, + resource_group_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> LROPoller[None]: """Return order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. - :type return_order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails + :param return_order_item_details: Return order item CurrentStatus. Is either a + ReturnOrderItemDetails type or a IO type. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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: @@ -222,6 +249,7 @@ def begin_return_order_item( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -229,32 +257,41 @@ def begin_return_order_item( def begin_update_address( self, - address_name, # type: str - resource_group_name, # type: str - address_update_parameter, # type: "_models.AddressUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): + address_name: str, + resource_group_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: """Updates the properties of an existing address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. + :param address_update_parameter: Address update parameters from request body. Is either a + AddressUpdateParameter type or a IO type. Required. :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter + or IO :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. + of the job on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) + :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 AddressResource or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -268,6 +305,7 @@ def begin_update_address( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -275,31 +313,41 @@ def begin_update_address( def begin_update_order_item( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_update_parameter, # type: "_models.OrderItemUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: """Updates the properties of an existing order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. - :type order_item_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter + :param order_item_update_parameter: order item update parameters from request body. Is either a + OrderItemUpdateParameter type or a IO type. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. + of the order on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_update_order_item') @@ -312,30 +360,36 @@ def begin_update_order_item( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return mixin_instance.begin_update_order_item(order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs) - def cancel_order_item( + def cancel_order_item( # pylint: disable=inconsistent-return-statements self, - order_item_name, # type: str - resource_group_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): + order_item_name: str, + resource_group_name: str, + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any + ) -> None: """Cancel order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO type. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('cancel_order_item') if api_version == '2020-12-01-preview': @@ -347,6 +401,7 @@ def cancel_order_item( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -354,22 +409,23 @@ def cancel_order_item( def get_address_by_name( self, - address_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): + address_name: str, + resource_group_name: str, + **kwargs: Any + ) -> _models.AddressResource: """Gets information about the specified address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource, or the result of cls(response) + :return: AddressResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('get_address_by_name') if api_version == '2020-12-01-preview': @@ -381,6 +437,7 @@ def get_address_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -388,23 +445,24 @@ def get_address_by_name( def get_order_by_name( self, - order_name, # type: str - resource_group_name, # type: str - location, # type: str - **kwargs # type: Any - ): + order_name: str, + resource_group_name: str, + location: str, + **kwargs: Any + ) -> _models.OrderResource: """Gets an order. - :param order_name: The name of the order. + :param order_name: The name of the order. Required. :type order_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param location: The name of Azure region. + :param location: The name of Azure region. Required. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource, or the result of cls(response) + :return: OrderResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('get_order_by_name') if api_version == '2020-12-01-preview': @@ -416,6 +474,7 @@ def get_order_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -423,26 +482,28 @@ def get_order_by_name( def get_order_item_by_name( self, - order_item_name, # type: str - resource_group_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): + order_item_name: str, + resource_group_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.OrderItemResource: """Gets an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource, or the result of cls(response) + :return: OrderItemResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('get_order_item_by_name') if api_version == '2020-12-01-preview': @@ -454,6 +515,7 @@ def get_order_item_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -461,25 +523,26 @@ def get_order_item_by_name( def list_addresses_at_resource_group_level( self, - resource_group_name, # type: str - filter=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.AddressResource"]: """Lists all the addresses available under the given resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of address. + page in the list of address. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_addresses_at_resource_group_level') if api_version == '2020-12-01-preview': @@ -491,6 +554,7 @@ def list_addresses_at_resource_group_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -498,22 +562,22 @@ def list_addresses_at_resource_group_level( def list_addresses_at_subscription_level( self, - filter=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.AddressResource"]: """Lists all the addresses available under the subscription. :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. + page in the list of addresses. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_addresses_at_subscription_level') if api_version == '2020-12-01-preview': @@ -525,6 +589,7 @@ def list_addresses_at_subscription_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -532,22 +597,27 @@ def list_addresses_at_subscription_level( def list_configurations( self, - configurations_request, # type: "_models.ConfigurationsRequest" - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): + configurations_request: Union[_models.ConfigurationsRequest, IO], + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.Configuration"]: """This method provides the list of configurations for the given product family, product line and product under subscription. - :param configurations_request: Filters for showing the configurations. - :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO type. Required. + :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or + IO :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. + page in the list of configurations. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configurations or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configurations] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_configurations') if api_version == '2020-12-01-preview': @@ -559,6 +629,7 @@ def list_configurations( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -566,14 +637,14 @@ def list_configurations( def list_operations( self, - **kwargs # type: Any - ): + **kwargs: Any + ) -> Iterable["_models.Operation"]: """This method gets all the operations that are exposed for customer. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_operations') if api_version == '2020-12-01-preview': @@ -585,6 +656,7 @@ def list_operations( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -592,21 +664,22 @@ def list_operations( def list_order_at_resource_group_level( self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.OrderResource"]: """Lists order at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_order_at_resource_group_level') if api_version == '2020-12-01-preview': @@ -618,6 +691,7 @@ def list_order_at_resource_group_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -625,18 +699,18 @@ def list_order_at_resource_group_level( def list_order_at_subscription_level( self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.OrderResource"]: """Lists order at subscription level. :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_order_at_subscription_level') if api_version == '2020-12-01-preview': @@ -648,6 +722,7 @@ def list_order_at_subscription_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -655,31 +730,34 @@ def list_order_at_subscription_level( def list_order_items_at_resource_group_level( self, - resource_group_name, # type: str - filter=None, # type: Optional[str] - expand=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): + resource_group_name: str, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.OrderItemResource"]: """Lists order item at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_order_items_at_resource_group_level') if api_version == '2020-12-01-preview': @@ -691,6 +769,7 @@ def list_order_items_at_resource_group_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -698,28 +777,30 @@ def list_order_items_at_resource_group_level( def list_order_items_at_subscription_level( self, - filter=None, # type: Optional[str] - expand=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.OrderItemResource"]: """Lists order item at subscription level. :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_order_items_at_subscription_level') if api_version == '2020-12-01-preview': @@ -731,6 +812,7 @@ def list_order_items_at_subscription_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -738,25 +820,30 @@ def list_order_items_at_subscription_level( def list_product_families( self, - product_families_request, # type: "_models.ProductFamiliesRequest" - expand=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): + product_families_request: Union[_models.ProductFamiliesRequest, IO], + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: """This method provides the list of product families for the given subscription. - :param product_families_request: Filters for showing the product families. + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO type. Required. :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest + or IO :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. + details on the configurations for the product. Default value is None. :type expand: str :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. + page in the list of product families. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamilies or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamilies] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_product_families') if api_version == '2020-12-01-preview': @@ -768,6 +855,7 @@ def list_product_families( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -775,18 +863,20 @@ def list_product_families( def list_product_families_metadata( self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ProductFamiliesMetadataDetails"]: """This method provides the list of product families metadata for the given subscription. :param skip_token: $skipToken is supported on list of product families metadata, which provides - the next page in the list of product families metadata. + the next page in the list of product families metadata. Default value is None. :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 ProductFamiliesMetadata or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadata] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_product_families_metadata') if api_version == '2020-12-01-preview': @@ -798,6 +888,7 @@ def list_product_families_metadata( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py new file mode 100644 index 000000000000..25467dfc00bb --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py @@ -0,0 +1,1998 @@ +# -------------------------------------------------------------------------- +# +# 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. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +try: + basestring # type: ignore + unicode_str = unicode # type: ignore +except NameError: + basestring = str + unicode_str = str + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset # type: ignore +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Dict[str, Any] = {} + for k in kwargs: + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node.""" + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to azure from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[ + [str, Dict[str, Any], Any], Any + ] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) + + @classmethod + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + Remove the polymorphic key from the initial data. + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + """ + return key.replace("\\.", ".") + + +class Serializer(object): + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = unicode_str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError: + continue + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise_with_traceback(SerializationError, msg, err) + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] + if not kwargs.get("skip_quote", False): + data = [quote(str(d), safe="") for d in data] + return str(self.serialize_iter(data, internal_data_type, **kwargs)) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is AzureCoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise_with_traceback(SerializationError, msg.format(data, data_type), err) + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + not be None or empty. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError: + serialized.append(None) + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is unicode_str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise_with_traceback(SerializationError, msg, err) + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise_with_traceback(TypeError, msg, err) + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key.""" + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, basestring): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None: + return data + try: + attributes = response._attribute_map # type: ignore + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise_with_traceback(DeserializationError, msg, err) + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + """ + if target is None: + return None, None + + if isinstance(target, basestring): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [k for k, v in response._validation.items() if v.get("readonly")] + const = [k for k, v in response._validation.items() if v.get("constant")] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise_with_traceback(DeserializationError, msg, err) + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, basestring): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, basestring): + if attr.lower() in ["true", "1"]: + return True + elif attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + # https://github.com/Azure/azure-rest-api-specs/issues/141 + try: + return list(enum_obj.__members__.values())[data] + except IndexError: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(attr) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise_with_traceback(DeserializationError, msg, err) + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise_with_traceback(DeserializationError, msg, err) + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_configuration.py index c1c21c4043e8..20c71c35d537 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_configuration.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_configuration.py @@ -12,7 +12,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 @@ -26,9 +26,9 @@ class EdgeOrderManagementClientConfiguration(Configuration): 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str """ @@ -36,7 +36,7 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - **kwargs # type: Any + **kwargs: Any ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -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/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py index 238c8eb3baa3..fbc912c1611a 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py @@ -11,12 +11,11 @@ from typing import Any, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin -from msrest import Deserializer, Serializer +from .._serialization import Deserializer, Serializer from ._configuration import EdgeOrderManagementClientConfiguration from ._operations_mixin import EdgeOrderManagementClientOperationsMixin @@ -42,9 +41,9 @@ class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin, MultiA The api-version parameter sets the default API version if the operation group is not described in the profile. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param api_version: API version to use if no profile is provided, or if missing in profile. :type api_version: str @@ -69,12 +68,10 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, api_version: Optional[str] = None, - base_url: Optional[str] = None, + base_url: str = "https://management.azure.com", profile: KnownProfiles = KnownProfiles.default, - **kwargs # type: Any + **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' self._config = EdgeOrderManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(EdgeOrderManagementClient, self).__init__( @@ -92,6 +89,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-12-01-preview: :mod:`v2020_12_01_preview.models` * 2021-12-01: :mod:`v2021_12_01.models` + * 2022-05-01-preview: :mod:`v2022_05_01_preview.models` """ if api_version == '2020-12-01-preview': from ..v2020_12_01_preview import models @@ -99,8 +97,81 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-12-01': from ..v2021_12_01 import models return models + elif api_version == '2022-05-01-preview': + from ..v2022_05_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) + @property + def addresses(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`AddressesOperations` + """ + api_version = self._get_api_version('addresses') + if api_version == '2022-05-01-preview': + from ..v2022_05_01_preview.aio.operations import AddressesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'addresses'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def operations(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2022-05-01-preview': + from ..v2022_05_01_preview.aio.operations import Operations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def order_items(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`OrderItemsOperations` + """ + api_version = self._get_api_version('order_items') + if api_version == '2022-05-01-preview': + from ..v2022_05_01_preview.aio.operations import OrderItemsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'order_items'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def orders(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`OrdersOperations` + """ + api_version = self._get_api_version('orders') + if api_version == '2022-05-01-preview': + from ..v2022_05_01_preview.aio.operations import OrdersOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'orders'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def products_and_configurations(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`ProductsAndConfigurationsOperations` + """ + api_version = self._get_api_version('products_and_configurations') + if api_version == '2022-05-01-preview': + from ..v2022_05_01_preview.aio.operations import ProductsAndConfigurationsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'products_and_configurations'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + async def close(self): await self._client.close() async def __aenter__(self): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_operations_mixin.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_operations_mixin.py index b703caa3df4a..5f6d25173fa2 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_operations_mixin.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_operations_mixin.py @@ -8,17 +8,13 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from msrest import Serializer, Deserializer -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from .._serialization import Serializer, Deserializer +from typing import Any, AsyncIterable, IO, Optional, Union -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.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling +from azure.core.async_paging import AsyncItemPaged +from azure.core.polling import AsyncLROPoller + +from .. import models as _models class EdgeOrderManagementClientOperationsMixin(object): @@ -27,28 +23,37 @@ async def begin_create_address( self, address_name: str, resource_group_name: str, - address_resource: "_models.AddressResource", + address_resource: Union[_models.AddressResource, IO], **kwargs: Any - ) -> AsyncLROPoller["_models.AddressResource"]: + ) -> AsyncLROPoller[_models.AddressResource]: """Creates a new address with the specified parameters. Existing address can be updated with this API. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_resource: Address details from request body. - :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource + :param address_resource: Address details from request body. Is either a AddressResource type or + a IO type. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_create_address') @@ -61,6 +66,7 @@ async def begin_create_address( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -70,26 +76,35 @@ async def begin_create_order_item( self, order_item_name: str, resource_group_name: str, - order_item_resource: "_models.OrderItemResource", + order_item_resource: Union[_models.OrderItemResource, IO], **kwargs: Any - ) -> AsyncLROPoller["_models.OrderItemResource"]: + ) -> AsyncLROPoller[_models.OrderItemResource]: """Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_resource: Order item details from request body. - :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource + :param order_item_resource: Order item details from request body. Is either a OrderItemResource + type or a IO type. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_create_order_item') @@ -102,6 +117,7 @@ async def begin_create_order_item( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -117,16 +133,19 @@ async def begin_delete_address_by_name( :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: @@ -141,6 +160,7 @@ async def begin_delete_address_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -154,16 +174,19 @@ async def begin_delete_order_item_by_name( ) -> AsyncLROPoller[None]: """Deletes an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: @@ -178,6 +201,7 @@ async def begin_delete_order_item_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -187,23 +211,31 @@ async def begin_return_order_item( self, order_item_name: str, resource_group_name: str, - return_order_item_details: "_models.ReturnOrderItemDetails", + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], **kwargs: Any ) -> AsyncLROPoller[None]: """Return order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. - :type return_order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails + :param return_order_item_details: Return order item CurrentStatus. Is either a + ReturnOrderItemDetails type or a IO type. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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: @@ -218,6 +250,7 @@ async def begin_return_order_item( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -227,31 +260,41 @@ async def begin_update_address( self, address_name: str, resource_group_name: str, - address_update_parameter: "_models.AddressUpdateParameter", + address_update_parameter: Union[_models.AddressUpdateParameter, IO], if_match: Optional[str] = None, **kwargs: Any - ) -> AsyncLROPoller["_models.AddressResource"]: + ) -> AsyncLROPoller[_models.AddressResource]: """Updates the properties of an existing address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. + :param address_update_parameter: Address update parameters from request body. Is either a + AddressUpdateParameter type or a IO type. Required. :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter + or IO :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. + of the job on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_update_address') @@ -264,6 +307,7 @@ async def begin_update_address( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -273,29 +317,39 @@ async def begin_update_order_item( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: "_models.OrderItemUpdateParameter", + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], if_match: Optional[str] = None, **kwargs: Any - ) -> AsyncLROPoller["_models.OrderItemResource"]: + ) -> AsyncLROPoller[_models.OrderItemResource]: """Updates the properties of an existing order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. - :type order_item_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter + :param order_item_update_parameter: order item update parameters from request body. Is either a + OrderItemUpdateParameter type or a IO type. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. + of the order on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('begin_update_order_item') @@ -308,30 +362,36 @@ async def begin_update_order_item( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) return await mixin_instance.begin_update_order_item(order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs) - async def cancel_order_item( + async def cancel_order_item( # pylint: disable=inconsistent-return-statements self, order_item_name: str, resource_group_name: str, - cancellation_reason: "_models.CancellationReason", + cancellation_reason: Union[_models.CancellationReason, IO], **kwargs: Any ) -> None: """Cancel order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO type. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('cancel_order_item') if api_version == '2020-12-01-preview': @@ -343,6 +403,7 @@ async def cancel_order_item( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -353,19 +414,20 @@ async def get_address_by_name( address_name: str, resource_group_name: str, **kwargs: Any - ) -> "_models.AddressResource": + ) -> _models.AddressResource: """Gets information about the specified address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource, or the result of cls(response) + :return: AddressResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('get_address_by_name') if api_version == '2020-12-01-preview': @@ -377,6 +439,7 @@ async def get_address_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -388,19 +451,20 @@ async def get_order_by_name( resource_group_name: str, location: str, **kwargs: Any - ) -> "_models.OrderResource": + ) -> _models.OrderResource: """Gets an order. - :param order_name: The name of the order. + :param order_name: The name of the order. Required. :type order_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param location: The name of Azure region. + :param location: The name of Azure region. Required. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource, or the result of cls(response) + :return: OrderResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('get_order_by_name') if api_version == '2020-12-01-preview': @@ -412,6 +476,7 @@ async def get_order_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -423,22 +488,24 @@ async def get_order_item_by_name( resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> "_models.OrderItemResource": + ) -> _models.OrderItemResource: """Gets an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource, or the result of cls(response) + :return: OrderItemResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('get_order_item_by_name') if api_version == '2020-12-01-preview': @@ -450,6 +517,7 @@ async def get_order_item_by_name( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -461,21 +529,23 @@ def list_addresses_at_resource_group_level( filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.AddressResourceList"]: + ) -> AsyncIterable["_models.AddressResource"]: """Lists all the addresses available under the given resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of address. + page in the list of address. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_addresses_at_resource_group_level') if api_version == '2020-12-01-preview': @@ -487,6 +557,7 @@ def list_addresses_at_resource_group_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -497,19 +568,20 @@ def list_addresses_at_subscription_level( filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.AddressResourceList"]: + ) -> AsyncIterable["_models.AddressResource"]: """Lists all the addresses available under the subscription. :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. + page in the list of addresses. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_addresses_at_subscription_level') if api_version == '2020-12-01-preview': @@ -521,6 +593,7 @@ def list_addresses_at_subscription_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -528,22 +601,28 @@ def list_addresses_at_subscription_level( def list_configurations( self, - configurations_request: "_models.ConfigurationsRequest", + configurations_request: Union[_models.ConfigurationsRequest, IO], skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Configurations"]: + ) -> AsyncIterable["_models.Configuration"]: """This method provides the list of configurations for the given product family, product line and product under subscription. - :param configurations_request: Filters for showing the configurations. - :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO type. Required. + :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or + IO :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. + page in the list of configurations. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configurations or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configurations] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_configurations') if api_version == '2020-12-01-preview': @@ -555,6 +634,7 @@ def list_configurations( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -563,13 +643,14 @@ def list_configurations( def list_operations( self, **kwargs: Any - ) -> AsyncItemPaged["_models.OperationListResult"]: + ) -> AsyncIterable["_models.Operation"]: """This method gets all the operations that are exposed for customer. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_operations') if api_version == '2020-12-01-preview': @@ -581,6 +662,7 @@ def list_operations( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -591,18 +673,20 @@ def list_order_at_resource_group_level( resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.OrderResourceList"]: + ) -> AsyncIterable["_models.OrderResource"]: """Lists order at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_order_at_resource_group_level') if api_version == '2020-12-01-preview': @@ -614,6 +698,7 @@ def list_order_at_resource_group_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -623,16 +708,17 @@ def list_order_at_subscription_level( self, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.OrderResourceList"]: + ) -> AsyncIterable["_models.OrderResource"]: """Lists order at subscription level. :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_order_at_subscription_level') if api_version == '2020-12-01-preview': @@ -644,6 +730,7 @@ def list_order_at_subscription_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -656,26 +743,29 @@ def list_order_items_at_resource_group_level( expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.OrderItemResourceList"]: + ) -> AsyncIterable["_models.OrderItemResource"]: """Lists order item at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_order_items_at_resource_group_level') if api_version == '2020-12-01-preview': @@ -687,6 +777,7 @@ def list_order_items_at_resource_group_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -698,24 +789,26 @@ def list_order_items_at_subscription_level( expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.OrderItemResourceList"]: + ) -> AsyncIterable["_models.OrderItemResource"]: """Lists order item at subscription level. :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_order_items_at_subscription_level') if api_version == '2020-12-01-preview': @@ -727,6 +820,7 @@ def list_order_items_at_subscription_level( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -734,25 +828,31 @@ def list_order_items_at_subscription_level( def list_product_families( self, - product_families_request: "_models.ProductFamiliesRequest", + product_families_request: Union[_models.ProductFamiliesRequest, IO], expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ProductFamilies"]: + ) -> AsyncIterable["_models.ProductFamily"]: """This method provides the list of product families for the given subscription. - :param product_families_request: Filters for showing the product families. + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO type. Required. :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest + or IO :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. + details on the configurations for the product. Default value is None. :type expand: str :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. + page in the list of product families. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamilies or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamilies] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_product_families') if api_version == '2020-12-01-preview': @@ -764,6 +864,7 @@ def list_product_families( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) @@ -773,16 +874,18 @@ def list_product_families_metadata( self, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ProductFamiliesMetadata"]: + ) -> AsyncIterable["_models.ProductFamiliesMetadataDetails"]: """This method provides the list of product families metadata for the given subscription. :param skip_token: $skipToken is supported on list of product families metadata, which provides - the next page in the list of product families metadata. + the next page in the list of product families metadata. Default value is None. :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 ProductFamiliesMetadata or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadata] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: """ api_version = self._get_api_version('list_product_families_metadata') if api_version == '2020-12-01-preview': @@ -794,6 +897,7 @@ def list_product_families_metadata( mixin_instance = OperationClass() mixin_instance._client = self._client mixin_instance._config = self._config + mixin_instance._config.api_version = api_version mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._serialize.client_side_validation = False mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_edge_order_management_client_operations.py deleted file mode 100644 index 5e1473836e7d..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_edge_order_management_client_operations.py +++ /dev/null @@ -1,1937 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, 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.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EdgeOrderManagementClientOperationsMixin: - - def list_operations( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: - """This method gets all the operations that are exposed for customer. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_operations.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 = 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) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_operations.metadata = {'url': '/providers/Microsoft.EdgeOrder/operations'} # type: ignore - - def list_addresses_at_subscription_level( - self, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.AddressResourceList"]: - """Lists all the addresses available under the subscription. - - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. - :type filter: str - :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. - :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_addresses_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_addresses_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore - - def list_product_families( - self, - product_families_request: "_models.ProductFamiliesRequest", - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamilies"]: - """This method provides the list of product families for the given subscription. - - :param product_families_request: Filters for showing the product families. - :type product_families_request: ~edge_order_management_client.models.ProductFamiliesRequest - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. - :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 ProductFamilies or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.ProductFamilies] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamilies"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_product_families.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamilies', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_product_families.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies'} # type: ignore - - def list_configurations( - self, - configurations_request: "_models.ConfigurationsRequest", - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.Configurations"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. - - :param configurations_request: Filters for showing the configurations. - :type configurations_request: ~edge_order_management_client.models.ConfigurationsRequest - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. - :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 Configurations or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.Configurations] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Configurations"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_configurations.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('Configurations', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations'} # type: ignore - - def list_product_families_metadata( - self, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamiliesMetadata"]: - """This method provides the list of product families metadata for the given subscription. - - :param skip_token: $skipToken is supported on list of product families metadata, which provides - the next page in the list of product families metadata. - :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 ProductFamiliesMetadata or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.ProductFamiliesMetadata] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamiliesMetadata"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_product_families_metadata.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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.post(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamiliesMetadata', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_product_families_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata'} # type: ignore - - def list_order_at_subscription_level( - self, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderResourceList"]: - """Lists order at subscription level. - - :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. - :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_order_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_order_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders'} # type: ignore - - def list_order_items_at_subscription_level( - self, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResourceList"]: - """Lists order at subscription level. - - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. - :type filter: str - :param skip_token: $skipToken is supported on Get list of orders, which provides the next page - in the list of order. - :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_order_items_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_order_items_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore - - def list_addresses_at_resource_group_level( - self, - resource_group_name: str, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.AddressResourceList"]: - """Lists all the addresses available under the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. - :type filter: str - :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of address. - :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_addresses_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_addresses_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore - - async def get_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any - ) -> "_models.AddressResource": - """Gets information about the specified address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource, or the result of cls(response) - :rtype: ~edge_order_management_client.models.AddressResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_address_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 = 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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('AddressResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore - - async def _create_address_initial( - self, - address_name: str, - resource_group_name: str, - address_resource: "_models.AddressResource", - **kwargs: Any - ) -> Optional["_models.AddressResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(address_resource, 'AddressResource') - 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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore - - async def begin_create_address( - self, - address_name: str, - resource_group_name: str, - address_resource: "_models.AddressResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.AddressResource"]: - """Creates a new address with the specified parameters. Existing address cannot be updated with - this API and should instead be updated with the Update address API. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param address_resource: Address details from request body. - :type address_resource: ~edge_order_management_client.models.AddressResource - :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~edge_order_management_client.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - 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_address_initial( - address_name=address_name, - resource_group_name=resource_group_name, - address_resource=address_resource, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore - - async def _delete_address_by_name_initial( - self, - address_name: str, - resource_group_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-12-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_address_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 = 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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_address_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore - - async def begin_delete_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_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, 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_address_by_name_initial( - address_name=address_name, - resource_group_name=resource_group_name, - 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 = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore - - async def _update_address_initial( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: "_models.AddressUpdateParameter", - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional["_models.AddressResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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(address_update_parameter, 'AddressUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore - - async def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: "_models.AddressUpdateParameter", - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.AddressResource"]: - """Updates the properties of an existing address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. - :type address_update_parameter: ~edge_order_management_client.models.AddressUpdateParameter - :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~edge_order_management_client.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - 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_address_initial( - address_name=address_name, - resource_group_name=resource_group_name, - address_update_parameter=address_update_parameter, - if_match=if_match, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore - - def list_order_at_resource_group_level( - self, - resource_group_name: str, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderResourceList"]: - """Lists order at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. - :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_order_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_order_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders'} # type: ignore - - async def get_order_by_name( - self, - order_name: str, - resource_group_name: str, - location: str, - **kwargs: Any - ) -> "_models.OrderResource": - """Gets an order. - - :param order_name: The name of the order. - :type order_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param location: The name of Azure region. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource, or the result of cls(response) - :rtype: ~edge_order_management_client.models.OrderResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_order_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderName': self._serialize.url("order_name", order_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'location': self._serialize.url("location", location, 'str', min_length=1), - } - 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 = 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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OrderResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_order_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}'} # type: ignore - - def list_order_items_at_resource_group_level( - self, - resource_group_name: str, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResourceList"]: - """Lists order item at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. - :type filter: str - :param expand: $expand is supported on device details parameter for order item, which provides - details on the devices of the product. - :type expand: str - :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. - :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~edge_order_management_client.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - 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_order_items_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', 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]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_order_items_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore - - async def get_order_item_by_name( - self, - order_item_name: str, - resource_group_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.OrderItemResource": - """Gets an order item. - - :param order_item_name: The name of the order item. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param expand: $expand is supported on device details parameter for order item, which provides - details on the devices of the product. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource, or the result of cls(response) - :rtype: ~edge_order_management_client.models.OrderItemResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_order_item_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 = 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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OrderItemResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore - - async def _create_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: "_models.OrderItemResource", - **kwargs: Any - ) -> Optional["_models.OrderItemResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(order_item_resource, 'OrderItemResource') - 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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore - - async def begin_create_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: "_models.OrderItemResource", - **kwargs: Any - ) -> AsyncLROPoller["_models.OrderItemResource"]: - """Creates an order item. Existing order item cannot be updated with this api and should instead - be updated with the Update order item API. - - :param order_item_name: The name of the order item. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param order_item_resource: Order item details from request body. - :type order_item_resource: ~edge_order_management_client.models.OrderItemResource - :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~edge_order_management_client.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - 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_order_item_initial( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - order_item_resource=order_item_resource, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore - - async def _delete_order_item_by_name_initial( - self, - order_item_name: str, - resource_group_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-12-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_order_item_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 = 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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_order_item_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore - - async def begin_delete_order_item_by_name( - self, - order_item_name: str, - resource_group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an order item. - - :param order_item_name: The name of the order item. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_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, 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_order_item_by_name_initial( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - 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 = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore - - async def _update_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: "_models.OrderItemUpdateParameter", - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional["_models.OrderItemResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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(order_item_update_parameter, 'OrderItemUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(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.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore - - async def begin_update_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: "_models.OrderItemUpdateParameter", - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.OrderItemResource"]: - """Updates the properties of an existing order item. - - :param order_item_name: The name of the order item. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. - :type order_item_update_parameter: ~edge_order_management_client.models.OrderItemUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order 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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~edge_order_management_client.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - 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_order_item_initial( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - order_item_update_parameter=order_item_update_parameter, - if_match=if_match, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore - - async def cancel_order_item( - self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: "_models.CancellationReason", - **kwargs: Any - ) -> None: - """Cancel order item. - - :param order_item_name: The name of the order item. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. - :type cancellation_reason: ~edge_order_management_client.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', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel_order_item.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(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 [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel'} # type: ignore - - async def _return_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: "_models.ReturnOrderItemDetails", - **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-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._return_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(return_order_item_details, 'ReturnOrderItemDetails') - 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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _return_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore - - async def begin_return_order_item( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: "_models.ReturnOrderItemDetails", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. - - :param order_item_name: The name of the order item. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. - :type return_order_item_details: ~edge_order_management_client.models.ReturnOrderItemDetails - :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, 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._return_order_item_initial( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - return_order_item_details=return_order_item_details, - 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 = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_return_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/__init__.py index 6a0b62b08a4c..cf345f5e5ed1 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/__init__.py @@ -10,10 +10,17 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['EdgeOrderManagementClient'] try: - from ._patch import patch_sdk # type: ignore - patch_sdk() + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: - pass + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EdgeOrderManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_configuration.py index 1ef1c6f5917f..555ae3a0bb31 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_configuration.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_configuration.py @@ -6,66 +6,67 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import sys +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 sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential -class EdgeOrderManagementClientConfiguration(Configuration): +class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for EdgeOrderManagementClient. 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2020-12-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str """ - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) + api_version: Literal["2020-12-01-preview"] = kwargs.pop("api_version", "2020-12-01-preview") + 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(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-12-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-edgeorder/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".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') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_edge_order_management_client.py index bd6f90006bc1..61722abc6e42 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_edge_order_management_client.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_edge_order_management_client.py @@ -6,80 +6,85 @@ # 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, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer + +from . import models as _models +from .._serialization import Deserializer, Serializer +from ._configuration import EdgeOrderManagementClientConfiguration +from .operations import EdgeOrderManagementClientOperationsMixin if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import EdgeOrderManagementClientConfiguration -from .operations import EdgeOrderManagementClientOperationsMixin -from . import models -class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin): +class EdgeOrderManagementClient( + EdgeOrderManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword """The EdgeOrder Client. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :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 api_version: Api Version. Default value is "2020-12-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, - credential, # 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 = EdgeOrderManagementClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = EdgeOrderManagementClientConfiguration( + 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)} + 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 - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> 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/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - def close(self): - # type: () -> None + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> EdgeOrderManagementClient + def __enter__(self) -> "EdgeOrderManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_metadata.json b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_metadata.json index 7f66d94132f4..d0504ad2a65a 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_metadata.json +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_metadata.json @@ -5,39 +5,41 @@ "name": "EdgeOrderManagementClient", "filename": "_edge_order_management_client", "description": "The EdgeOrder 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, - "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\": [\"EdgeOrderManagementClientConfiguration\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "global_parameters": { "sync": { "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true + "required": true, + "method_location": "positional" }, "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The ID of the target subscription.", + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. Required.", "docstring_type": "str", - "required": true + "required": true, + "method_location": "positional" } }, "async": { "credential": { "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", + "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { "signature": "subscription_id: str,", - "description": "The ID of the target subscription.", + "description": "The ID of the target subscription. Required.", "docstring_type": "str", "required": true } @@ -48,22 +50,25 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "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 + "required": false, + "method_location": "positional" }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } }, "async": { @@ -71,19 +76,22 @@ "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 + "required": false, + "method_location": "positional" }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles = KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } } } @@ -91,354 +99,381 @@ "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, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"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\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "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": { }, "operation_mixins": { - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.mgmt.core.polling.arm_polling\": [\"ARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\", \"Union\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.mgmt.core.polling.async_arm_polling\": [\"AsyncARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"azurecore\": {\"azure.core.paging\": [\"ItemPaged\"], \"azure.core.polling\": [\"LROPoller\"]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"azurecore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"], \"azure.core.polling\": [\"AsyncLROPoller\"]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", "operations": { "list_operations" : { "sync": { - "signature": "def list_operations(\n self,\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OperationListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OperationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.Operation\"]:\n", + "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Operation or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Operation]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "**kwargs" }, "async": { "coroutine": false, - "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OperationListResult\"]:\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OperationListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OperationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "" + "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.Operation\"]:\n", + "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Operation or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Operation]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "**kwargs" + } }, "list_addresses_at_subscription_level" : { "sync": { - "signature": "def list_addresses_at_subscription_level(\n self,\n filter=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.AddressResource\"]:\n", + "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "filter, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.AddressResourceList\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "filter, skip_token" + "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.AddressResource\"]:\n", + "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "filter, skip_token, **kwargs" + } }, "list_product_families" : { "sync": { - "signature": "def list_product_families(\n self,\n product_families_request, # type: \"_models.ProductFamiliesRequest\"\n expand=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families.\n:type product_families_request: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamilies or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamilies]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_product_families(\n self,\n product_families_request: Union[_models.ProductFamiliesRequest, IO],\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ProductFamily\"]:\n", + "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families. Is either a\n ProductFamiliesRequest type or a IO type. Required.\n:type product_families_request:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest or IO\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product. Default value is None.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamily or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "product_families_request, expand, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_product_families(\n self,\n product_families_request: \"_models.ProductFamiliesRequest\",\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ProductFamilies\"]:\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families.\n:type product_families_request: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamilies or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamilies]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "product_families_request, expand, skip_token" + "signature": "def list_product_families(\n self,\n product_families_request: Union[_models.ProductFamiliesRequest, IO],\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ProductFamily\"]:\n", + "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families. Is either a\n ProductFamiliesRequest type or a IO type. Required.\n:type product_families_request:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest or IO\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product. Default value is None.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamily or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "product_families_request, expand, skip_token, **kwargs" + } }, "list_configurations" : { "sync": { - "signature": "def list_configurations(\n self,\n configurations_request, # type: \"_models.ConfigurationsRequest\"\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations.\n:type configurations_request: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configurations or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configurations]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_configurations(\n self,\n configurations_request: Union[_models.ConfigurationsRequest, IO],\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.Configuration\"]:\n", + "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations. Is either a\n ConfigurationsRequest type or a IO type. Required.\n:type configurations_request:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest or IO\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configuration or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "configurations_request, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_configurations(\n self,\n configurations_request: \"_models.ConfigurationsRequest\",\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.Configurations\"]:\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations.\n:type configurations_request: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configurations or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configurations]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "configurations_request, skip_token" + "signature": "def list_configurations(\n self,\n configurations_request: Union[_models.ConfigurationsRequest, IO],\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.Configuration\"]:\n", + "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations. Is either a\n ConfigurationsRequest type or a IO type. Required.\n:type configurations_request:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest or IO\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configuration or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "configurations_request, skip_token, **kwargs" + } }, "list_product_families_metadata" : { "sync": { - "signature": "def list_product_families_metadata(\n self,\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadata or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadata]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ProductFamiliesMetadataDetails\"]:\n", + "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of\n cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ProductFamiliesMetadata\"]:\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadata or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadata]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "skip_token" + "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ProductFamiliesMetadataDetails\"]:\n", + "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of\n cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "skip_token, **kwargs" + } }, "list_order_at_subscription_level" : { "sync": { - "signature": "def list_order_at_subscription_level(\n self,\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderResource\"]:\n", + "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderResourceList\"]:\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "skip_token" + "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderResource\"]:\n", + "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "skip_token, **kwargs" + } }, "list_order_items_at_subscription_level" : { "sync": { - "signature": "def list_order_items_at_subscription_level(\n self,\n filter=None, # type: Optional[str]\n expand=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderItemResource\"]:\n", + "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "filter, expand, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderItemResourceList\"]:\n", - "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "filter, expand, skip_token" + "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderItemResource\"]:\n", + "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "filter, expand, skip_token, **kwargs" + } }, "list_addresses_at_resource_group_level" : { "sync": { - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name, # type: str\n filter=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.AddressResource\"]:\n", + "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, filter, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.AddressResourceList\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "resource_group_name, filter, skip_token" + "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.AddressResource\"]:\n", + "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, filter, skip_token, **kwargs" + } }, "get_address_by_name" : { "sync": { - "signature": "def get_address_by_name(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e _models.AddressResource:\n", + "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, - "signature": "async def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e \"_models.AddressResource\":\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "address_name, resource_group_name" + "signature": "async def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e _models.AddressResource:\n", + "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, **kwargs" + } }, "_create_address_initial" : { "sync": { - "signature": "def _create_address_initial(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_resource, # type: \"_models.AddressResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", + "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_resource, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: \"_models.AddressResource\",\n **kwargs: Any\n) -\u003e Optional[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_resource" + "signature": "async def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", + "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_resource, **kwargs" + } }, "begin_create_address" : { "sync": { - "signature": "def begin_create_address(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_resource, # type: \"_models.AddressResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e LROPoller[_models.AddressResource]:\n", + "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_resource, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: \"_models.AddressResource\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_resource" + "signature": "async def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.AddressResource]:\n", + "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_resource, **kwargs" + } }, "_delete_address_by_name_initial" : { "sync": { - "signature": "def _delete_address_by_name_initial(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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\"\"\"" + "signature": "def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\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": "address_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _delete_address_by_name_initial(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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": "address_name, resource_group_name" + "signature": "async def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\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": "address_name, resource_group_name, **kwargs" + } }, "begin_delete_address_by_name" : { "sync": { - "signature": "def begin_delete_address_by_name(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_delete_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", + "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, "signature": "async def begin_delete_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "address_name, resource_group_name" + "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, **kwargs" + } }, "_update_address_initial" : { "sync": { - "signature": "def _update_address_initial(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_update_parameter, # type: \"_models.AddressUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", + "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: \"_models.AddressUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_update_parameter, if_match" + "signature": "async def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", + "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" + } }, "begin_update_address" : { "sync": { - "signature": "def begin_update_address(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_update_parameter, # type: \"_models.AddressUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[_models.AddressResource]:\n", + "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: \"_models.AddressUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_update_parameter, if_match" + "signature": "async def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.AddressResource]:\n", + "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" + } }, "list_order_at_resource_group_level" : { "sync": { - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name, # type: str\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderResource\"]:\n", + "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderResourceList\"]:\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "resource_group_name, skip_token" + "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderResource\"]:\n", + "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, skip_token, **kwargs" + } }, "get_order_by_name" : { "sync": { - "signature": "def get_order_by_name(\n self,\n order_name, # type: str\n resource_group_name, # type: str\n location, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param location: The name of Azure region.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e _models.OrderResource:\n", + "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order. Required.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param location: The name of Azure region. Required.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_name, resource_group_name, location, **kwargs" }, "async": { "coroutine": true, - "signature": "async def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e \"_models.OrderResource\":\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param location: The name of Azure region.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_name, resource_group_name, location" + "signature": "async def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e _models.OrderResource:\n", + "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order. Required.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param location: The name of Azure region. Required.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_name, resource_group_name, location, **kwargs" + } }, "list_order_items_at_resource_group_level" : { "sync": { - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name, # type: str\n filter=None, # type: Optional[str]\n expand=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderItemResource\"]:\n", + "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, filter, expand, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderItemResourceList\"]:\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "resource_group_name, filter, expand, skip_token" + "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderItemResource\"]:\n", + "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, filter, expand, skip_token, **kwargs" + } }, "get_order_item_by_name" : { "sync": { - "signature": "def get_order_item_by_name(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n expand=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e _models.OrderItemResource:\n", + "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, expand, **kwargs" }, "async": { "coroutine": true, - "signature": "async def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.OrderItemResource\":\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, expand" + "signature": "async def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e _models.OrderItemResource:\n", + "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, expand, **kwargs" + } }, "_create_order_item_initial" : { "sync": { - "signature": "def _create_order_item_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_resource, # type: \"_models.OrderItemResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", + "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: \"_models.OrderItemResource\",\n **kwargs: Any\n) -\u003e Optional[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_resource" + "signature": "async def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", + "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" + } }, "begin_create_order_item" : { "sync": { - "signature": "def begin_create_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_resource, # type: \"_models.OrderItemResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e LROPoller[_models.OrderItemResource]:\n", + "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: \"_models.OrderItemResource\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_resource" + "signature": "async def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.OrderItemResource]:\n", + "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" + } }, "_delete_order_item_by_name_initial" : { "sync": { - "signature": "def _delete_order_item_by_name_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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\"\"\"" + "signature": "def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\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": "order_item_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _delete_order_item_by_name_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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": "order_item_name, resource_group_name" + "signature": "async def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\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": "order_item_name, resource_group_name, **kwargs" + } }, "begin_delete_order_item_by_name" : { "sync": { - "signature": "def begin_delete_order_item_by_name(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_delete_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", + "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, "signature": "async def begin_delete_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name" + "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, **kwargs" + } }, "_update_order_item_initial" : { "sync": { - "signature": "def _update_order_item_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_update_parameter, # type: \"_models.OrderItemUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", + "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: \"_models.OrderItemUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match" + "signature": "async def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", + "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" + } }, "begin_update_order_item" : { "sync": { - "signature": "def begin_update_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_update_parameter, # type: \"_models.OrderItemUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[_models.OrderItemResource]:\n", + "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: \"_models.OrderItemUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match" + "signature": "async def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.OrderItemResource]:\n", + "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" + } }, "cancel_order_item" : { "sync": { - "signature": "def cancel_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n cancellation_reason, # type: \"_models.CancellationReason\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason\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\"\"\"" + "signature": "def cancel_order_item( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: Union[_models.CancellationReason, IO],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a\n IO type. Required.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\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": "order_item_name, resource_group_name, cancellation_reason, **kwargs" }, "async": { "coroutine": true, - "signature": "async def cancel_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: \"_models.CancellationReason\",\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason\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": "order_item_name, resource_group_name, cancellation_reason" + "signature": "async def cancel_order_item( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: Union[_models.CancellationReason, IO],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a\n IO type. Required.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\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": "order_item_name, resource_group_name, cancellation_reason, **kwargs" + } }, "_return_order_item_initial" : { "sync": { - "signature": "def _return_order_item_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n return_order_item_details, # type: \"_models.ReturnOrderItemDetails\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails\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\"\"\"" + "signature": "def _return_order_item_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\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": "order_item_name, resource_group_name, return_order_item_details, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _return_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: \"_models.ReturnOrderItemDetails\",\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails\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": "order_item_name, resource_group_name, return_order_item_details" + "signature": "async def _return_order_item_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\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": "order_item_name, resource_group_name, return_order_item_details, **kwargs" + } }, "begin_return_order_item" : { "sync": { - "signature": "def begin_return_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n return_order_item_details, # type: \"_models.ReturnOrderItemDetails\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", + "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: \"_models.ReturnOrderItemDetails\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, return_order_item_details" + "signature": "async def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" + } } } } -} \ No newline at end of file +} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_vendor.py new file mode 100644 index 000000000000..7f8e08518951 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_vendor.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------- +# 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 abc import ABC +from typing import List, TYPE_CHECKING, cast + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import EdgeOrderManagementClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import PipelineClient + + from .._serialization import Deserializer, Serializer + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) + + +class EdgeOrderManagementClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: EdgeOrderManagementClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_version.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_version.py index c47f66669f1b..e5754a47ce68 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_version.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/__init__.py index b8c98d8145e8..b9eec9b0ea44 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/__init__.py @@ -7,4 +7,17 @@ # -------------------------------------------------------------------------- from ._edge_order_management_client import EdgeOrderManagementClient -__all__ = ['EdgeOrderManagementClient'] + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EdgeOrderManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_configuration.py index 4a36ece13ef1..bf2580b269e9 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_configuration.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_configuration.py @@ -6,62 +6,67 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys 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 sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class EdgeOrderManagementClientConfiguration(Configuration): +class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for EdgeOrderManagementClient. 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2020-12-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str """ - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) + api_version: Literal["2020-12-01-preview"] = kwargs.pop("api_version", "2020-12-01-preview") + 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(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-12-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-edgeorder/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".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') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_edge_order_management_client.py index 5c0a179b3789..abf5d0cdf469 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_edge_order_management_client.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_edge_order_management_client.py @@ -6,66 +6,78 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer + +from .. import models as _models +from ..._serialization import Deserializer, Serializer +from ._configuration import EdgeOrderManagementClientConfiguration +from .operations import EdgeOrderManagementClientOperationsMixin if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import EdgeOrderManagementClientConfiguration -from .operations import EdgeOrderManagementClientOperationsMixin -from .. import models - -class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin): +class EdgeOrderManagementClient( + EdgeOrderManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword """The EdgeOrder Client. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :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 api_version: Api Version. Default value is "2020-12-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: 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 = EdgeOrderManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = EdgeOrderManagementClientConfiguration( + 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)} + 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 - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> 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/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + 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() @@ -74,5 +86,5 @@ async def __aenter__(self) -> "EdgeOrderManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_vendor.py new file mode 100644 index 000000000000..0c61995427f8 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# 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 abc import ABC +from typing import TYPE_CHECKING + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import EdgeOrderManagementClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import AsyncPipelineClient + + from ..._serialization import Deserializer, Serializer + + +class EdgeOrderManagementClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: EdgeOrderManagementClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/__init__.py index 6003776a8eee..9e856f64458f 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/__init__.py @@ -8,6 +8,12 @@ from ._edge_order_management_client_operations import EdgeOrderManagementClientOperationsMixin +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'EdgeOrderManagementClientOperationsMixin', + "EdgeOrderManagementClientOperationsMixin", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_edge_order_management_client_operations.py index 589dd33a42f4..0f10a5bb5943 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_edge_order_management_client_operations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_edge_order_management_client_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,1236 +6,1822 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, 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.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - -T = TypeVar('T') +from ..._vendor import _convert_request +from ...operations._edge_order_management_client_operations import ( + build_cancel_order_item_request, + build_create_address_request, + build_create_order_item_request, + build_delete_address_by_name_request, + build_delete_order_item_by_name_request, + build_get_address_by_name_request, + build_get_order_by_name_request, + build_get_order_item_by_name_request, + build_list_addresses_at_resource_group_level_request, + build_list_addresses_at_subscription_level_request, + build_list_configurations_request, + build_list_operations_request, + build_list_order_at_resource_group_level_request, + build_list_order_at_subscription_level_request, + build_list_order_items_at_resource_group_level_request, + build_list_order_items_at_subscription_level_request, + build_list_product_families_metadata_request, + build_list_product_families_request, + build_return_order_item_request, + build_update_address_request, + build_update_order_item_request, +) +from .._vendor import EdgeOrderManagementClientMixinABC + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class EdgeOrderManagementClientOperationsMixin: - def list_operations( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: +class EdgeOrderManagementClientOperationsMixin( + EdgeOrderManagementClientMixinABC +): # pylint: disable=too-many-public-methods + @distributed_trace + def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """This method gets all the operations that are exposed for customer. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_operations.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 = self._client.get(url, query_parameters, header_parameters) + request = build_list_operations_request( + api_version=api_version, + template_url=self.list_operations.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_operations.metadata = {'url': '/providers/Microsoft.EdgeOrder/operations'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_operations.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} + @distributed_trace def list_addresses_at_subscription_level( - self, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.AddressResourceList"]: + self, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.AddressResource"]: """Lists all the addresses available under the subscription. :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. + page in the list of addresses. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_addresses_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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_addresses_at_subscription_level_request( + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_addresses_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', pipeline_response) + deserialized = self._deserialize("AddressResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_addresses_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_addresses_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses" + } + + @overload + def list_product_families( + self, + product_families_request: _models.ProductFamiliesRequest, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.ProductFamily"]: + """This method provides the list of product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_product_families( + self, + product_families_request: IO, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.ProductFamily"]: + """This method provides the list of product families for the given subscription. + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: IO + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace def list_product_families( self, - product_families_request: "_models.ProductFamiliesRequest", + product_families_request: Union[_models.ProductFamiliesRequest, IO], expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.ProductFamilies"]: + ) -> AsyncIterable["_models.ProductFamily"]: """This method provides the list of product families for the given subscription. - :param product_families_request: Filters for showing the product families. - :type product_families_request: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO type. Required. + :type product_families_request: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest or IO :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. + details on the configurations for the product. Default value is None. :type expand: str :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. + page in the list of product families. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamilies or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamilies] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamilies"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = "application/json" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(product_families_request, (IO, bytes)): + _content = product_families_request + else: + _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") 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_product_families.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + request = build_list_product_families_request( + subscription_id=self._config.subscription_id, + expand=expand, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_product_families.metadata["url"], + headers=_headers, + params=_params, + ) + 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(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamilies', pipeline_response) + deserialized = self._deserialize("ProductFamilies", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_product_families.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_product_families.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" + } + + @overload + def list_configurations( + self, + configurations_request: _models.ConfigurationsRequest, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.Configuration"]: + """This method provides the list of configurations for the given product family, product line and + product under subscription. + + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload def list_configurations( self, - configurations_request: "_models.ConfigurationsRequest", + configurations_request: IO, skip_token: Optional[str] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable["_models.Configurations"]: + ) -> AsyncIterable["_models.Configuration"]: """This method provides the list of configurations for the given product family, product line and product under subscription. - :param configurations_request: Filters for showing the configurations. - :type configurations_request: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: IO :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. + page in the list of configurations. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configurations or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configurations] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_configurations( + self, + configurations_request: Union[_models.ConfigurationsRequest, IO], + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.Configuration"]: + """This method provides the list of configurations for the given product family, product line and + product under subscription. + + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO type. Required. + :type configurations_request: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest or IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Configurations"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = "application/json" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configurations_request, (IO, bytes)): + _content = configurations_request + else: + _json = self._serialize.body(configurations_request, "ConfigurationsRequest") 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_configurations.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + request = build_list_configurations_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_configurations.metadata["url"], + headers=_headers, + params=_params, + ) + 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(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('Configurations', pipeline_response) + deserialized = self._deserialize("Configurations", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_configurations.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" + } + @distributed_trace def list_product_families_metadata( - self, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamiliesMetadata"]: + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.ProductFamiliesMetadataDetails"]: """This method provides the list of product families metadata for the given subscription. :param skip_token: $skipToken is supported on list of product families metadata, which provides - the next page in the list of product families metadata. + the next page in the list of product families metadata. Default value is None. :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 ProductFamiliesMetadata or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadata] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamiliesMetadata"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_product_families_metadata.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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.post(url, query_parameters, header_parameters) + + request = build_list_product_families_metadata_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_product_families_metadata.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamiliesMetadata', pipeline_response) + deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_product_families_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_product_families_metadata.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" + } + + @distributed_trace def list_order_at_subscription_level( - self, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderResourceList"]: + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.OrderResource"]: """Lists order at subscription level. :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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_order_at_subscription_level_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', pipeline_response) + deserialized = self._deserialize("OrderResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_order_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_order_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders" + } + @distributed_trace def list_order_items_at_subscription_level( self, filter: Optional[str] = None, expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResourceList"]: + ) -> AsyncIterable["_models.OrderItemResource"]: """Lists order item at subscription level. :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_items_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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_order_items_at_subscription_level_request( + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_items_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', pipeline_response) + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_order_items_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_order_items_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems" + } + @distributed_trace def list_addresses_at_resource_group_level( - self, - resource_group_name: str, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.AddressResourceList"]: + self, resource_group_name: str, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.AddressResource"]: """Lists all the addresses available under the given resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of address. + page in the list of address. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_addresses_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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_addresses_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_addresses_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', pipeline_response) + deserialized = self._deserialize("AddressResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_addresses_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_addresses_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" + } + + @distributed_trace_async async def get_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any - ) -> "_models.AddressResource": + self, address_name: str, resource_group_name: str, **kwargs: Any + ) -> _models.AddressResource: """Gets information about the specified address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource, or the result of cls(response) + :return: AddressResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_address_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + + request = build_get_address_by_name_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_address_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + + get_address_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } async def _create_address_initial( self, address_name: str, resource_group_name: str, - address_resource: "_models.AddressResource", + address_resource: Union[_models.AddressResource, IO], **kwargs: Any - ) -> Optional["_models.AddressResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] + ) -> Optional[_models.AddressResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(address_resource, 'AddressResource') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_resource, (IO, bytes)): + _content = address_resource + else: + _json = self._serialize.body(address_resource, "AddressResource") + + request = build_create_address_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_address_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _create_address_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload async def begin_create_address( self, address_name: str, resource_group_name: str, - address_resource: "_models.AddressResource", + address_resource: _models.AddressResource, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller["_models.AddressResource"]: + ) -> AsyncLROPoller[_models.AddressResource]: """Creates a new address with the specified parameters. Existing address cannot be updated with this API and should instead be updated with the Update address API. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_resource: Address details from request body. + :param address_resource: Address details from request body. Required. :type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_address( + self, + address_name: str, + resource_group_name: str, + address_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Creates a new address with the specified parameters. Existing address cannot be updated with + this API and should instead be updated with the Update address API. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_resource: Address details from request body. Required. + :type address_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_address( + self, + address_name: str, + resource_group_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Creates a new address with the specified parameters. Existing address cannot be updated with + this API and should instead be updated with the Update address API. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_resource: Address details from request body. Is either a AddressResource type or + a IO type. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_address_initial( address_name=address_name, resource_group_name=resource_group_name, address_resource=address_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) - + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _delete_address_by_name_initial( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any + begin_create_address.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + async def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements + self, address_name: str, resource_group_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_address_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_address_by_name_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_address_by_name_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_address_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _delete_address_by_name_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + @distributed_trace_async async def begin_delete_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any + self, address_name: str, resource_group_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes an address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_address_by_name_initial( + raw_result = await self._delete_address_by_name_initial( # type: ignore address_name=address_name, resource_group_name=resource_group_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete_address_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } async def _update_address_initial( self, address_name: str, resource_group_name: str, - address_update_parameter: "_models.AddressUpdateParameter", + address_update_parameter: Union[_models.AddressUpdateParameter, IO], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional["_models.AddressResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] + ) -> Optional[_models.AddressResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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(address_update_parameter, 'AddressUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_update_parameter, (IO, bytes)): + _content = address_update_parameter + else: + _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") + + request = build_update_address_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_address_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _update_address_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload async def begin_update_address( self, address_name: str, resource_group_name: str, - address_update_parameter: "_models.AddressUpdateParameter", + address_update_parameter: _models.AddressUpdateParameter, if_match: Optional[str] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller["_models.AddressResource"]: + ) -> AsyncLROPoller[_models.AddressResource]: """Updates the properties of an existing address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. - :type address_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter :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. + of the job on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - 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_address_initial( + + @overload + async def begin_update_address( + self, + address_name: str, + resource_group_name: str, + address_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Updates the properties of an existing address. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_address( + self, + address_name: str, + resource_group_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Updates the properties of an existing address. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_update_parameter: Address update parameters from request body. Is either a + AddressUpdateParameter type or a IO type. Required. + :type address_update_parameter: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_address_initial( address_name=address_name, resource_group_name=resource_group_name, address_update_parameter=address_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) - + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + begin_update_address.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @distributed_trace def list_order_at_resource_group_level( - self, - resource_group_name: str, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderResourceList"]: + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.OrderResource"]: """Lists order at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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_order_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', pipeline_response) + deserialized = self._deserialize("OrderResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_order_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_order_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" + } + @distributed_trace_async async def get_order_by_name( - self, - order_name: str, - resource_group_name: str, - location: str, - **kwargs: Any - ) -> "_models.OrderResource": + self, order_name: str, resource_group_name: str, location: str, **kwargs: Any + ) -> _models.OrderResource: """Gets an order. - :param order_name: The name of the order. + :param order_name: The name of the order. Required. :type order_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param location: The name of Azure region. + :param location: The name of Azure region. Required. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource, or the result of cls(response) + :return: OrderResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_order_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderName': self._serialize.url("order_name", order_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'location': self._serialize.url("location", location, 'str', min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) + + request = build_get_order_by_name_request( + order_name=order_name, + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_order_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('OrderResource', pipeline_response) + deserialized = self._deserialize("OrderResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_order_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}'} # type: ignore + get_order_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" + } + + @distributed_trace def list_order_items_at_resource_group_level( self, resource_group_name: str, @@ -1242,708 +1829,1135 @@ def list_order_items_at_resource_group_level( expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResourceList"]: + ) -> AsyncIterable["_models.OrderItemResource"]: """Lists order item at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_items_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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_order_items_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_items_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', pipeline_response) + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_order_items_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_order_items_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" + } + @distributed_trace_async async def get_order_item_by_name( - self, - order_item_name: str, - resource_group_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.OrderItemResource": + self, order_item_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> _models.OrderItemResource: """Gets an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource, or the result of cls(response) + :return: OrderItemResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_order_item_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) - # 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') + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + + request = build_get_order_item_by_name_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + template_url=self.get_order_item_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + + get_order_item_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } async def _create_order_item_initial( self, order_item_name: str, resource_group_name: str, - order_item_resource: "_models.OrderItemResource", + order_item_resource: Union[_models.OrderItemResource, IO], **kwargs: Any - ) -> Optional["_models.OrderItemResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] + ) -> Optional[_models.OrderItemResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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['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(order_item_resource, 'OrderItemResource') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_resource, (IO, bytes)): + _content = order_item_resource + else: + _json = self._serialize.body(order_item_resource, "OrderItemResource") + + request = build_create_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _create_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload async def begin_create_order_item( self, order_item_name: str, resource_group_name: str, - order_item_resource: "_models.OrderItemResource", + order_item_resource: _models.OrderItemResource, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller["_models.OrderItemResource"]: + ) -> AsyncLROPoller[_models.OrderItemResource]: """Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_resource: Order item details from request body. + :param order_item_resource: Order item details from request body. Required. :type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + + @overload + async def begin_create_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Creates an order item. Existing order item cannot be updated with this api and should instead + be updated with the Update order item API. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_resource: Order item details from request body. Required. + :type order_item_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Creates an order item. Existing order item cannot be updated with this api and should instead + be updated with the Update order item API. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_resource: Order item details from request body. Is either a OrderItemResource + type or a IO type. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_order_item_initial( order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_resource=order_item_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _delete_order_item_by_name_initial( - self, - order_item_name: str, - resource_group_name: str, - **kwargs: Any + begin_create_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + async def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements + self, order_item_name: str, resource_group_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_order_item_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_order_item_by_name_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_order_item_by_name_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_order_item_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _delete_order_item_by_name_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + @distributed_trace_async async def begin_delete_order_item_by_name( - self, - order_item_name: str, - resource_group_name: str, - **kwargs: Any + self, order_item_name: str, resource_group_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_order_item_by_name_initial( + raw_result = await self._delete_order_item_by_name_initial( # type: ignore order_item_name=order_item_name, resource_group_name=resource_group_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete_order_item_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } async def _update_order_item_initial( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: "_models.OrderItemUpdateParameter", + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional["_models.OrderItemResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] + ) -> Optional[_models.OrderItemResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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(order_item_update_parameter, 'OrderItemUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_update_parameter, (IO, bytes)): + _content = order_item_update_parameter + else: + _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") + + request = build_update_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _update_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload async def begin_update_order_item( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: "_models.OrderItemUpdateParameter", + order_item_update_parameter: _models.OrderItemUpdateParameter, if_match: Optional[str] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller["_models.OrderItemResource"]: + ) -> AsyncLROPoller[_models.OrderItemResource]: """Updates the properties of an existing order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. - :type order_item_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter + :param order_item_update_parameter: order item update parameters from request body. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. + of the order on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + + @overload + async def begin_update_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Updates the properties of an existing order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_update_parameter: order item update parameters from request body. Required. + :type order_item_update_parameter: IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Updates the properties of an existing order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_update_parameter: order item update parameters from request body. Is either a + OrderItemUpdateParameter type or a IO type. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._update_order_item_initial( order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_update_parameter=order_item_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + async def cancel_order_item( # pylint: disable=inconsistent-return-statements + self, + order_item_name: str, + resource_group_name: str, + cancellation_reason: _models.CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Cancel order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ - async def cancel_order_item( + @overload + async def cancel_order_item( # pylint: disable=inconsistent-return-statements self, order_item_name: str, resource_group_name: str, - cancellation_reason: "_models.CancellationReason", + cancellation_reason: IO, + *, + content_type: str = "application/json", **kwargs: Any ) -> None: """Cancel order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def cancel_order_item( # pylint: disable=inconsistent-return-statements + self, + order_item_name: str, + resource_group_name: str, + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any + ) -> None: + """Cancel order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO type. Required. :type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :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', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel_order_item.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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['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(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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cancellation_reason, (IO, bytes)): + _content = cancellation_reason + else: + _json = self._serialize.body(cancellation_reason, "CancellationReason") + + request = build_cancel_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.cancel_order_item.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - cancel_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel'} # type: ignore + cancel_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" + } - async def _return_order_item_initial( + async def _return_order_item_initial( # pylint: disable=inconsistent-return-statements self, order_item_name: str, resource_group_name: str, - return_order_item_details: "_models.ReturnOrderItemDetails", + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._return_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(return_order_item_details, 'ReturnOrderItemDetails') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(return_order_item_details, (IO, bytes)): + _content = return_order_item_details + else: + _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") + + request = build_return_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._return_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _return_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore + _return_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } + @overload async def begin_return_order_item( self, order_item_name: str, resource_group_name: str, - return_order_item_details: "_models.ReturnOrderItemDetails", + return_order_item_details: _models.ReturnOrderItemDetails, + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: """Return order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. - :type return_order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails + :param return_order_item_details: Return order item CurrentStatus. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + + @overload + async def begin_return_order_item( + self, + order_item_name: str, + resource_group_name: str, + return_order_item_details: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Return order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param return_order_item_details: Return order item CurrentStatus. Required. + :type return_order_item_details: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + + @distributed_trace_async + async def begin_return_order_item( + self, + order_item_name: str, + resource_group_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Return order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param return_order_item_details: Return order item CurrentStatus. Is either a + ReturnOrderItemDetails type or a IO type. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._return_order_item_initial( + raw_result = await self._return_order_item_initial( # type: ignore order_item_name=order_item_name, resource_group_name=resource_group_name, return_order_item_details=return_order_item_details, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_return_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_return_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/__init__.py index 67915606ae5b..4097a6229f63 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/__init__.py @@ -6,272 +6,202 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AddressDetails - from ._models_py3 import AddressProperties - from ._models_py3 import AddressResource - from ._models_py3 import AddressResourceList - from ._models_py3 import AddressUpdateParameter - from ._models_py3 import AvailabilityInformation - from ._models_py3 import BasicInformation - from ._models_py3 import BillingMeterDetails - from ._models_py3 import CancellationReason - from ._models_py3 import CommonProperties - from ._models_py3 import Configuration - from ._models_py3 import ConfigurationFilters - from ._models_py3 import ConfigurationProperties - from ._models_py3 import Configurations - from ._models_py3 import ConfigurationsRequest - from ._models_py3 import ContactDetails - from ._models_py3 import CostInformation - from ._models_py3 import CustomerSubscriptionDetails - from ._models_py3 import CustomerSubscriptionRegisteredFeatures - from ._models_py3 import Description - from ._models_py3 import DeviceDetails - from ._models_py3 import Dimensions - from ._models_py3 import DisplayInfo - from ._models_py3 import EncryptionPreferences - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import FilterableProperty - from ._models_py3 import ForwardShippingDetails - from ._models_py3 import HierarchyInformation - from ._models_py3 import ImageInformation - from ._models_py3 import Link - from ._models_py3 import ManagementResourcePreferences - from ._models_py3 import MeterDetails - from ._models_py3 import NotificationPreference - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import OrderItemDetails - from ._models_py3 import OrderItemResource - from ._models_py3 import OrderItemResourceList - from ._models_py3 import OrderItemUpdateParameter - from ._models_py3 import OrderResource - from ._models_py3 import OrderResourceList - from ._models_py3 import Pav2MeterDetails - from ._models_py3 import Preferences - from ._models_py3 import Product - from ._models_py3 import ProductDetails - from ._models_py3 import ProductFamilies - from ._models_py3 import ProductFamiliesMetadata - from ._models_py3 import ProductFamiliesMetadataDetails - from ._models_py3 import ProductFamiliesRequest - from ._models_py3 import ProductFamily - from ._models_py3 import ProductFamilyProperties - from ._models_py3 import ProductLine - from ._models_py3 import ProductLineProperties - from ._models_py3 import ProductProperties - from ._models_py3 import ProxyResource - from ._models_py3 import PurchaseMeterDetails - from ._models_py3 import Resource - from ._models_py3 import ResourceIdentity - from ._models_py3 import ResourceProviderDetails - from ._models_py3 import ReturnOrderItemDetails - from ._models_py3 import ReverseShippingDetails - from ._models_py3 import ShippingAddress - from ._models_py3 import ShippingDetails - from ._models_py3 import Specification - from ._models_py3 import StageDetails - from ._models_py3 import SystemData - from ._models_py3 import TrackedResource - from ._models_py3 import TransportPreferences -except (SyntaxError, ImportError): - from ._models import AddressDetails # type: ignore - from ._models import AddressProperties # type: ignore - from ._models import AddressResource # type: ignore - from ._models import AddressResourceList # type: ignore - from ._models import AddressUpdateParameter # type: ignore - from ._models import AvailabilityInformation # type: ignore - from ._models import BasicInformation # type: ignore - from ._models import BillingMeterDetails # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import CommonProperties # type: ignore - from ._models import Configuration # type: ignore - from ._models import ConfigurationFilters # type: ignore - from ._models import ConfigurationProperties # type: ignore - from ._models import Configurations # type: ignore - from ._models import ConfigurationsRequest # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CostInformation # type: ignore - from ._models import CustomerSubscriptionDetails # type: ignore - from ._models import CustomerSubscriptionRegisteredFeatures # type: ignore - from ._models import Description # type: ignore - from ._models import DeviceDetails # type: ignore - from ._models import Dimensions # type: ignore - from ._models import DisplayInfo # type: ignore - from ._models import EncryptionPreferences # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import FilterableProperty # type: ignore - from ._models import ForwardShippingDetails # type: ignore - from ._models import HierarchyInformation # type: ignore - from ._models import ImageInformation # type: ignore - from ._models import Link # type: ignore - from ._models import ManagementResourcePreferences # type: ignore - from ._models import MeterDetails # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OrderItemDetails # type: ignore - from ._models import OrderItemResource # type: ignore - from ._models import OrderItemResourceList # type: ignore - from ._models import OrderItemUpdateParameter # type: ignore - from ._models import OrderResource # type: ignore - from ._models import OrderResourceList # type: ignore - from ._models import Pav2MeterDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import Product # type: ignore - from ._models import ProductDetails # type: ignore - from ._models import ProductFamilies # type: ignore - from ._models import ProductFamiliesMetadata # type: ignore - from ._models import ProductFamiliesMetadataDetails # type: ignore - from ._models import ProductFamiliesRequest # type: ignore - from ._models import ProductFamily # type: ignore - from ._models import ProductFamilyProperties # type: ignore - from ._models import ProductLine # type: ignore - from ._models import ProductLineProperties # type: ignore - from ._models import ProductProperties # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import PurchaseMeterDetails # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceIdentity # type: ignore - from ._models import ResourceProviderDetails # type: ignore - from ._models import ReturnOrderItemDetails # type: ignore - from ._models import ReverseShippingDetails # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import ShippingDetails # type: ignore - from ._models import Specification # type: ignore - from ._models import StageDetails # type: ignore - from ._models import SystemData # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import TransportPreferences # type: ignore +from ._models_py3 import AddressDetails +from ._models_py3 import AddressProperties +from ._models_py3 import AddressResource +from ._models_py3 import AddressResourceList +from ._models_py3 import AddressUpdateParameter +from ._models_py3 import AvailabilityInformation +from ._models_py3 import BasicInformation +from ._models_py3 import BillingMeterDetails +from ._models_py3 import CancellationReason +from ._models_py3 import CommonProperties +from ._models_py3 import Configuration +from ._models_py3 import ConfigurationFilters +from ._models_py3 import ConfigurationProperties +from ._models_py3 import Configurations +from ._models_py3 import ConfigurationsRequest +from ._models_py3 import ContactDetails +from ._models_py3 import CostInformation +from ._models_py3 import CustomerSubscriptionDetails +from ._models_py3 import CustomerSubscriptionRegisteredFeatures +from ._models_py3 import Description +from ._models_py3 import DeviceDetails +from ._models_py3 import Dimensions +from ._models_py3 import DisplayInfo +from ._models_py3 import EncryptionPreferences +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import FilterableProperty +from ._models_py3 import ForwardShippingDetails +from ._models_py3 import HierarchyInformation +from ._models_py3 import ImageInformation +from ._models_py3 import Link +from ._models_py3 import ManagementResourcePreferences +from ._models_py3 import MeterDetails +from ._models_py3 import NotificationPreference +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import OrderItemDetails +from ._models_py3 import OrderItemResource +from ._models_py3 import OrderItemResourceList +from ._models_py3 import OrderItemUpdateParameter +from ._models_py3 import OrderResource +from ._models_py3 import OrderResourceList +from ._models_py3 import Pav2MeterDetails +from ._models_py3 import Preferences +from ._models_py3 import Product +from ._models_py3 import ProductDetails +from ._models_py3 import ProductFamilies +from ._models_py3 import ProductFamiliesMetadata +from ._models_py3 import ProductFamiliesMetadataDetails +from ._models_py3 import ProductFamiliesRequest +from ._models_py3 import ProductFamily +from ._models_py3 import ProductFamilyProperties +from ._models_py3 import ProductLine +from ._models_py3 import ProductLineProperties +from ._models_py3 import ProductProperties +from ._models_py3 import ProxyResource +from ._models_py3 import PurchaseMeterDetails +from ._models_py3 import Resource +from ._models_py3 import ResourceIdentity +from ._models_py3 import ResourceProviderDetails +from ._models_py3 import ReturnOrderItemDetails +from ._models_py3 import ReverseShippingDetails +from ._models_py3 import ShippingAddress +from ._models_py3 import ShippingDetails +from ._models_py3 import Specification +from ._models_py3 import StageDetails +from ._models_py3 import SystemData +from ._models_py3 import TrackedResource +from ._models_py3 import TransportPreferences -from ._edge_order_management_client_enums import ( - ActionStatusEnum, - ActionType, - AddressType, - AvailabilityStage, - BillingType, - ChargingType, - CreatedByType, - DescriptionType, - DisabledReason, - DoubleEncryptionStatus, - ImageType, - LengthHeightUnit, - LinkType, - MeteringType, - NotificationStageName, - OrderItemCancellationEnum, - OrderItemReturnEnum, - OrderItemType, - Origin, - StageName, - StageStatus, - SupportedFilterTypes, - TransportShipmentTypes, - WeightMeasurementUnit, -) +from ._edge_order_management_client_enums import ActionStatusEnum +from ._edge_order_management_client_enums import ActionType +from ._edge_order_management_client_enums import AddressType +from ._edge_order_management_client_enums import AvailabilityStage +from ._edge_order_management_client_enums import BillingType +from ._edge_order_management_client_enums import ChargingType +from ._edge_order_management_client_enums import CreatedByType +from ._edge_order_management_client_enums import DescriptionType +from ._edge_order_management_client_enums import DisabledReason +from ._edge_order_management_client_enums import DoubleEncryptionStatus +from ._edge_order_management_client_enums import ImageType +from ._edge_order_management_client_enums import LengthHeightUnit +from ._edge_order_management_client_enums import LinkType +from ._edge_order_management_client_enums import MeteringType +from ._edge_order_management_client_enums import NotificationStageName +from ._edge_order_management_client_enums import OrderItemCancellationEnum +from ._edge_order_management_client_enums import OrderItemReturnEnum +from ._edge_order_management_client_enums import OrderItemType +from ._edge_order_management_client_enums import Origin +from ._edge_order_management_client_enums import StageName +from ._edge_order_management_client_enums import StageStatus +from ._edge_order_management_client_enums import SupportedFilterTypes +from ._edge_order_management_client_enums import TransportShipmentTypes +from ._edge_order_management_client_enums import WeightMeasurementUnit +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk __all__ = [ - 'AddressDetails', - 'AddressProperties', - 'AddressResource', - 'AddressResourceList', - 'AddressUpdateParameter', - 'AvailabilityInformation', - 'BasicInformation', - 'BillingMeterDetails', - 'CancellationReason', - 'CommonProperties', - 'Configuration', - 'ConfigurationFilters', - 'ConfigurationProperties', - 'Configurations', - 'ConfigurationsRequest', - 'ContactDetails', - 'CostInformation', - 'CustomerSubscriptionDetails', - 'CustomerSubscriptionRegisteredFeatures', - 'Description', - 'DeviceDetails', - 'Dimensions', - 'DisplayInfo', - 'EncryptionPreferences', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'FilterableProperty', - 'ForwardShippingDetails', - 'HierarchyInformation', - 'ImageInformation', - 'Link', - 'ManagementResourcePreferences', - 'MeterDetails', - 'NotificationPreference', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'OrderItemDetails', - 'OrderItemResource', - 'OrderItemResourceList', - 'OrderItemUpdateParameter', - 'OrderResource', - 'OrderResourceList', - 'Pav2MeterDetails', - 'Preferences', - 'Product', - 'ProductDetails', - 'ProductFamilies', - 'ProductFamiliesMetadata', - 'ProductFamiliesMetadataDetails', - 'ProductFamiliesRequest', - 'ProductFamily', - 'ProductFamilyProperties', - 'ProductLine', - 'ProductLineProperties', - 'ProductProperties', - 'ProxyResource', - 'PurchaseMeterDetails', - 'Resource', - 'ResourceIdentity', - 'ResourceProviderDetails', - 'ReturnOrderItemDetails', - 'ReverseShippingDetails', - 'ShippingAddress', - 'ShippingDetails', - 'Specification', - 'StageDetails', - 'SystemData', - 'TrackedResource', - 'TransportPreferences', - 'ActionStatusEnum', - 'ActionType', - 'AddressType', - 'AvailabilityStage', - 'BillingType', - 'ChargingType', - 'CreatedByType', - 'DescriptionType', - 'DisabledReason', - 'DoubleEncryptionStatus', - 'ImageType', - 'LengthHeightUnit', - 'LinkType', - 'MeteringType', - 'NotificationStageName', - 'OrderItemCancellationEnum', - 'OrderItemReturnEnum', - 'OrderItemType', - 'Origin', - 'StageName', - 'StageStatus', - 'SupportedFilterTypes', - 'TransportShipmentTypes', - 'WeightMeasurementUnit', + "AddressDetails", + "AddressProperties", + "AddressResource", + "AddressResourceList", + "AddressUpdateParameter", + "AvailabilityInformation", + "BasicInformation", + "BillingMeterDetails", + "CancellationReason", + "CommonProperties", + "Configuration", + "ConfigurationFilters", + "ConfigurationProperties", + "Configurations", + "ConfigurationsRequest", + "ContactDetails", + "CostInformation", + "CustomerSubscriptionDetails", + "CustomerSubscriptionRegisteredFeatures", + "Description", + "DeviceDetails", + "Dimensions", + "DisplayInfo", + "EncryptionPreferences", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "FilterableProperty", + "ForwardShippingDetails", + "HierarchyInformation", + "ImageInformation", + "Link", + "ManagementResourcePreferences", + "MeterDetails", + "NotificationPreference", + "Operation", + "OperationDisplay", + "OperationListResult", + "OrderItemDetails", + "OrderItemResource", + "OrderItemResourceList", + "OrderItemUpdateParameter", + "OrderResource", + "OrderResourceList", + "Pav2MeterDetails", + "Preferences", + "Product", + "ProductDetails", + "ProductFamilies", + "ProductFamiliesMetadata", + "ProductFamiliesMetadataDetails", + "ProductFamiliesRequest", + "ProductFamily", + "ProductFamilyProperties", + "ProductLine", + "ProductLineProperties", + "ProductProperties", + "ProxyResource", + "PurchaseMeterDetails", + "Resource", + "ResourceIdentity", + "ResourceProviderDetails", + "ReturnOrderItemDetails", + "ReverseShippingDetails", + "ShippingAddress", + "ShippingDetails", + "Specification", + "StageDetails", + "SystemData", + "TrackedResource", + "TransportPreferences", + "ActionStatusEnum", + "ActionType", + "AddressType", + "AvailabilityStage", + "BillingType", + "ChargingType", + "CreatedByType", + "DescriptionType", + "DisabledReason", + "DoubleEncryptionStatus", + "ImageType", + "LengthHeightUnit", + "LinkType", + "MeteringType", + "NotificationStageName", + "OrderItemCancellationEnum", + "OrderItemReturnEnum", + "OrderItemType", + "Origin", + "StageName", + "StageStatus", + "SupportedFilterTypes", + "TransportShipmentTypes", + "WeightMeasurementUnit", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_edge_order_management_client_enums.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_edge_order_management_client_enums.py index 57c1b4255d38..077ce6077a3a 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_edge_order_management_client_enums.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_edge_order_management_client_enums.py @@ -6,301 +6,286 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta -from six import with_metaclass - -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 ActionStatusEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Describes whether the order item is deletable or not. - """ +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class ActionStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes whether the order item is deletable or not.""" - #: Allowed flag. ALLOWED = "Allowed" - #: Not Allowed flag. + """Allowed flag.""" NOT_ALLOWED = "NotAllowed" + """Not Allowed flag.""" -class ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """ + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" INTERNAL = "Internal" -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of address. - """ - #: Address type not known. +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + NONE = "None" - #: Residential Address. + """Address type not known.""" RESIDENTIAL = "Residential" - #: Commercial Address. + """Residential Address.""" COMMERCIAL = "Commercial" + """Commercial Address.""" -class AvailabilityStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Current availability stage of the product. Availability stage - """ - #: Product is available. +class AvailabilityStage(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current availability stage of the product. Availability stage.""" + AVAILABLE = "Available" - #: Product is coming soon. + """Product is available.""" COMING_SOON = "ComingSoon" - #: Product is in preview. + """Product is coming soon.""" PREVIEW = "Preview" - #: Product is deprecated. + """Product is in preview.""" DEPRECATED = "Deprecated" - #: Product is available only on signup. + """Product is deprecated.""" SIGNUP = "Signup" - #: Product is not available. + """Product is available only on signup.""" UNAVAILABLE = "Unavailable" + """Product is not available.""" -class BillingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents billing type. - """ - #: PaV2 billing. +class BillingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents billing type.""" + PAV2 = "Pav2" - #: Purchase billing. + """PaV2 billing.""" PURCHASE = "Purchase" + """Purchase billing.""" -class ChargingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Charging type. - """ - #: Per order charging type. +class ChargingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Charging type.""" + PER_ORDER = "PerOrder" - #: Per device charging type. + """Per order charging type.""" PER_DEVICE = "PerDevice" + """Per device charging type.""" -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class DescriptionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of description. - """ - #: Base description. +class DescriptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of description.""" + BASE = "Base" + """Base description.""" -class DisabledReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Reason why the product is disabled. - """ - #: Not disabled. +class DisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the product is disabled.""" + NONE = "None" - #: Not available in the requested country. + """Not disabled.""" COUNTRY = "Country" - #: Not available to push data to the requested Azure region. + """Not available in the requested country.""" REGION = "Region" - #: Required features are not enabled. + """Not available to push data to the requested Azure region.""" FEATURE = "Feature" - #: Subscription does not have required offer types. + """Required features are not enabled.""" OFFER_TYPE = "OfferType" - #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification. + """Subscription does not have required offer types.""" NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - #: The product is not yet available. + """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification.""" NOT_AVAILABLE = "NotAvailable" - #: The product is out of stock. + """The product is not yet available.""" OUT_OF_STOCK = "OutOfStock" + """The product is out of stock.""" + -class DoubleEncryptionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DoubleEncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Double encryption status as entered by the customer. It is compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. """ - #: Double encryption is disabled. DISABLED = "Disabled" - #: Double encryption is enabled. + """Double encryption is disabled""" ENABLED = "Enabled" + """Double encryption is enabled""" -class ImageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the image - """ - #: Main image. +class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the image.""" + MAIN_IMAGE = "MainImage" - #: Bullet image. + """Main image.""" BULLET_IMAGE = "BulletImage" - #: Generic image. + """Bullet image.""" GENERIC_IMAGE = "GenericImage" + """Generic image.""" -class LengthHeightUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Unit for the dimensions of length, height and width. - """ - #: Inch, applicable for West US. - IN_ENUM = "IN" - #: Centimeter. +class LengthHeightUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Unit for the dimensions of length, height and width.""" + + IN = "IN" + """Inch, applicable for West US.""" CM = "CM" + """Centimeter.""" -class LinkType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of link - """ - #: Generic link. +class LinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of link.""" + GENERIC = "Generic" - #: Terms and conditions link. + """Generic link.""" TERMS_AND_CONDITIONS = "TermsAndConditions" - #: Link to product specification. + """Terms and conditions link.""" SPECIFICATION = "Specification" - #: Link to product documentation. + """Link to product specification.""" DOCUMENTATION = "Documentation" - #: Link to know more. + """Link to product documentation""" KNOW_MORE = "KnowMore" - #: Link to sign up for products. + """Link to know more""" SIGN_UP = "SignUp" + """Link to sign up for products""" -class MeteringType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents Metering type (eg one-time or recurrent) - """ - #: One time billing. +class MeteringType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents Metering type (eg one-time or recurrent).""" + ONE_TIME = "OneTime" - #: Recurring billing. + """One time billing.""" RECURRING = "Recurring" - #: Adhoc billing. + """Recurring billing.""" ADHOC = "Adhoc" + """Adhoc billing.""" -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage. - """ - #: Notification at order item shipped from microsoft datacenter. +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + SHIPPED = "Shipped" - #: Notification at order item delivered to customer. + """Notification at order item shipped from microsoft datacenter.""" DELIVERED = "Delivered" + """Notification at order item delivered to customer.""" -class OrderItemCancellationEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Describes whether the order item is cancellable or not. - """ - #: Order item can be cancelled without fee. +class OrderItemCancellationEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes whether the order item is cancellable or not.""" + CANCELLABLE = "Cancellable" - #: Order item can be cancelled with fee. + """Order item can be cancelled without fee.""" CANCELLABLE_WITH_FEE = "CancellableWithFee" - #: Order item not cancellable. + """Order item can be cancelled with fee.""" NOT_CANCELLABLE = "NotCancellable" + """Order item not cancellable.""" -class OrderItemReturnEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Describes whether the order item is returnable or not. - """ - #: Order item can be returned without fee. +class OrderItemReturnEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes whether the order item is returnable or not.""" + RETURNABLE = "Returnable" - #: Order item can be returned with fee. + """Order item can be returned without fee.""" RETURNABLE_WITH_FEE = "ReturnableWithFee" - #: Order item not returnable. + """Order item can be returned with fee.""" NOT_RETURNABLE = "NotReturnable" + """Order item not returnable.""" -class OrderItemType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Order item type. - """ - #: Purchase OrderItem. +class OrderItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Order item type.""" + PURCHASE = "Purchase" - #: Rental OrderItem. + """Purchase OrderItem.""" RENTAL = "Rental" + """Rental OrderItem.""" -class Origin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system" + logs UX. Default value is "user,system". """ USER = "user" SYSTEM = "system" USER_SYSTEM = "user,system" -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Stage name - """ - #: Currently in draft mode and can still be cancelled. +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Stage name.""" + PLACED = "Placed" - #: Order is currently in draft mode and can still be cancelled. + """Currently in draft mode and can still be cancelled""" IN_REVIEW = "InReview" - #: Order is confirmed. + """Order is currently in draft mode and can still be cancelled""" CONFIRMED = "Confirmed" - #: Order is ready to ship. + """Order is confirmed""" READY_TO_SHIP = "ReadyToShip" - #: Order is in transit to customer. + """Order is ready to ship""" SHIPPED = "Shipped" - #: Order is delivered to customer. + """Order is in transit to customer""" DELIVERED = "Delivered" - #: Order is in use at customer site. + """Order is delivered to customer""" IN_USE = "InUse" - #: Return has been initiated by customer. + """Order is in use at customer site""" RETURN_INITIATED = "ReturnInitiated" - #: Order is in transit from customer to microsoft. + """Return has been initiated by customer.""" RETURN_PICKED_UP = "ReturnPickedUp" - #: Order has been received back to microsoft. + """Order is in transit from customer to microsoft.""" RETURNED_TO_MICROSOFT = "ReturnedToMicrosoft" - #: Return has now completed. + """Order has been received back to microsoft.""" RETURN_COMPLETED = "ReturnCompleted" - #: Order has been cancelled. + """Return has now completed.""" CANCELLED = "Cancelled" + """Order has been cancelled.""" -class StageStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Stage status. - """ - #: No status available yet. +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Stage status.""" + NONE = "None" - #: Stage is in progress. + """No status available yet.""" IN_PROGRESS = "InProgress" - #: Stage has succeeded. + """Stage is in progress.""" SUCCEEDED = "Succeeded" - #: Stage has failed. + """Stage has succeeded.""" FAILED = "Failed" - #: Stage has been cancelled. + """Stage has failed.""" CANCELLED = "Cancelled" - #: Stage is cancelling. + """Stage has been cancelled.""" CANCELLING = "Cancelling" + """Stage is cancelling.""" -class SupportedFilterTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of product filter. - """ - #: Ship to country. +class SupportedFilterTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of product filter.""" + SHIP_TO_COUNTRIES = "ShipToCountries" - #: Double encryption status. + """Ship to country""" DOUBLE_ENCRYPTION_STATUS = "DoubleEncryptionStatus" + """Double encryption status""" -class TransportShipmentTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates Shipment Logistics type that the customer preferred. - """ - #: Shipment Logistics is handled by the customer. +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates Shipment Logistics type that the customer preferred.""" + CUSTOMER_MANAGED = "CustomerManaged" - #: Shipment Logistics is handled by Microsoft. + """Shipment Logistics is handled by the customer.""" MICROSOFT_MANAGED = "MicrosoftManaged" + """Shipment Logistics is handled by Microsoft.""" -class WeightMeasurementUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Unit for the dimensions of weight. - """ - #: Pounds. +class WeightMeasurementUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Unit for the dimensions of weight.""" + LBS = "LBS" - #: Kilograms. + """Pounds.""" KGS = "KGS" + """Kilograms.""" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models.py deleted file mode 100644 index 7b37e59993f2..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models.py +++ /dev/null @@ -1,2971 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class AddressDetails(msrest.serialization.Model): - """Address details for an order item. - - 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 forward_address: Required. Customer address and contact details. It should be address - resource. - :type forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - :ivar return_address: Return shipping address. - :vartype return_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - """ - - _validation = { - 'forward_address': {'required': True}, - 'return_address': {'readonly': True}, - } - - _attribute_map = { - 'forward_address': {'key': 'forwardAddress', 'type': 'AddressProperties'}, - 'return_address': {'key': 'returnAddress', 'type': 'AddressProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressDetails, self).__init__(**kwargs) - self.forward_address = kwargs['forward_address'] - self.return_address = None - - -class AddressProperties(msrest.serialization.Model): - """Address Properties. - - All required parameters must be populated in order to send to Azure. - - :param shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress - :param contact_details: Required. Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails - """ - - _validation = { - 'contact_details': {'required': True}, - } - - _attribute_map = { - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressProperties, self).__init__(**kwargs) - self.shipping_address = kwargs.get('shipping_address', None) - self.contact_details = kwargs['contact_details'] - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class AddressResource(TrackedResource): - """Address 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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SystemData - :param shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress - :param contact_details: Required. Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'contact_details': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'properties.contactDetails', 'type': 'ContactDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressResource, self).__init__(**kwargs) - self.system_data = None - self.shipping_address = kwargs.get('shipping_address', None) - self.contact_details = kwargs['contact_details'] - - -class AddressResourceList(msrest.serialization.Model): - """Address Resource Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of address resources. - :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :param next_link: Link for the next set of job resources. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AddressResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressResourceList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class AddressUpdateParameter(msrest.serialization.Model): - """The Address update parameters. - - :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 shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress - :param contact_details: Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'properties.contactDetails', 'type': 'ContactDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.shipping_address = kwargs.get('shipping_address', None) - self.contact_details = kwargs.get('contact_details', None) - - -class AvailabilityInformation(msrest.serialization.Model): - """Availability information of a product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar availability_stage: Current availability stage of the product. Availability stage. - Possible values include: "Available", "ComingSoon", "Preview", "Deprecated", "Signup", - "Unavailable". - :vartype availability_stage: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityStage - :ivar disabled_reason: Reason why the product is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo", "NotAvailable", - "OutOfStock". - :vartype disabled_reason: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DisabledReason - :ivar disabled_reason_message: Message for why the product is disabled. - :vartype disabled_reason_message: str - """ - - _validation = { - 'availability_stage': {'readonly': True}, - 'disabled_reason': {'readonly': True}, - 'disabled_reason_message': {'readonly': True}, - } - - _attribute_map = { - 'availability_stage': {'key': 'availabilityStage', 'type': 'str'}, - 'disabled_reason': {'key': 'disabledReason', 'type': 'str'}, - 'disabled_reason_message': {'key': 'disabledReasonMessage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailabilityInformation, self).__init__(**kwargs) - self.availability_stage = None - self.disabled_reason = None - self.disabled_reason_message = None - - -class BasicInformation(msrest.serialization.Model): - """Basic information for any product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - } - - def __init__( - self, - **kwargs - ): - super(BasicInformation, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - - -class BillingMeterDetails(msrest.serialization.Model): - """Holds billing meter details for each type of billing. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Represents Billing type name. - :vartype name: str - :ivar meter_details: Represents MeterDetails. - :vartype meter_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.MeterDetails - :ivar metering_type: Represents Metering type (eg one-time or recurrent). Possible values - include: "OneTime", "Recurring", "Adhoc". - :vartype metering_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.MeteringType - :ivar frequency: Frequency of recurrence. - :vartype frequency: str - """ - - _validation = { - 'name': {'readonly': True}, - 'meter_details': {'readonly': True}, - 'metering_type': {'readonly': True}, - 'frequency': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, - 'metering_type': {'key': 'meteringType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(BillingMeterDetails, self).__init__(**kwargs) - self.name = None - self.meter_details = None - self.metering_type = None - self.frequency = 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 CommonProperties(BasicInformation): - """Represents common properties across product hierarchy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(CommonProperties, self).__init__(**kwargs) - self.filterable_properties = None - - -class Configuration(msrest.serialization.Model): - """Configuration object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Dimensions - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'specifications': {'readonly': True}, - 'dimensions': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'specifications': {'key': 'properties.specifications', 'type': '[Specification]'}, - 'dimensions': {'key': 'properties.dimensions', 'type': 'Dimensions'}, - } - - def __init__( - self, - **kwargs - ): - super(Configuration, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.specifications = None - self.dimensions = None - - -class ConfigurationFilters(msrest.serialization.Model): - """Configuration filters. - - All required parameters must be populated in order to send to Azure. - - :param hierarchy_information: Required. Product hierarchy information. - :type hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :param filterable_property: Filters specific to product. - :type filterable_property: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - """ - - _validation = { - 'hierarchy_information': {'required': True}, - } - - _attribute_map = { - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_property': {'key': 'filterableProperty', 'type': '[FilterableProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationFilters, self).__init__(**kwargs) - self.hierarchy_information = kwargs['hierarchy_information'] - self.filterable_property = kwargs.get('filterable_property', None) - - -class ConfigurationProperties(CommonProperties): - """Properties of configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Dimensions - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'specifications': {'readonly': True}, - 'dimensions': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'specifications': {'key': 'specifications', 'type': '[Specification]'}, - 'dimensions': {'key': 'dimensions', 'type': 'Dimensions'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationProperties, self).__init__(**kwargs) - self.specifications = None - self.dimensions = None - - -class Configurations(msrest.serialization.Model): - """The list of configurations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of configurations. - :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - :param next_link: Link for the next set of configurations. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Configuration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Configurations, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class ConfigurationsRequest(msrest.serialization.Model): - """Configuration request object. - - All required parameters must be populated in order to send to Azure. - - :param configuration_filters: Required. Holds details about product hierarchy information and - filterable property. - :type configuration_filters: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationFilters] - :param customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :type customer_subscription_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionDetails - """ - - _validation = { - 'configuration_filters': {'required': True, 'unique': True}, - } - - _attribute_map = { - 'configuration_filters': {'key': 'configurationFilters', 'type': '[ConfigurationFilters]'}, - 'customer_subscription_details': {'key': 'customerSubscriptionDetails', 'type': 'CustomerSubscriptionDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationsRequest, self).__init__(**kwargs) - self.configuration_filters = kwargs['configuration_filters'] - self.customer_subscription_details = kwargs.get('customer_subscription_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] - """ - - _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]'}, - } - - 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'] - - -class CostInformation(msrest.serialization.Model): - """Cost information for the product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar billing_meter_details: Details on the various billing aspects for the product system. - :vartype billing_meter_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingMeterDetails] - :ivar billing_info_url: Default url to display billing information. - :vartype billing_info_url: str - """ - - _validation = { - 'billing_meter_details': {'readonly': True}, - 'billing_info_url': {'readonly': True}, - } - - _attribute_map = { - 'billing_meter_details': {'key': 'billingMeterDetails', 'type': '[BillingMeterDetails]'}, - 'billing_info_url': {'key': 'billingInfoUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CostInformation, self).__init__(**kwargs) - self.billing_meter_details = None - self.billing_info_url = None - - -class CustomerSubscriptionDetails(msrest.serialization.Model): - """Holds Customer subscription details. Clients can display available products to unregistered customers by explicitly passing subscription details. - - All required parameters must be populated in order to send to Azure. - - :param registered_features: List of registered feature flags for subscription. - :type registered_features: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionRegisteredFeatures] - :param location_placement_id: Location placement Id of a subscription. - :type location_placement_id: str - :param quota_id: Required. Quota ID of a subscription. - :type quota_id: str - """ - - _validation = { - 'quota_id': {'required': True}, - } - - _attribute_map = { - 'registered_features': {'key': 'registeredFeatures', 'type': '[CustomerSubscriptionRegisteredFeatures]'}, - 'location_placement_id': {'key': 'locationPlacementId', 'type': 'str'}, - 'quota_id': {'key': 'quotaId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CustomerSubscriptionDetails, self).__init__(**kwargs) - self.registered_features = kwargs.get('registered_features', None) - self.location_placement_id = kwargs.get('location_placement_id', None) - self.quota_id = kwargs['quota_id'] - - -class CustomerSubscriptionRegisteredFeatures(msrest.serialization.Model): - """Represents subscription registered features. - - :param name: Name of subscription registered feature. - :type name: str - :param state: State of subscription registered feature. - :type state: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CustomerSubscriptionRegisteredFeatures, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.state = kwargs.get('state', None) - - -class Description(msrest.serialization.Model): - """Description related properties of a product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description_type: Type of description. Possible values include: "Base". - :vartype description_type: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DescriptionType - :ivar short_description: Short description of the product system. - :vartype short_description: str - :ivar long_description: Long description of the product system. - :vartype long_description: str - :ivar keywords: Keywords for the product system. - :vartype keywords: list[str] - :ivar attributes: Attributes for the product system. - :vartype attributes: list[str] - :ivar links: Links for the product system. - :vartype links: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Link] - """ - - _validation = { - 'description_type': {'readonly': True}, - 'short_description': {'readonly': True}, - 'long_description': {'readonly': True}, - 'keywords': {'readonly': True}, - 'attributes': {'readonly': True}, - 'links': {'readonly': True}, - } - - _attribute_map = { - 'description_type': {'key': 'descriptionType', 'type': 'str'}, - 'short_description': {'key': 'shortDescription', 'type': 'str'}, - 'long_description': {'key': 'longDescription', 'type': 'str'}, - 'keywords': {'key': 'keywords', 'type': '[str]'}, - 'attributes': {'key': 'attributes', 'type': '[str]'}, - 'links': {'key': 'links', 'type': '[Link]'}, - } - - def __init__( - self, - **kwargs - ): - super(Description, self).__init__(**kwargs) - self.description_type = None - self.short_description = None - self.long_description = None - self.keywords = None - self.attributes = None - self.links = None - - -class DeviceDetails(msrest.serialization.Model): - """Device details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar serial_number: device serial number. - :vartype serial_number: str - :ivar management_resource_id: Management Resource Id. - :vartype management_resource_id: str - :ivar management_resource_tenant_id: Management Resource Tenant ID. - :vartype management_resource_tenant_id: str - """ - - _validation = { - 'serial_number': {'readonly': True}, - 'management_resource_id': {'readonly': True}, - 'management_resource_tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'serial_number': {'key': 'serialNumber', 'type': 'str'}, - 'management_resource_id': {'key': 'managementResourceId', 'type': 'str'}, - 'management_resource_tenant_id': {'key': 'managementResourceTenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DeviceDetails, self).__init__(**kwargs) - self.serial_number = None - self.management_resource_id = None - self.management_resource_tenant_id = None - - -class Dimensions(msrest.serialization.Model): - """Dimensions of a configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar length: Length of the device. - :vartype length: float - :ivar height: Height of the device. - :vartype height: float - :ivar width: Width of the device. - :vartype width: float - :ivar length_height_unit: Unit for the dimensions of length, height and width. Possible values - include: "IN", "CM". - :vartype length_height_unit: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.LengthHeightUnit - :ivar weight: Weight of the device. - :vartype weight: float - :ivar depth: Depth of the device. - :vartype depth: float - :ivar weight_unit: Unit for the dimensions of weight. Possible values include: "LBS", "KGS". - :vartype weight_unit: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.WeightMeasurementUnit - """ - - _validation = { - 'length': {'readonly': True}, - 'height': {'readonly': True}, - 'width': {'readonly': True}, - 'length_height_unit': {'readonly': True}, - 'weight': {'readonly': True}, - 'depth': {'readonly': True}, - 'weight_unit': {'readonly': True}, - } - - _attribute_map = { - 'length': {'key': 'length', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'length_height_unit': {'key': 'lengthHeightUnit', 'type': 'str'}, - 'weight': {'key': 'weight', 'type': 'float'}, - 'depth': {'key': 'depth', 'type': 'float'}, - 'weight_unit': {'key': 'weightUnit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Dimensions, self).__init__(**kwargs) - self.length = None - self.height = None - self.width = None - self.length_height_unit = None - self.weight = None - self.depth = None - self.weight_unit = None - - -class DisplayInfo(msrest.serialization.Model): - """Describes product display information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar product_family_display_name: Product family display name. - :vartype product_family_display_name: str - :ivar configuration_display_name: Configuration display name. - :vartype configuration_display_name: str - """ - - _validation = { - 'product_family_display_name': {'readonly': True}, - 'configuration_display_name': {'readonly': True}, - } - - _attribute_map = { - 'product_family_display_name': {'key': 'productFamilyDisplayName', 'type': 'str'}, - 'configuration_display_name': {'key': 'configurationDisplayName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DisplayInfo, self).__init__(**kwargs) - self.product_family_display_name = None - self.configuration_display_name = None - - -class EncryptionPreferences(msrest.serialization.Model): - """Preferences related to the double encryption. - - :param double_encryption_status: Double encryption status as entered by the customer. It is - compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Possible - values include: "Disabled", "Enabled". - :type double_encryption_status: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DoubleEncryptionStatus - """ - - _attribute_map = { - 'double_encryption_status': {'key': 'doubleEncryptionStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EncryptionPreferences, self).__init__(**kwargs) - self.double_encryption_status = kwargs.get('double_encryption_status', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - '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': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :param error: The error object. - :type error: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class FilterableProperty(msrest.serialization.Model): - """Different types of filters supported and its values. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Type of product filter. Possible values include: "ShipToCountries", - "DoubleEncryptionStatus". - :type type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SupportedFilterTypes - :param supported_values: Required. Values to be filtered. - :type supported_values: list[str] - """ - - _validation = { - 'type': {'required': True}, - 'supported_values': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'supported_values': {'key': 'supportedValues', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(FilterableProperty, self).__init__(**kwargs) - self.type = kwargs['type'] - self.supported_values = kwargs['supported_values'] - - -class ForwardShippingDetails(msrest.serialization.Model): - """Forward shipment 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 carrier_display_name: Carrier Name for display purpose. Not to be used for any - processing. - :vartype carrier_display_name: str - :ivar tracking_id: TrackingId of the package. - :vartype tracking_id: str - :ivar tracking_url: TrackingUrl of the package. - :vartype tracking_url: str - """ - - _validation = { - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, - } - - _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ForwardShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = None - - -class HierarchyInformation(msrest.serialization.Model): - """Holds details about product hierarchy information. - - :param product_family_name: Represents product family name that uniquely identifies product - family. - :type product_family_name: str - :param product_line_name: Represents product line name that uniquely identifies product line. - :type product_line_name: str - :param product_name: Represents product name that uniquely identifies product. - :type product_name: str - :param configuration_name: Represents configuration name that uniquely identifies - configuration. - :type configuration_name: str - """ - - _attribute_map = { - 'product_family_name': {'key': 'productFamilyName', 'type': 'str'}, - 'product_line_name': {'key': 'productLineName', 'type': 'str'}, - 'product_name': {'key': 'productName', 'type': 'str'}, - 'configuration_name': {'key': 'configurationName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HierarchyInformation, self).__init__(**kwargs) - self.product_family_name = kwargs.get('product_family_name', None) - self.product_line_name = kwargs.get('product_line_name', None) - self.product_name = kwargs.get('product_name', None) - self.configuration_name = kwargs.get('configuration_name', None) - - -class ImageInformation(msrest.serialization.Model): - """Image for the product. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar image_type: Type of the image. Possible values include: "MainImage", "BulletImage", - "GenericImage". - :vartype image_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageType - :ivar image_url: Url of the image. - :vartype image_url: str - """ - - _validation = { - 'image_type': {'readonly': True}, - 'image_url': {'readonly': True}, - } - - _attribute_map = { - 'image_type': {'key': 'imageType', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ImageInformation, self).__init__(**kwargs) - self.image_type = None - self.image_url = None - - -class Link(msrest.serialization.Model): - """Returns link related to the product. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar link_type: Type of link. Possible values include: "Generic", "TermsAndConditions", - "Specification", "Documentation", "KnowMore", "SignUp". - :vartype link_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.LinkType - :ivar link_url: Url of the link. - :vartype link_url: str - """ - - _validation = { - 'link_type': {'readonly': True}, - 'link_url': {'readonly': True}, - } - - _attribute_map = { - 'link_type': {'key': 'linkType', 'type': 'str'}, - 'link_url': {'key': 'linkUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Link, self).__init__(**kwargs) - self.link_type = None - self.link_url = None - - -class ManagementResourcePreferences(msrest.serialization.Model): - """Management resource preference to link device. - - :param preferred_management_resource_id: Customer preferred Management resource ARM ID. - :type preferred_management_resource_id: str - """ - - _attribute_map = { - 'preferred_management_resource_id': {'key': 'preferredManagementResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagementResourcePreferences, self).__init__(**kwargs) - self.preferred_management_resource_id = kwargs.get('preferred_management_resource_id', None) - - -class MeterDetails(msrest.serialization.Model): - """Holds details about billing type and its meter guids. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Pav2MeterDetails, PurchaseMeterDetails. - - 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 billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ChargingType - """ - - _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - } - - _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - } - - _subtype_map = { - 'billing_type': {'Pav2': 'Pav2MeterDetails', 'Purchase': 'PurchaseMeterDetails'} - } - - def __init__( - self, - **kwargs - ): - super(MeterDetails, self).__init__(**kwargs) - self.billing_type = None # type: Optional[str] - self.multiplier = None - self.charging_type = 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: "Shipped", - "Delivered". - :type stage_name: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.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): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :param display: Localized display information for this particular operation. - :type display: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = kwargs.get('display', None) - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _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 = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OrderItemDetails(msrest.serialization.Model): - """Order item 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 product_details: Required. Unique identifier for configuration. - :type product_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductDetails - :param order_item_type: Required. Order item type. Possible values include: "Purchase", - "Rental". - :type order_item_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemType - :ivar current_stage: Current Order item Status. - :vartype current_stage: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails - :ivar order_item_stage_history: Order item status history. - :vartype order_item_stage_history: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails] - :param preferences: Customer notification Preferences. - :type preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences - :ivar forward_shipping_details: Forward Package Shipping details. - :vartype forward_shipping_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ForwardShippingDetails - :ivar reverse_shipping_details: Reverse Package Shipping details. - :vartype reverse_shipping_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReverseShippingDetails - :param notification_email_list: Additional notification email list. - :type notification_email_list: list[str] - :ivar cancellation_reason: Cancellation reason. - :vartype cancellation_reason: str - :ivar cancellation_status: Describes whether the order item is cancellable or not. Possible - values include: "Cancellable", "CancellableWithFee", "NotCancellable". - :vartype cancellation_status: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemCancellationEnum - :ivar deletion_status: Describes whether the order item is deletable or not. Possible values - include: "Allowed", "NotAllowed". - :vartype deletion_status: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ActionStatusEnum - :ivar return_reason: Return reason. - :vartype return_reason: str - :ivar return_status: Describes whether the order item is returnable or not. Possible values - include: "Returnable", "ReturnableWithFee", "NotReturnable". - :vartype return_status: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemReturnEnum - :ivar management_rp_details: Parent RP details - this returns only the first or default parent - RP from the entire list. - :vartype management_rp_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails - :ivar management_rp_details_list: List of parent RP details supported for configuration. - :vartype management_rp_details_list: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorDetail - """ - - _validation = { - 'product_details': {'required': True}, - 'order_item_type': {'required': True}, - 'current_stage': {'readonly': True}, - 'order_item_stage_history': {'readonly': True}, - 'forward_shipping_details': {'readonly': True}, - 'reverse_shipping_details': {'readonly': True}, - 'cancellation_reason': {'readonly': True}, - 'cancellation_status': {'readonly': True}, - 'deletion_status': {'readonly': True}, - 'return_reason': {'readonly': True}, - 'return_status': {'readonly': True}, - 'management_rp_details': {'readonly': True}, - 'management_rp_details_list': {'readonly': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'product_details': {'key': 'productDetails', 'type': 'ProductDetails'}, - 'order_item_type': {'key': 'orderItemType', 'type': 'str'}, - 'current_stage': {'key': 'currentStage', 'type': 'StageDetails'}, - 'order_item_stage_history': {'key': 'orderItemStageHistory', 'type': '[StageDetails]'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'forward_shipping_details': {'key': 'forwardShippingDetails', 'type': 'ForwardShippingDetails'}, - 'reverse_shipping_details': {'key': 'reverseShippingDetails', 'type': 'ReverseShippingDetails'}, - 'notification_email_list': {'key': 'notificationEmailList', 'type': '[str]'}, - 'cancellation_reason': {'key': 'cancellationReason', 'type': 'str'}, - 'cancellation_status': {'key': 'cancellationStatus', 'type': 'str'}, - 'deletion_status': {'key': 'deletionStatus', 'type': 'str'}, - 'return_reason': {'key': 'returnReason', 'type': 'str'}, - 'return_status': {'key': 'returnStatus', 'type': 'str'}, - 'management_rp_details': {'key': 'managementRpDetails', 'type': 'ResourceProviderDetails'}, - 'management_rp_details_list': {'key': 'managementRpDetailsList', 'type': '[ResourceProviderDetails]'}, - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderItemDetails, self).__init__(**kwargs) - self.product_details = kwargs['product_details'] - self.order_item_type = kwargs['order_item_type'] - self.current_stage = None - self.order_item_stage_history = None - self.preferences = kwargs.get('preferences', None) - self.forward_shipping_details = None - self.reverse_shipping_details = None - self.notification_email_list = kwargs.get('notification_email_list', None) - self.cancellation_reason = None - self.cancellation_status = None - self.deletion_status = None - self.return_reason = None - self.return_status = None - self.management_rp_details = None - self.management_rp_details_list = None - self.error = None - - -class OrderItemResource(TrackedResource): - """Represents order item contract. - - 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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SystemData - :param order_item_details: Required. Represents order item details. - :type order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemDetails - :param address_details: Required. Represents shipping and return address for order item. - :type address_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressDetails - :ivar start_time: Start time of order item. - :vartype start_time: ~datetime.datetime - :param order_id: Required. Id of the order to which order item belongs to. - :type order_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'order_item_details': {'required': True}, - 'address_details': {'required': True}, - 'start_time': {'readonly': True}, - 'order_id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'order_item_details': {'key': 'properties.orderItemDetails', 'type': 'OrderItemDetails'}, - 'address_details': {'key': 'properties.addressDetails', 'type': 'AddressDetails'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'order_id': {'key': 'properties.orderId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderItemResource, self).__init__(**kwargs) - self.system_data = None - self.order_item_details = kwargs['order_item_details'] - self.address_details = kwargs['address_details'] - self.start_time = None - self.order_id = kwargs['order_id'] - - -class OrderItemResourceList(msrest.serialization.Model): - """List of orderItems. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of order item resources. - :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :param next_link: Link for the next set of order item resources. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OrderItemResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderItemResourceList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class OrderItemUpdateParameter(msrest.serialization.Model): - """Updates order item parameters. - - :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 forward_address: Updates forward shipping address and contact details. - :type forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - :param preferences: Customer preference. - :type preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences - :param notification_email_list: Additional notification email list. - :type notification_email_list: list[str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'forward_address': {'key': 'properties.forwardAddress', 'type': 'AddressProperties'}, - 'preferences': {'key': 'properties.preferences', 'type': 'Preferences'}, - 'notification_email_list': {'key': 'properties.notificationEmailList', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderItemUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.forward_address = kwargs.get('forward_address', None) - self.preferences = kwargs.get('preferences', None) - self.notification_email_list = kwargs.get('notification_email_list', None) - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class OrderResource(ProxyResource): - """Specifies the properties or parameters for an order. Order is a grouping of one or more order items. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SystemData - :ivar order_item_ids: List of order item ARM Ids which are part of an order. - :vartype order_item_ids: list[str] - :ivar current_stage: Order current status. - :vartype current_stage: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails - :ivar order_stage_history: Order status history. - :vartype order_stage_history: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'order_item_ids': {'readonly': True}, - 'current_stage': {'readonly': True}, - 'order_stage_history': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'order_item_ids': {'key': 'properties.orderItemIds', 'type': '[str]'}, - 'current_stage': {'key': 'properties.currentStage', 'type': 'StageDetails'}, - 'order_stage_history': {'key': 'properties.orderStageHistory', 'type': '[StageDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderResource, self).__init__(**kwargs) - self.system_data = None - self.order_item_ids = None - self.current_stage = None - self.order_stage_history = None - - -class OrderResourceList(msrest.serialization.Model): - """List of orders. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of order resources. - :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] - :param next_link: Link for the next set of order resources. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OrderResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderResourceList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class Pav2MeterDetails(MeterDetails): - """Billing type PAV2 meter 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 billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ChargingType - :ivar meter_guid: Validation status of requested data center and transport. - :vartype meter_guid: str - """ - - _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - 'meter_guid': {'readonly': True}, - } - - _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - 'meter_guid': {'key': 'meterGuid', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Pav2MeterDetails, self).__init__(**kwargs) - self.billing_type = 'Pav2' # type: str - self.meter_guid = None - - -class Preferences(msrest.serialization.Model): - """Preferences related to the order. - - :param notification_preferences: Notification preferences. - :type notification_preferences: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.NotificationPreference] - :param transport_preferences: Preferences related to the shipment logistics of the order. - :type transport_preferences: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.TransportPreferences - :param encryption_preferences: Preferences related to the Encryption. - :type encryption_preferences: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.EncryptionPreferences - :param management_resource_preferences: Preferences related to the Management resource. - :type management_resource_preferences: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ManagementResourcePreferences - """ - - _attribute_map = { - 'notification_preferences': {'key': 'notificationPreferences', 'type': '[NotificationPreference]'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, - 'management_resource_preferences': {'key': 'managementResourcePreferences', 'type': 'ManagementResourcePreferences'}, - } - - def __init__( - self, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) - self.notification_preferences = kwargs.get('notification_preferences', None) - self.transport_preferences = kwargs.get('transport_preferences', None) - self.encryption_preferences = kwargs.get('encryption_preferences', None) - self.management_resource_preferences = kwargs.get('management_resource_preferences', None) - - -class Product(msrest.serialization.Model): - """List of Products. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'configurations': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'configurations': {'key': 'properties.configurations', 'type': '[Configuration]'}, - } - - def __init__( - self, - **kwargs - ): - super(Product, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.configurations = None - - -class ProductDetails(msrest.serialization.Model): - """Represents product 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 display_info: Display details of the product. - :type display_info: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DisplayInfo - :param hierarchy_information: Required. Hierarchy of the product which uniquely identifies the - product. - :type hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar count: Quantity of the product. - :vartype count: int - :ivar product_double_encryption_status: Double encryption status of the configuration. - Read-only field. Possible values include: "Disabled", "Enabled". - :vartype product_double_encryption_status: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DoubleEncryptionStatus - :ivar device_details: list of device details. - :vartype device_details: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.DeviceDetails] - """ - - _validation = { - 'hierarchy_information': {'required': True}, - 'count': {'readonly': True}, - 'product_double_encryption_status': {'readonly': True}, - 'device_details': {'readonly': True}, - } - - _attribute_map = { - 'display_info': {'key': 'displayInfo', 'type': 'DisplayInfo'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'count': {'key': 'count', 'type': 'int'}, - 'product_double_encryption_status': {'key': 'productDoubleEncryptionStatus', 'type': 'str'}, - 'device_details': {'key': 'deviceDetails', 'type': '[DeviceDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductDetails, self).__init__(**kwargs) - self.display_info = kwargs.get('display_info', None) - self.hierarchy_information = kwargs['hierarchy_information'] - self.count = None - self.product_double_encryption_status = None - self.device_details = None - - -class ProductFamilies(msrest.serialization.Model): - """The list of product families. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of product families. - :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] - :param next_link: Link for the next set of product families. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductFamily]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamilies, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class ProductFamiliesMetadata(msrest.serialization.Model): - """Holds details about product family metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of product family metadata details. - :vartype value: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails] - :ivar next_link: Link for the next set of product families. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductFamiliesMetadataDetails]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamiliesMetadata, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ProductFamiliesMetadataDetails(msrest.serialization.Model): - """Product families metadata details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'properties.productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'properties.resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamiliesMetadataDetails, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.product_lines = None - self.resource_provider_details = kwargs.get('resource_provider_details', None) - - -class ProductFamiliesRequest(msrest.serialization.Model): - """The filters for showing the product families. - - All required parameters must be populated in order to send to Azure. - - :param filterable_properties: Required. Dictionary of filterable properties on product family. - :type filterable_properties: dict[str, - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty]] - :param customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :type customer_subscription_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionDetails - """ - - _validation = { - 'filterable_properties': {'required': True}, - } - - _attribute_map = { - 'filterable_properties': {'key': 'filterableProperties', 'type': '{[FilterableProperty]}'}, - 'customer_subscription_details': {'key': 'customerSubscriptionDetails', 'type': 'CustomerSubscriptionDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamiliesRequest, self).__init__(**kwargs) - self.filterable_properties = kwargs['filterable_properties'] - self.customer_subscription_details = kwargs.get('customer_subscription_details', None) - - -class ProductFamily(msrest.serialization.Model): - """Product Family. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'properties.productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'properties.resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamily, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.product_lines = None - self.resource_provider_details = kwargs.get('resource_provider_details', None) - - -class ProductFamilyProperties(CommonProperties): - """Properties of product family. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamilyProperties, self).__init__(**kwargs) - self.product_lines = None - self.resource_provider_details = kwargs.get('resource_provider_details', None) - - -class ProductLine(msrest.serialization.Model): - """Product line. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Product] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'products': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'products': {'key': 'properties.products', 'type': '[Product]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductLine, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.products = None - - -class ProductLineProperties(CommonProperties): - """Properties of product line. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Product] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'products': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'products': {'key': 'products', 'type': '[Product]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductLineProperties, self).__init__(**kwargs) - self.products = None - - -class ProductProperties(CommonProperties): - """Properties of products. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'configurations': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'configurations': {'key': 'configurations', 'type': '[Configuration]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductProperties, self).__init__(**kwargs) - self.configurations = None - - -class PurchaseMeterDetails(MeterDetails): - """Billing type Purchase meter 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 billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ChargingType - :ivar product_id: Product Id. - :vartype product_id: str - :ivar sku_id: Sku Id. - :vartype sku_id: str - :ivar term_id: Term Id. - :vartype term_id: str - """ - - _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - 'product_id': {'readonly': True}, - 'sku_id': {'readonly': True}, - 'term_id': {'readonly': True}, - } - - _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - 'product_id': {'key': 'productId', 'type': 'str'}, - 'sku_id': {'key': 'skuId', 'type': 'str'}, - 'term_id': {'key': 'termId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PurchaseMeterDetails, self).__init__(**kwargs) - self.billing_type = 'Purchase' # type: str - self.product_id = None - self.sku_id = None - self.term_id = 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. - - :param type: Identity type. - :type 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 - """ - - _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'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.principal_id = None - self.tenant_id = None - - -class ResourceProviderDetails(msrest.serialization.Model): - """Management RP details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar resource_provider_namespace: Resource provider namespace. - :vartype resource_provider_namespace: str - """ - - _validation = { - 'resource_provider_namespace': {'readonly': True}, - } - - _attribute_map = { - 'resource_provider_namespace': {'key': 'resourceProviderNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderDetails, self).__init__(**kwargs) - self.resource_provider_namespace = None - - -class ReturnOrderItemDetails(msrest.serialization.Model): - """Return order item request body. - - All required parameters must be populated in order to send to Azure. - - :param return_address: customer return address. - :type return_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - :param return_reason: Required. Return Reason. - :type return_reason: str - :param service_tag: Service tag (located on the bottom-right corner of the device). - :type service_tag: str - :param shipping_box_required: Shipping Box required. - :type shipping_box_required: bool - """ - - _validation = { - 'return_reason': {'required': True}, - } - - _attribute_map = { - 'return_address': {'key': 'returnAddress', 'type': 'AddressProperties'}, - 'return_reason': {'key': 'returnReason', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'shipping_box_required': {'key': 'shippingBoxRequired', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ReturnOrderItemDetails, self).__init__(**kwargs) - self.return_address = kwargs.get('return_address', None) - self.return_reason = kwargs['return_reason'] - self.service_tag = kwargs.get('service_tag', None) - self.shipping_box_required = kwargs.get('shipping_box_required', False) - - -class ReverseShippingDetails(msrest.serialization.Model): - """Reverse shipment details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sas_key_for_label: SAS key to download the reverse shipment label of the package. - :vartype sas_key_for_label: str - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar carrier_display_name: Carrier Name for display purpose. Not to be used for any - processing. - :vartype carrier_display_name: str - :ivar tracking_id: TrackingId of the package. - :vartype tracking_id: str - :ivar tracking_url: TrackingUrl of the package. - :vartype tracking_url: str - """ - - _validation = { - 'sas_key_for_label': {'readonly': True}, - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, - } - - _attribute_map = { - 'sas_key_for_label': {'key': 'sasKeyForLabel', 'type': 'str'}, - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReverseShippingDetails, self).__init__(**kwargs) - self.sas_key_for_label = None - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = 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: 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.edgeorder.v2020_12_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, - **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.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) - - -class ShippingDetails(msrest.serialization.Model): - """Package 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 carrier_display_name: Carrier Name for display purpose. Not to be used for any - processing. - :vartype carrier_display_name: str - :ivar tracking_id: TrackingId of the package. - :vartype tracking_id: str - :ivar tracking_url: TrackingUrl of the package. - :vartype tracking_url: str - """ - - _validation = { - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, - } - - _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = None - - -class Specification(msrest.serialization.Model): - """Specifications of the configurations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the specification. - :vartype name: str - :ivar value: Value of the specification. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Specification, self).__init__(**kwargs) - self.name = None - self.value = None - - -class StageDetails(msrest.serialization.Model): - """Resource stage details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar stage_status: Stage status. Possible values include: "None", "InProgress", "Succeeded", - "Failed", "Cancelled", "Cancelling". - :vartype stage_status: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageStatus - :ivar stage_name: Stage name. Possible values include: "Placed", "InReview", "Confirmed", - "ReadyToShip", "Shipped", "Delivered", "InUse", "ReturnInitiated", "ReturnPickedUp", - "ReturnedToMicrosoft", "ReturnCompleted", "Cancelled". - :vartype stage_name: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageName - :ivar display_name: Display name of the resource stage. - :vartype display_name: str - :ivar start_time: Stage start time. - :vartype start_time: ~datetime.datetime - """ - - _validation = { - 'stage_status': {'readonly': True}, - 'stage_name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'start_time': {'readonly': True}, - } - - _attribute_map = { - 'stage_status': {'key': 'stageStatus', 'type': 'str'}, - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(StageDetails, self).__init__(**kwargs) - self.stage_status = None - self.stage_name = None - self.display_name = None - self.start_time = None - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _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 = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', 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.edgeorder.v2020_12_01_preview.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'] diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py index 912abd4af930..8b5beec7cf03 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py @@ -1,4 +1,5 @@ # coding=utf-8 +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -7,82 +8,89 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from azure.core.exceptions import HttpResponseError -import msrest.serialization +from ... import _serialization -from ._edge_order_management_client_enums import * +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models -class AddressDetails(msrest.serialization.Model): +class AddressDetails(_serialization.Model): """Address details for an order item. 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 forward_address: Required. Customer address and contact details. It should be address - resource. - :type forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties + :ivar forward_address: Customer address and contact details. It should be address resource. + Required. + :vartype forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties :ivar return_address: Return shipping address. :vartype return_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties """ _validation = { - 'forward_address': {'required': True}, - 'return_address': {'readonly': True}, + "forward_address": {"required": True}, + "return_address": {"readonly": True}, } _attribute_map = { - 'forward_address': {'key': 'forwardAddress', 'type': 'AddressProperties'}, - 'return_address': {'key': 'returnAddress', 'type': 'AddressProperties'}, + "forward_address": {"key": "forwardAddress", "type": "AddressProperties"}, + "return_address": {"key": "returnAddress", "type": "AddressProperties"}, } - def __init__( - self, - *, - forward_address: "AddressProperties", - **kwargs - ): - super(AddressDetails, self).__init__(**kwargs) + def __init__(self, *, forward_address: "_models.AddressProperties", **kwargs: Any) -> None: + """ + :keyword forward_address: Customer address and contact details. It should be address resource. + Required. + :paramtype forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties + """ + super().__init__(**kwargs) self.forward_address = forward_address self.return_address = None -class AddressProperties(msrest.serialization.Model): +class AddressProperties(_serialization.Model): """Address Properties. All required parameters must be populated in order to send to Azure. - :param shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress - :param contact_details: Required. Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails + :ivar shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress + :ivar contact_details: Contact details for the address. Required. + :vartype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails """ _validation = { - 'contact_details': {'required': True}, + "contact_details": {"required": True}, } _attribute_map = { - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, + "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, + "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, } def __init__( self, *, - contact_details: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - **kwargs - ): - super(AddressProperties, self).__init__(**kwargs) + contact_details: "_models.ContactDetails", + shipping_address: Optional["_models.ShippingAddress"] = None, + **kwargs: Any + ) -> None: + """ + :keyword shipping_address: Shipping details for the address. + :paramtype shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress + :keyword contact_details: Contact details for the address. Required. + :paramtype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails + """ + super().__init__(**kwargs) self.shipping_address = shipping_address self.contact_details = contact_details -class Resource(msrest.serialization.Model): +class Resource(_serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. @@ -98,29 +106,28 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.id = None self.name = None self.type = None class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. @@ -134,35 +141,35 @@ class TrackedResource(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + """ + super().__init__(**kwargs) self.tags = tags self.location = location @@ -182,129 +189,145 @@ class AddressResource(TrackedResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar system_data: Represents resource creation and update time. :vartype system_data: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SystemData - :param shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress - :param contact_details: Required. Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails + :ivar shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress + :ivar contact_details: Contact details for the address. Required. + :vartype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'contact_details': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, + "system_data": {"readonly": True}, + "contact_details": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'properties.contactDetails', 'type': 'ContactDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, + "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, } def __init__( self, *, location: str, - contact_details: "ContactDetails", + contact_details: "_models.ContactDetails", tags: Optional[Dict[str, str]] = None, - shipping_address: Optional["ShippingAddress"] = None, - **kwargs - ): - super(AddressResource, self).__init__(tags=tags, location=location, **kwargs) + shipping_address: Optional["_models.ShippingAddress"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword shipping_address: Shipping details for the address. + :paramtype shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress + :keyword contact_details: Contact details for the address. Required. + :paramtype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails + """ + super().__init__(tags=tags, location=location, **kwargs) self.system_data = None self.shipping_address = shipping_address self.contact_details = contact_details -class AddressResourceList(msrest.serialization.Model): +class AddressResourceList(_serialization.Model): """Address Resource Collection. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of address resources. :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AddressResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AddressResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(AddressResourceList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link -class AddressUpdateParameter(msrest.serialization.Model): +class AddressUpdateParameter(_serialization.Model): """The Address update parameters. - :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 shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress - :param contact_details: Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails + :ivar 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 shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress + :ivar contact_details: Contact details for the address. + :vartype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'properties.contactDetails', 'type': 'ContactDetails'}, + "tags": {"key": "tags", "type": "{str}"}, + "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, + "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, - shipping_address: Optional["ShippingAddress"] = None, - contact_details: Optional["ContactDetails"] = None, - **kwargs - ): - super(AddressUpdateParameter, self).__init__(**kwargs) + shipping_address: Optional["_models.ShippingAddress"] = None, + contact_details: Optional["_models.ContactDetails"] = None, + **kwargs: Any + ) -> None: + """ + :keyword 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 shipping_address: Shipping details for the address. + :paramtype shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress + :keyword contact_details: Contact details for the address. + :paramtype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails + """ + super().__init__(**kwargs) self.tags = tags self.shipping_address = shipping_address self.contact_details = contact_details -class AvailabilityInformation(msrest.serialization.Model): +class AvailabilityInformation(_serialization.Model): """Availability information of a product system. Variables are only populated by the server, and will be ignored when sending a request. - :ivar availability_stage: Current availability stage of the product. Availability stage. - Possible values include: "Available", "ComingSoon", "Preview", "Deprecated", "Signup", - "Unavailable". + :ivar availability_stage: Current availability stage of the product. Availability stage. Known + values are: "Available", "ComingSoon", "Preview", "Deprecated", "Signup", and "Unavailable". :vartype availability_stage: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityStage - :ivar disabled_reason: Reason why the product is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo", "NotAvailable", - "OutOfStock". + :ivar disabled_reason: Reason why the product is disabled. Known values are: "None", "Country", + "Region", "Feature", "OfferType", "NoSubscriptionInfo", "NotAvailable", and "OutOfStock". :vartype disabled_reason: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DisabledReason :ivar disabled_reason_message: Message for why the product is disabled. @@ -312,28 +335,26 @@ class AvailabilityInformation(msrest.serialization.Model): """ _validation = { - 'availability_stage': {'readonly': True}, - 'disabled_reason': {'readonly': True}, - 'disabled_reason_message': {'readonly': True}, + "availability_stage": {"readonly": True}, + "disabled_reason": {"readonly": True}, + "disabled_reason_message": {"readonly": True}, } _attribute_map = { - 'availability_stage': {'key': 'availabilityStage', 'type': 'str'}, - 'disabled_reason': {'key': 'disabledReason', 'type': 'str'}, - 'disabled_reason_message': {'key': 'disabledReasonMessage', 'type': 'str'}, + "availability_stage": {"key": "availabilityStage", "type": "str"}, + "disabled_reason": {"key": "disabledReason", "type": "str"}, + "disabled_reason_message": {"key": "disabledReasonMessage", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(AvailabilityInformation, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.availability_stage = None self.disabled_reason = None self.disabled_reason_message = None -class BasicInformation(msrest.serialization.Model): +class BasicInformation(_serialization.Model): """Basic information for any product system. Variables are only populated by the server, and will be ignored when sending a request. @@ -356,28 +377,26 @@ class BasicInformation(msrest.serialization.Model): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, } _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, } - def __init__( - self, - **kwargs - ): - super(BasicInformation, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -386,7 +405,7 @@ def __init__( self.hierarchy_information = None -class BillingMeterDetails(msrest.serialization.Model): +class BillingMeterDetails(_serialization.Model): """Holds billing meter details for each type of billing. Variables are only populated by the server, and will be ignored when sending a request. @@ -395,62 +414,59 @@ class BillingMeterDetails(msrest.serialization.Model): :vartype name: str :ivar meter_details: Represents MeterDetails. :vartype meter_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.MeterDetails - :ivar metering_type: Represents Metering type (eg one-time or recurrent). Possible values - include: "OneTime", "Recurring", "Adhoc". + :ivar metering_type: Represents Metering type (eg one-time or recurrent). Known values are: + "OneTime", "Recurring", and "Adhoc". :vartype metering_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.MeteringType :ivar frequency: Frequency of recurrence. :vartype frequency: str """ _validation = { - 'name': {'readonly': True}, - 'meter_details': {'readonly': True}, - 'metering_type': {'readonly': True}, - 'frequency': {'readonly': True}, + "name": {"readonly": True}, + "meter_details": {"readonly": True}, + "metering_type": {"readonly": True}, + "frequency": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, - 'metering_type': {'key': 'meteringType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "meter_details": {"key": "meterDetails", "type": "MeterDetails"}, + "metering_type": {"key": "meteringType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(BillingMeterDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.name = None self.meter_details = None self.metering_type = None self.frequency = None -class CancellationReason(msrest.serialization.Model): +class CancellationReason(_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 + :ivar reason: Reason for cancellation. Required. + :vartype reason: str """ _validation = { - 'reason': {'required': True}, + "reason": {"required": True}, } _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, + "reason": {"key": "reason", "type": "str"}, } - def __init__( - self, - *, - reason: str, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) + def __init__(self, *, reason: str, **kwargs: Any) -> None: + """ + :keyword reason: Reason for cancellation. Required. + :paramtype reason: str + """ + super().__init__(**kwargs) self.reason = reason @@ -480,34 +496,32 @@ class CommonProperties(BasicInformation): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, } _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, } - def __init__( - self, - **kwargs - ): - super(CommonProperties, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.filterable_properties = None -class Configuration(msrest.serialization.Model): +class Configuration(_serialization.Model): """Configuration object. Variables are only populated by the server, and will be ignored when sending a request. @@ -537,34 +551,32 @@ class Configuration(msrest.serialization.Model): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'specifications': {'readonly': True}, - 'dimensions': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'specifications': {'key': 'properties.specifications', 'type': '[Specification]'}, - 'dimensions': {'key': 'properties.dimensions', 'type': 'Dimensions'}, - } - - def __init__( - self, - **kwargs - ): - super(Configuration, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "specifications": {"readonly": True}, + "dimensions": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "specifications": {"key": "properties.specifications", "type": "[Specification]"}, + "dimensions": {"key": "properties.dimensions", "type": "Dimensions"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -576,36 +588,44 @@ def __init__( self.dimensions = None -class ConfigurationFilters(msrest.serialization.Model): +class ConfigurationFilters(_serialization.Model): """Configuration filters. All required parameters must be populated in order to send to Azure. - :param hierarchy_information: Required. Product hierarchy information. - :type hierarchy_information: + :ivar hierarchy_information: Product hierarchy information. Required. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :param filterable_property: Filters specific to product. - :type filterable_property: + :ivar filterable_property: Filters specific to product. + :vartype filterable_property: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] """ _validation = { - 'hierarchy_information': {'required': True}, + "hierarchy_information": {"required": True}, } _attribute_map = { - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_property': {'key': 'filterableProperty', 'type': '[FilterableProperty]'}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_property": {"key": "filterableProperty", "type": "[FilterableProperty]"}, } def __init__( self, *, - hierarchy_information: "HierarchyInformation", - filterable_property: Optional[List["FilterableProperty"]] = None, - **kwargs - ): - super(ConfigurationFilters, self).__init__(**kwargs) + hierarchy_information: "_models.HierarchyInformation", + filterable_property: Optional[List["_models.FilterableProperty"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword hierarchy_information: Product hierarchy information. Required. + :paramtype hierarchy_information: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation + :keyword filterable_property: Filters specific to product. + :paramtype filterable_property: + list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] + """ + super().__init__(**kwargs) self.hierarchy_information = hierarchy_information self.filterable_property = filterable_property @@ -640,134 +660,141 @@ class ConfigurationProperties(CommonProperties): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'specifications': {'readonly': True}, - 'dimensions': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'specifications': {'key': 'specifications', 'type': '[Specification]'}, - 'dimensions': {'key': 'dimensions', 'type': 'Dimensions'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationProperties, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "specifications": {"readonly": True}, + "dimensions": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "specifications": {"key": "specifications", "type": "[Specification]"}, + "dimensions": {"key": "dimensions", "type": "Dimensions"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.specifications = None self.dimensions = None -class Configurations(msrest.serialization.Model): +class Configurations(_serialization.Model): """The list of configurations. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of configurations. :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - :param next_link: Link for the next set of configurations. - :type next_link: str + :ivar next_link: Link for the next set of configurations. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Configuration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Configuration]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(Configurations, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of configurations. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link -class ConfigurationsRequest(msrest.serialization.Model): +class ConfigurationsRequest(_serialization.Model): """Configuration request object. All required parameters must be populated in order to send to Azure. - :param configuration_filters: Required. Holds details about product hierarchy information and - filterable property. - :type configuration_filters: + :ivar configuration_filters: Holds details about product hierarchy information and filterable + property. Required. + :vartype configuration_filters: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationFilters] - :param customer_subscription_details: Customer subscription properties. Clients can display + :ivar customer_subscription_details: Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details. - :type customer_subscription_details: + :vartype customer_subscription_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionDetails """ _validation = { - 'configuration_filters': {'required': True, 'unique': True}, + "configuration_filters": {"required": True, "unique": True}, } _attribute_map = { - 'configuration_filters': {'key': 'configurationFilters', 'type': '[ConfigurationFilters]'}, - 'customer_subscription_details': {'key': 'customerSubscriptionDetails', 'type': 'CustomerSubscriptionDetails'}, + "configuration_filters": {"key": "configurationFilters", "type": "[ConfigurationFilters]"}, + "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, } def __init__( self, *, - configuration_filters: List["ConfigurationFilters"], - customer_subscription_details: Optional["CustomerSubscriptionDetails"] = None, - **kwargs - ): - super(ConfigurationsRequest, self).__init__(**kwargs) + configuration_filters: List["_models.ConfigurationFilters"], + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, + **kwargs: Any + ) -> None: + """ + :keyword configuration_filters: Holds details about product hierarchy information and + filterable property. Required. + :paramtype configuration_filters: + list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationFilters] + :keyword customer_subscription_details: Customer subscription properties. Clients can display + available products to unregistered customers by explicitly passing subscription details. + :paramtype customer_subscription_details: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionDetails + """ + super().__init__(**kwargs) self.configuration_filters = configuration_filters self.customer_subscription_details = customer_subscription_details -class ContactDetails(msrest.serialization.Model): +class ContactDetails(_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] + :ivar contact_name: Contact name of the person. Required. + :vartype contact_name: str + :ivar phone: Phone number of the contact person. Required. + :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: List of Email-ids to be notified about job progress. Required. + :vartype email_list: list[str] """ _validation = { - 'contact_name': {'required': True}, - 'phone': {'required': True}, - 'email_list': {'required': True}, + "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]'}, + "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]"}, } def __init__( @@ -778,9 +805,21 @@ def __init__( email_list: List[str], phone_extension: Optional[str] = None, mobile: Optional[str] = None, - **kwargs - ): - super(ContactDetails, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword contact_name: Contact name of the person. Required. + :paramtype contact_name: str + :keyword phone: Phone number of the contact person. Required. + :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: List of Email-ids to be notified about job progress. Required. + :paramtype email_list: list[str] + """ + super().__init__(**kwargs) self.contact_name = contact_name self.phone = phone self.phone_extension = phone_extension @@ -788,7 +827,7 @@ def __init__( self.email_list = email_list -class CostInformation(msrest.serialization.Model): +class CostInformation(_serialization.Model): """Cost information for the product system. Variables are only populated by the server, and will be ignored when sending a request. @@ -801,94 +840,102 @@ class CostInformation(msrest.serialization.Model): """ _validation = { - 'billing_meter_details': {'readonly': True}, - 'billing_info_url': {'readonly': True}, + "billing_meter_details": {"readonly": True}, + "billing_info_url": {"readonly": True}, } _attribute_map = { - 'billing_meter_details': {'key': 'billingMeterDetails', 'type': '[BillingMeterDetails]'}, - 'billing_info_url': {'key': 'billingInfoUrl', 'type': 'str'}, + "billing_meter_details": {"key": "billingMeterDetails", "type": "[BillingMeterDetails]"}, + "billing_info_url": {"key": "billingInfoUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(CostInformation, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.billing_meter_details = None self.billing_info_url = None -class CustomerSubscriptionDetails(msrest.serialization.Model): - """Holds Customer subscription details. Clients can display available products to unregistered customers by explicitly passing subscription details. +class CustomerSubscriptionDetails(_serialization.Model): + """Holds Customer subscription details. Clients can display available products to unregistered + customers by explicitly passing subscription details. All required parameters must be populated in order to send to Azure. - :param registered_features: List of registered feature flags for subscription. - :type registered_features: + :ivar registered_features: List of registered feature flags for subscription. + :vartype registered_features: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionRegisteredFeatures] - :param location_placement_id: Location placement Id of a subscription. - :type location_placement_id: str - :param quota_id: Required. Quota ID of a subscription. - :type quota_id: str + :ivar location_placement_id: Location placement Id of a subscription. + :vartype location_placement_id: str + :ivar quota_id: Quota ID of a subscription. Required. + :vartype quota_id: str """ _validation = { - 'quota_id': {'required': True}, + "quota_id": {"required": True}, } _attribute_map = { - 'registered_features': {'key': 'registeredFeatures', 'type': '[CustomerSubscriptionRegisteredFeatures]'}, - 'location_placement_id': {'key': 'locationPlacementId', 'type': 'str'}, - 'quota_id': {'key': 'quotaId', 'type': 'str'}, + "registered_features": {"key": "registeredFeatures", "type": "[CustomerSubscriptionRegisteredFeatures]"}, + "location_placement_id": {"key": "locationPlacementId", "type": "str"}, + "quota_id": {"key": "quotaId", "type": "str"}, } def __init__( self, *, quota_id: str, - registered_features: Optional[List["CustomerSubscriptionRegisteredFeatures"]] = None, + registered_features: Optional[List["_models.CustomerSubscriptionRegisteredFeatures"]] = None, location_placement_id: Optional[str] = None, - **kwargs - ): - super(CustomerSubscriptionDetails, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword registered_features: List of registered feature flags for subscription. + :paramtype registered_features: + list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionRegisteredFeatures] + :keyword location_placement_id: Location placement Id of a subscription. + :paramtype location_placement_id: str + :keyword quota_id: Quota ID of a subscription. Required. + :paramtype quota_id: str + """ + super().__init__(**kwargs) self.registered_features = registered_features self.location_placement_id = location_placement_id self.quota_id = quota_id -class CustomerSubscriptionRegisteredFeatures(msrest.serialization.Model): +class CustomerSubscriptionRegisteredFeatures(_serialization.Model): """Represents subscription registered features. - :param name: Name of subscription registered feature. - :type name: str - :param state: State of subscription registered feature. - :type state: str + :ivar name: Name of subscription registered feature. + :vartype name: str + :ivar state: State of subscription registered feature. + :vartype state: str """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "state": {"key": "state", "type": "str"}, } - def __init__( - self, - *, - name: Optional[str] = None, - state: Optional[str] = None, - **kwargs - ): - super(CustomerSubscriptionRegisteredFeatures, self).__init__(**kwargs) + def __init__(self, *, name: Optional[str] = None, state: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of subscription registered feature. + :paramtype name: str + :keyword state: State of subscription registered feature. + :paramtype state: str + """ + super().__init__(**kwargs) self.name = name self.state = state -class Description(msrest.serialization.Model): +class Description(_serialization.Model): """Description related properties of a product system. Variables are only populated by the server, and will be ignored when sending a request. - :ivar description_type: Type of description. Possible values include: "Base". + :ivar description_type: Type of description. "Base" :vartype description_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DescriptionType :ivar short_description: Short description of the product system. @@ -904,28 +951,26 @@ class Description(msrest.serialization.Model): """ _validation = { - 'description_type': {'readonly': True}, - 'short_description': {'readonly': True}, - 'long_description': {'readonly': True}, - 'keywords': {'readonly': True}, - 'attributes': {'readonly': True}, - 'links': {'readonly': True}, + "description_type": {"readonly": True}, + "short_description": {"readonly": True}, + "long_description": {"readonly": True}, + "keywords": {"readonly": True}, + "attributes": {"readonly": True}, + "links": {"readonly": True}, } _attribute_map = { - 'description_type': {'key': 'descriptionType', 'type': 'str'}, - 'short_description': {'key': 'shortDescription', 'type': 'str'}, - 'long_description': {'key': 'longDescription', 'type': 'str'}, - 'keywords': {'key': 'keywords', 'type': '[str]'}, - 'attributes': {'key': 'attributes', 'type': '[str]'}, - 'links': {'key': 'links', 'type': '[Link]'}, + "description_type": {"key": "descriptionType", "type": "str"}, + "short_description": {"key": "shortDescription", "type": "str"}, + "long_description": {"key": "longDescription", "type": "str"}, + "keywords": {"key": "keywords", "type": "[str]"}, + "attributes": {"key": "attributes", "type": "[str]"}, + "links": {"key": "links", "type": "[Link]"}, } - def __init__( - self, - **kwargs - ): - super(Description, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.description_type = None self.short_description = None self.long_description = None @@ -934,7 +979,7 @@ def __init__( self.links = None -class DeviceDetails(msrest.serialization.Model): +class DeviceDetails(_serialization.Model): """Device details. Variables are only populated by the server, and will be ignored when sending a request. @@ -948,28 +993,26 @@ class DeviceDetails(msrest.serialization.Model): """ _validation = { - 'serial_number': {'readonly': True}, - 'management_resource_id': {'readonly': True}, - 'management_resource_tenant_id': {'readonly': True}, + "serial_number": {"readonly": True}, + "management_resource_id": {"readonly": True}, + "management_resource_tenant_id": {"readonly": True}, } _attribute_map = { - 'serial_number': {'key': 'serialNumber', 'type': 'str'}, - 'management_resource_id': {'key': 'managementResourceId', 'type': 'str'}, - 'management_resource_tenant_id': {'key': 'managementResourceTenantId', 'type': 'str'}, + "serial_number": {"key": "serialNumber", "type": "str"}, + "management_resource_id": {"key": "managementResourceId", "type": "str"}, + "management_resource_tenant_id": {"key": "managementResourceTenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DeviceDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.serial_number = None self.management_resource_id = None self.management_resource_tenant_id = None -class Dimensions(msrest.serialization.Model): +class Dimensions(_serialization.Model): """Dimensions of a configuration. Variables are only populated by the server, and will be ignored when sending a request. @@ -980,44 +1023,42 @@ class Dimensions(msrest.serialization.Model): :vartype height: float :ivar width: Width of the device. :vartype width: float - :ivar length_height_unit: Unit for the dimensions of length, height and width. Possible values - include: "IN", "CM". + :ivar length_height_unit: Unit for the dimensions of length, height and width. Known values + are: "IN" and "CM". :vartype length_height_unit: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.LengthHeightUnit :ivar weight: Weight of the device. :vartype weight: float :ivar depth: Depth of the device. :vartype depth: float - :ivar weight_unit: Unit for the dimensions of weight. Possible values include: "LBS", "KGS". + :ivar weight_unit: Unit for the dimensions of weight. Known values are: "LBS" and "KGS". :vartype weight_unit: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.WeightMeasurementUnit """ _validation = { - 'length': {'readonly': True}, - 'height': {'readonly': True}, - 'width': {'readonly': True}, - 'length_height_unit': {'readonly': True}, - 'weight': {'readonly': True}, - 'depth': {'readonly': True}, - 'weight_unit': {'readonly': True}, + "length": {"readonly": True}, + "height": {"readonly": True}, + "width": {"readonly": True}, + "length_height_unit": {"readonly": True}, + "weight": {"readonly": True}, + "depth": {"readonly": True}, + "weight_unit": {"readonly": True}, } _attribute_map = { - 'length': {'key': 'length', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'length_height_unit': {'key': 'lengthHeightUnit', 'type': 'str'}, - 'weight': {'key': 'weight', 'type': 'float'}, - 'depth': {'key': 'depth', 'type': 'float'}, - 'weight_unit': {'key': 'weightUnit', 'type': 'str'}, + "length": {"key": "length", "type": "float"}, + "height": {"key": "height", "type": "float"}, + "width": {"key": "width", "type": "float"}, + "length_height_unit": {"key": "lengthHeightUnit", "type": "str"}, + "weight": {"key": "weight", "type": "float"}, + "depth": {"key": "depth", "type": "float"}, + "weight_unit": {"key": "weightUnit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Dimensions, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.length = None self.height = None self.width = None @@ -1027,7 +1068,7 @@ def __init__( self.weight_unit = None -class DisplayInfo(msrest.serialization.Model): +class DisplayInfo(_serialization.Model): """Describes product display information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1039,49 +1080,51 @@ class DisplayInfo(msrest.serialization.Model): """ _validation = { - 'product_family_display_name': {'readonly': True}, - 'configuration_display_name': {'readonly': True}, + "product_family_display_name": {"readonly": True}, + "configuration_display_name": {"readonly": True}, } _attribute_map = { - 'product_family_display_name': {'key': 'productFamilyDisplayName', 'type': 'str'}, - 'configuration_display_name': {'key': 'configurationDisplayName', 'type': 'str'}, + "product_family_display_name": {"key": "productFamilyDisplayName", "type": "str"}, + "configuration_display_name": {"key": "configurationDisplayName", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DisplayInfo, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.product_family_display_name = None self.configuration_display_name = None -class EncryptionPreferences(msrest.serialization.Model): +class EncryptionPreferences(_serialization.Model): """Preferences related to the double encryption. - :param double_encryption_status: Double encryption status as entered by the customer. It is - compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Possible - values include: "Disabled", "Enabled". - :type double_encryption_status: str or + :ivar double_encryption_status: Double encryption status as entered by the customer. It is + compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known + values are: "Disabled" and "Enabled". + :vartype double_encryption_status: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DoubleEncryptionStatus """ _attribute_map = { - 'double_encryption_status': {'key': 'doubleEncryptionStatus', 'type': 'str'}, + "double_encryption_status": {"key": "doubleEncryptionStatus", "type": "str"}, } def __init__( - self, - *, - double_encryption_status: Optional[Union[str, "DoubleEncryptionStatus"]] = None, - **kwargs - ): - super(EncryptionPreferences, self).__init__(**kwargs) + self, *, double_encryption_status: Optional[Union[str, "_models.DoubleEncryptionStatus"]] = None, **kwargs: Any + ) -> None: + """ + :keyword double_encryption_status: Double encryption status as entered by the customer. It is + compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known + values are: "Disabled" and "Enabled". + :paramtype double_encryption_status: str or + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DoubleEncryptionStatus + """ + super().__init__(**kwargs) self.double_encryption_status = double_encryption_status -class ErrorAdditionalInfo(msrest.serialization.Model): +class ErrorAdditionalInfo(_serialization.Model): """The resource management error additional info. Variables are only populated by the server, and will be ignored when sending a request. @@ -1089,29 +1132,27 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: any + :vartype info: JSON """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.type = None self.info = None -class ErrorDetail(msrest.serialization.Model): +class ErrorDetail(_serialization.Model): """The error detail. Variables are only populated by the server, and will be ignored when sending a request. @@ -1130,26 +1171,24 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "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': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.code = None self.message = None self.target = None @@ -1157,62 +1196,65 @@ def __init__( self.additional_info = None -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). - :param error: The error object. - :type error: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorDetail + :ivar error: The error object. + :vartype error: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorDetail """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorDetail + """ + super().__init__(**kwargs) self.error = error -class FilterableProperty(msrest.serialization.Model): +class FilterableProperty(_serialization.Model): """Different types of filters supported and its values. All required parameters must be populated in order to send to Azure. - :param type: Required. Type of product filter. Possible values include: "ShipToCountries", + :ivar type: Type of product filter. Required. Known values are: "ShipToCountries" and "DoubleEncryptionStatus". - :type type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SupportedFilterTypes - :param supported_values: Required. Values to be filtered. - :type supported_values: list[str] + :vartype type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SupportedFilterTypes + :ivar supported_values: Values to be filtered. Required. + :vartype supported_values: list[str] """ _validation = { - 'type': {'required': True}, - 'supported_values': {'required': True}, + "type": {"required": True}, + "supported_values": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'supported_values': {'key': 'supportedValues', 'type': '[str]'}, + "type": {"key": "type", "type": "str"}, + "supported_values": {"key": "supportedValues", "type": "[str]"}, } def __init__( - self, - *, - type: Union[str, "SupportedFilterTypes"], - supported_values: List[str], - **kwargs - ): - super(FilterableProperty, self).__init__(**kwargs) + self, *, type: Union[str, "_models.SupportedFilterTypes"], supported_values: List[str], **kwargs: Any + ) -> None: + """ + :keyword type: Type of product filter. Required. Known values are: "ShipToCountries" and + "DoubleEncryptionStatus". + :paramtype type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SupportedFilterTypes + :keyword supported_values: Values to be filtered. Required. + :paramtype supported_values: list[str] + """ + super().__init__(**kwargs) self.type = type self.supported_values = supported_values -class ForwardShippingDetails(msrest.serialization.Model): +class ForwardShippingDetails(_serialization.Model): """Forward shipment details. Variables are only populated by the server, and will be ignored when sending a request. @@ -1229,50 +1271,47 @@ class ForwardShippingDetails(msrest.serialization.Model): """ _validation = { - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "carrier_name": {"readonly": True}, + "carrier_display_name": {"readonly": True}, + "tracking_id": {"readonly": True}, + "tracking_url": {"readonly": True}, } _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ForwardShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.carrier_name = None self.carrier_display_name = None self.tracking_id = None self.tracking_url = None -class HierarchyInformation(msrest.serialization.Model): +class HierarchyInformation(_serialization.Model): """Holds details about product hierarchy information. - :param product_family_name: Represents product family name that uniquely identifies product + :ivar product_family_name: Represents product family name that uniquely identifies product family. - :type product_family_name: str - :param product_line_name: Represents product line name that uniquely identifies product line. - :type product_line_name: str - :param product_name: Represents product name that uniquely identifies product. - :type product_name: str - :param configuration_name: Represents configuration name that uniquely identifies - configuration. - :type configuration_name: str + :vartype product_family_name: str + :ivar product_line_name: Represents product line name that uniquely identifies product line. + :vartype product_line_name: str + :ivar product_name: Represents product name that uniquely identifies product. + :vartype product_name: str + :ivar configuration_name: Represents configuration name that uniquely identifies configuration. + :vartype configuration_name: str """ _attribute_map = { - 'product_family_name': {'key': 'productFamilyName', 'type': 'str'}, - 'product_line_name': {'key': 'productLineName', 'type': 'str'}, - 'product_name': {'key': 'productName', 'type': 'str'}, - 'configuration_name': {'key': 'configurationName', 'type': 'str'}, + "product_family_name": {"key": "productFamilyName", "type": "str"}, + "product_line_name": {"key": "productLineName", "type": "str"}, + "product_name": {"key": "productName", "type": "str"}, + "configuration_name": {"key": "configurationName", "type": "str"}, } def __init__( @@ -1282,21 +1321,33 @@ def __init__( product_line_name: Optional[str] = None, product_name: Optional[str] = None, configuration_name: Optional[str] = None, - **kwargs - ): - super(HierarchyInformation, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword product_family_name: Represents product family name that uniquely identifies product + family. + :paramtype product_family_name: str + :keyword product_line_name: Represents product line name that uniquely identifies product line. + :paramtype product_line_name: str + :keyword product_name: Represents product name that uniquely identifies product. + :paramtype product_name: str + :keyword configuration_name: Represents configuration name that uniquely identifies + configuration. + :paramtype configuration_name: str + """ + super().__init__(**kwargs) self.product_family_name = product_family_name self.product_line_name = product_line_name self.product_name = product_name self.configuration_name = configuration_name -class ImageInformation(msrest.serialization.Model): +class ImageInformation(_serialization.Model): """Image for the product. Variables are only populated by the server, and will be ignored when sending a request. - :ivar image_type: Type of the image. Possible values include: "MainImage", "BulletImage", + :ivar image_type: Type of the image. Known values are: "MainImage", "BulletImage", and "GenericImage". :vartype image_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageType :ivar image_url: Url of the image. @@ -1304,156 +1355,149 @@ class ImageInformation(msrest.serialization.Model): """ _validation = { - 'image_type': {'readonly': True}, - 'image_url': {'readonly': True}, + "image_type": {"readonly": True}, + "image_url": {"readonly": True}, } _attribute_map = { - 'image_type': {'key': 'imageType', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, + "image_type": {"key": "imageType", "type": "str"}, + "image_url": {"key": "imageUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ImageInformation, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.image_type = None self.image_url = None -class Link(msrest.serialization.Model): +class Link(_serialization.Model): """Returns link related to the product. Variables are only populated by the server, and will be ignored when sending a request. - :ivar link_type: Type of link. Possible values include: "Generic", "TermsAndConditions", - "Specification", "Documentation", "KnowMore", "SignUp". + :ivar link_type: Type of link. Known values are: "Generic", "TermsAndConditions", + "Specification", "Documentation", "KnowMore", and "SignUp". :vartype link_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.LinkType :ivar link_url: Url of the link. :vartype link_url: str """ _validation = { - 'link_type': {'readonly': True}, - 'link_url': {'readonly': True}, + "link_type": {"readonly": True}, + "link_url": {"readonly": True}, } _attribute_map = { - 'link_type': {'key': 'linkType', 'type': 'str'}, - 'link_url': {'key': 'linkUrl', 'type': 'str'}, + "link_type": {"key": "linkType", "type": "str"}, + "link_url": {"key": "linkUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Link, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.link_type = None self.link_url = None -class ManagementResourcePreferences(msrest.serialization.Model): +class ManagementResourcePreferences(_serialization.Model): """Management resource preference to link device. - :param preferred_management_resource_id: Customer preferred Management resource ARM ID. - :type preferred_management_resource_id: str + :ivar preferred_management_resource_id: Customer preferred Management resource ARM ID. + :vartype preferred_management_resource_id: str """ _attribute_map = { - 'preferred_management_resource_id': {'key': 'preferredManagementResourceId', 'type': 'str'}, + "preferred_management_resource_id": {"key": "preferredManagementResourceId", "type": "str"}, } - def __init__( - self, - *, - preferred_management_resource_id: Optional[str] = None, - **kwargs - ): - super(ManagementResourcePreferences, self).__init__(**kwargs) + def __init__(self, *, preferred_management_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword preferred_management_resource_id: Customer preferred Management resource ARM ID. + :paramtype preferred_management_resource_id: str + """ + super().__init__(**kwargs) self.preferred_management_resource_id = preferred_management_resource_id -class MeterDetails(msrest.serialization.Model): +class MeterDetails(_serialization.Model): """Holds details about billing type and its meter guids. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Pav2MeterDetails, PurchaseMeterDetails. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + Pav2MeterDetails, PurchaseMeterDetails 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 billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType + :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType :ivar multiplier: Billing unit applicable for Pav2 billing. :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". + :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". :vartype charging_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ChargingType """ _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, + "billing_type": {"required": True}, + "multiplier": {"readonly": True}, + "charging_type": {"readonly": True}, } _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, + "billing_type": {"key": "billingType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, + "charging_type": {"key": "chargingType", "type": "str"}, } - _subtype_map = { - 'billing_type': {'Pav2': 'Pav2MeterDetails', 'Purchase': 'PurchaseMeterDetails'} - } + _subtype_map = {"billing_type": {"Pav2": "Pav2MeterDetails", "Purchase": "PurchaseMeterDetails"}} - def __init__( - self, - **kwargs - ): - super(MeterDetails, self).__init__(**kwargs) - self.billing_type = None # type: Optional[str] + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_type: Optional[str] = None self.multiplier = None self.charging_type = None -class NotificationPreference(msrest.serialization.Model): +class NotificationPreference(_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: "Shipped", - "Delivered". - :type stage_name: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :ivar stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". + :vartype stage_name: str or + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.NotificationStageName + :ivar send_notification: Notification is required or not. Required. + :vartype send_notification: bool """ _validation = { - 'stage_name': {'required': True}, - 'send_notification': {'required': True}, + "stage_name": {"required": True}, + "send_notification": {"required": True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, + "stage_name": {"key": "stageName", "type": "str"}, + "send_notification": {"key": "sendNotification", "type": "bool"}, } def __init__( - self, - *, - stage_name: Union[str, "NotificationStageName"], - send_notification: bool, - **kwargs - ): - super(NotificationPreference, self).__init__(**kwargs) + self, *, stage_name: Union[str, "_models.NotificationStageName"], send_notification: bool, **kwargs: Any + ) -> None: + """ + :keyword stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". + :paramtype stage_name: str or + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.NotificationStageName + :keyword send_notification: Notification is required or not. Required. + :paramtype send_notification: bool + """ + super().__init__(**kwargs) self.stage_name = stage_name self.send_notification = send_notification -class Operation(msrest.serialization.Model): +class Operation(_serialization.Model): """Details of a REST API operation, returned from the Resource Provider Operations API. Variables are only populated by the server, and will be ignored when sending a request. @@ -1464,39 +1508,38 @@ class Operation(msrest.serialization.Model): :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. :vartype is_data_action: bool - :param display: Localized display information for this particular operation. - :type display: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OperationDisplay + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OperationDisplay :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". :vartype origin: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Origin :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". + internal only APIs. "Internal" :vartype action_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ActionType """ _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, + "name": {"readonly": True}, + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + "action_type": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "origin": {"key": "origin", "type": "str"}, + "action_type": {"key": "actionType", "type": "str"}, } - def __init__( - self, - *, - display: Optional["OperationDisplay"] = None, - **kwargs - ): - super(Operation, self).__init__(**kwargs) + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: + """ + :keyword display: Localized display information for this particular operation. + :paramtype display: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OperationDisplay + """ + super().__init__(**kwargs) self.name = None self.is_data_action = None self.display = display @@ -1504,7 +1547,7 @@ def __init__( self.action_type = None -class OperationDisplay(msrest.serialization.Model): +class OperationDisplay(_serialization.Model): """Localized display information for this particular operation. Variables are only populated by the server, and will be ignored when sending a request. @@ -1524,32 +1567,31 @@ class OperationDisplay(msrest.serialization.Model): """ _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, + "provider": {"readonly": True}, + "resource": {"readonly": True}, + "operation": {"readonly": True}, + "description": {"readonly": True}, } _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "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) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.provider = None self.resource = None self.operation = None self.description = None -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. +class OperationListResult(_serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -1560,65 +1602,62 @@ class OperationListResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.value = None self.next_link = None -class OrderItemDetails(msrest.serialization.Model): +class OrderItemDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes """Order item 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 product_details: Required. Unique identifier for configuration. - :type product_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductDetails - :param order_item_type: Required. Order item type. Possible values include: "Purchase", - "Rental". - :type order_item_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemType + :ivar product_details: Unique identifier for configuration. Required. + :vartype product_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductDetails + :ivar order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". + :vartype order_item_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemType :ivar current_stage: Current Order item Status. :vartype current_stage: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails :ivar order_item_stage_history: Order item status history. :vartype order_item_stage_history: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails] - :param preferences: Customer notification Preferences. - :type preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences + :ivar preferences: Customer notification Preferences. + :vartype preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences :ivar forward_shipping_details: Forward Package Shipping details. :vartype forward_shipping_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ForwardShippingDetails :ivar reverse_shipping_details: Reverse Package Shipping details. :vartype reverse_shipping_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReverseShippingDetails - :param notification_email_list: Additional notification email list. - :type notification_email_list: list[str] + :ivar notification_email_list: Additional notification email list. + :vartype notification_email_list: list[str] :ivar cancellation_reason: Cancellation reason. :vartype cancellation_reason: str - :ivar cancellation_status: Describes whether the order item is cancellable or not. Possible - values include: "Cancellable", "CancellableWithFee", "NotCancellable". + :ivar cancellation_status: Describes whether the order item is cancellable or not. Known values + are: "Cancellable", "CancellableWithFee", and "NotCancellable". :vartype cancellation_status: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemCancellationEnum - :ivar deletion_status: Describes whether the order item is deletable or not. Possible values - include: "Allowed", "NotAllowed". + :ivar deletion_status: Describes whether the order item is deletable or not. Known values are: + "Allowed" and "NotAllowed". :vartype deletion_status: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ActionStatusEnum :ivar return_reason: Return reason. :vartype return_reason: str - :ivar return_status: Describes whether the order item is returnable or not. Possible values - include: "Returnable", "ReturnableWithFee", "NotReturnable". + :ivar return_status: Describes whether the order item is returnable or not. Known values are: + "Returnable", "ReturnableWithFee", and "NotReturnable". :vartype return_status: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemReturnEnum :ivar management_rp_details: Parent RP details - this returns only the first or default parent @@ -1633,51 +1672,62 @@ class OrderItemDetails(msrest.serialization.Model): """ _validation = { - 'product_details': {'required': True}, - 'order_item_type': {'required': True}, - 'current_stage': {'readonly': True}, - 'order_item_stage_history': {'readonly': True}, - 'forward_shipping_details': {'readonly': True}, - 'reverse_shipping_details': {'readonly': True}, - 'cancellation_reason': {'readonly': True}, - 'cancellation_status': {'readonly': True}, - 'deletion_status': {'readonly': True}, - 'return_reason': {'readonly': True}, - 'return_status': {'readonly': True}, - 'management_rp_details': {'readonly': True}, - 'management_rp_details_list': {'readonly': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'product_details': {'key': 'productDetails', 'type': 'ProductDetails'}, - 'order_item_type': {'key': 'orderItemType', 'type': 'str'}, - 'current_stage': {'key': 'currentStage', 'type': 'StageDetails'}, - 'order_item_stage_history': {'key': 'orderItemStageHistory', 'type': '[StageDetails]'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'forward_shipping_details': {'key': 'forwardShippingDetails', 'type': 'ForwardShippingDetails'}, - 'reverse_shipping_details': {'key': 'reverseShippingDetails', 'type': 'ReverseShippingDetails'}, - 'notification_email_list': {'key': 'notificationEmailList', 'type': '[str]'}, - 'cancellation_reason': {'key': 'cancellationReason', 'type': 'str'}, - 'cancellation_status': {'key': 'cancellationStatus', 'type': 'str'}, - 'deletion_status': {'key': 'deletionStatus', 'type': 'str'}, - 'return_reason': {'key': 'returnReason', 'type': 'str'}, - 'return_status': {'key': 'returnStatus', 'type': 'str'}, - 'management_rp_details': {'key': 'managementRpDetails', 'type': 'ResourceProviderDetails'}, - 'management_rp_details_list': {'key': 'managementRpDetailsList', 'type': '[ResourceProviderDetails]'}, - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "product_details": {"required": True}, + "order_item_type": {"required": True}, + "current_stage": {"readonly": True}, + "order_item_stage_history": {"readonly": True}, + "forward_shipping_details": {"readonly": True}, + "reverse_shipping_details": {"readonly": True}, + "cancellation_reason": {"readonly": True}, + "cancellation_status": {"readonly": True}, + "deletion_status": {"readonly": True}, + "return_reason": {"readonly": True}, + "return_status": {"readonly": True}, + "management_rp_details": {"readonly": True}, + "management_rp_details_list": {"readonly": True}, + "error": {"readonly": True}, + } + + _attribute_map = { + "product_details": {"key": "productDetails", "type": "ProductDetails"}, + "order_item_type": {"key": "orderItemType", "type": "str"}, + "current_stage": {"key": "currentStage", "type": "StageDetails"}, + "order_item_stage_history": {"key": "orderItemStageHistory", "type": "[StageDetails]"}, + "preferences": {"key": "preferences", "type": "Preferences"}, + "forward_shipping_details": {"key": "forwardShippingDetails", "type": "ForwardShippingDetails"}, + "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, + "notification_email_list": {"key": "notificationEmailList", "type": "[str]"}, + "cancellation_reason": {"key": "cancellationReason", "type": "str"}, + "cancellation_status": {"key": "cancellationStatus", "type": "str"}, + "deletion_status": {"key": "deletionStatus", "type": "str"}, + "return_reason": {"key": "returnReason", "type": "str"}, + "return_status": {"key": "returnStatus", "type": "str"}, + "management_rp_details": {"key": "managementRpDetails", "type": "ResourceProviderDetails"}, + "management_rp_details_list": {"key": "managementRpDetailsList", "type": "[ResourceProviderDetails]"}, + "error": {"key": "error", "type": "ErrorDetail"}, } def __init__( self, *, - product_details: "ProductDetails", - order_item_type: Union[str, "OrderItemType"], - preferences: Optional["Preferences"] = None, + product_details: "_models.ProductDetails", + order_item_type: Union[str, "_models.OrderItemType"], + preferences: Optional["_models.Preferences"] = None, notification_email_list: Optional[List[str]] = None, - **kwargs - ): - super(OrderItemDetails, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword product_details: Unique identifier for configuration. Required. + :paramtype product_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductDetails + :keyword order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". + :paramtype order_item_type: str or + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemType + :keyword preferences: Customer notification Preferences. + :paramtype preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences + :keyword notification_email_list: Additional notification email list. + :paramtype notification_email_list: list[str] + """ + super().__init__(**kwargs) self.product_details = product_details self.order_item_type = order_item_type self.current_stage = None @@ -1711,58 +1761,71 @@ class OrderItemResource(TrackedResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar system_data: Represents resource creation and update time. :vartype system_data: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SystemData - :param order_item_details: Required. Represents order item details. - :type order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemDetails - :param address_details: Required. Represents shipping and return address for order item. - :type address_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressDetails + :ivar order_item_details: Represents order item details. Required. + :vartype order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemDetails + :ivar address_details: Represents shipping and return address for order item. Required. + :vartype address_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressDetails :ivar start_time: Start time of order item. :vartype start_time: ~datetime.datetime - :param order_id: Required. Id of the order to which order item belongs to. - :type order_id: str + :ivar order_id: Id of the order to which order item belongs to. Required. + :vartype order_id: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'order_item_details': {'required': True}, - 'address_details': {'required': True}, - 'start_time': {'readonly': True}, - 'order_id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'order_item_details': {'key': 'properties.orderItemDetails', 'type': 'OrderItemDetails'}, - 'address_details': {'key': 'properties.addressDetails', 'type': 'AddressDetails'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'order_id': {'key': 'properties.orderId', 'type': 'str'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, + "system_data": {"readonly": True}, + "order_item_details": {"required": True}, + "address_details": {"required": True}, + "start_time": {"readonly": True}, + "order_id": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "order_item_details": {"key": "properties.orderItemDetails", "type": "OrderItemDetails"}, + "address_details": {"key": "properties.addressDetails", "type": "AddressDetails"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "order_id": {"key": "properties.orderId", "type": "str"}, } def __init__( self, *, location: str, - order_item_details: "OrderItemDetails", - address_details: "AddressDetails", + order_item_details: "_models.OrderItemDetails", + address_details: "_models.AddressDetails", order_id: str, tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(OrderItemResource, self).__init__(tags=tags, location=location, **kwargs) + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword order_item_details: Represents order item details. Required. + :paramtype order_item_details: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemDetails + :keyword address_details: Represents shipping and return address for order item. Required. + :paramtype address_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressDetails + :keyword order_id: Id of the order to which order item belongs to. Required. + :paramtype order_id: str + """ + super().__init__(tags=tags, location=location, **kwargs) self.system_data = None self.order_item_details = order_item_details self.address_details = address_details @@ -1770,68 +1833,78 @@ def __init__( self.order_id = order_id -class OrderItemResourceList(msrest.serialization.Model): +class OrderItemResourceList(_serialization.Model): """List of orderItems. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of order item resources. :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :param next_link: Link for the next set of order item resources. - :type next_link: str + :ivar next_link: Link for the next set of order item resources. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[OrderItemResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[OrderItemResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(OrderItemResourceList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of order item resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link -class OrderItemUpdateParameter(msrest.serialization.Model): +class OrderItemUpdateParameter(_serialization.Model): """Updates order item parameters. - :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 forward_address: Updates forward shipping address and contact details. - :type forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - :param preferences: Customer preference. - :type preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences - :param notification_email_list: Additional notification email list. - :type notification_email_list: list[str] + :ivar 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 forward_address: Updates forward shipping address and contact details. + :vartype forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties + :ivar preferences: Customer preference. + :vartype preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences + :ivar notification_email_list: Additional notification email list. + :vartype notification_email_list: list[str] """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'forward_address': {'key': 'properties.forwardAddress', 'type': 'AddressProperties'}, - 'preferences': {'key': 'properties.preferences', 'type': 'Preferences'}, - 'notification_email_list': {'key': 'properties.notificationEmailList', 'type': '[str]'}, + "tags": {"key": "tags", "type": "{str}"}, + "forward_address": {"key": "properties.forwardAddress", "type": "AddressProperties"}, + "preferences": {"key": "properties.preferences", "type": "Preferences"}, + "notification_email_list": {"key": "properties.notificationEmailList", "type": "[str]"}, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, - forward_address: Optional["AddressProperties"] = None, - preferences: Optional["Preferences"] = None, + forward_address: Optional["_models.AddressProperties"] = None, + preferences: Optional["_models.Preferences"] = None, notification_email_list: Optional[List[str]] = None, - **kwargs - ): - super(OrderItemUpdateParameter, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword 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 forward_address: Updates forward shipping address and contact details. + :paramtype forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties + :keyword preferences: Customer preference. + :paramtype preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences + :keyword notification_email_list: Additional notification email list. + :paramtype notification_email_list: list[str] + """ + super().__init__(**kwargs) self.tags = tags self.forward_address = forward_address self.preferences = preferences @@ -1839,7 +1912,8 @@ def __init__( class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -1854,26 +1928,25 @@ class ProxyResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) class OrderResource(ProxyResource): - """Specifies the properties or parameters for an order. Order is a grouping of one or more order items. + """Specifies the properties or parameters for an order. Order is a grouping of one or more order + items. Variables are only populated by the server, and will be ignored when sending a request. @@ -1897,63 +1970,60 @@ class OrderResource(ProxyResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'order_item_ids': {'readonly': True}, - 'current_stage': {'readonly': True}, - 'order_stage_history': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "order_item_ids": {"readonly": True}, + "current_stage": {"readonly": True}, + "order_stage_history": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'order_item_ids': {'key': 'properties.orderItemIds', 'type': '[str]'}, - 'current_stage': {'key': 'properties.currentStage', 'type': 'StageDetails'}, - 'order_stage_history': {'key': 'properties.orderStageHistory', 'type': '[StageDetails]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "order_item_ids": {"key": "properties.orderItemIds", "type": "[str]"}, + "current_stage": {"key": "properties.currentStage", "type": "StageDetails"}, + "order_stage_history": {"key": "properties.orderStageHistory", "type": "[StageDetails]"}, } - def __init__( - self, - **kwargs - ): - super(OrderResource, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.system_data = None self.order_item_ids = None self.current_stage = None self.order_stage_history = None -class OrderResourceList(msrest.serialization.Model): +class OrderResourceList(_serialization.Model): """List of orders. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of order resources. :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] - :param next_link: Link for the next set of order resources. - :type next_link: str + :ivar next_link: Link for the next set of order resources. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[OrderResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[OrderResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(OrderResourceList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of order resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link @@ -1965,81 +2035,95 @@ class Pav2MeterDetails(MeterDetails): All required parameters must be populated in order to send to Azure. - :param billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType + :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType :ivar multiplier: Billing unit applicable for Pav2 billing. :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". + :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". :vartype charging_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ChargingType :ivar meter_guid: Validation status of requested data center and transport. :vartype meter_guid: str """ _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - 'meter_guid': {'readonly': True}, + "billing_type": {"required": True}, + "multiplier": {"readonly": True}, + "charging_type": {"readonly": True}, + "meter_guid": {"readonly": True}, } _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - 'meter_guid': {'key': 'meterGuid', 'type': 'str'}, + "billing_type": {"key": "billingType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, + "charging_type": {"key": "chargingType", "type": "str"}, + "meter_guid": {"key": "meterGuid", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Pav2MeterDetails, self).__init__(**kwargs) - self.billing_type = 'Pav2' # type: str + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_type: str = "Pav2" self.meter_guid = None -class Preferences(msrest.serialization.Model): +class Preferences(_serialization.Model): """Preferences related to the order. - :param notification_preferences: Notification preferences. - :type notification_preferences: + :ivar notification_preferences: Notification preferences. + :vartype notification_preferences: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.NotificationPreference] - :param transport_preferences: Preferences related to the shipment logistics of the order. - :type transport_preferences: + :ivar transport_preferences: Preferences related to the shipment logistics of the order. + :vartype transport_preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.TransportPreferences - :param encryption_preferences: Preferences related to the Encryption. - :type encryption_preferences: + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.EncryptionPreferences - :param management_resource_preferences: Preferences related to the Management resource. - :type management_resource_preferences: + :ivar management_resource_preferences: Preferences related to the Management resource. + :vartype management_resource_preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ManagementResourcePreferences """ _attribute_map = { - 'notification_preferences': {'key': 'notificationPreferences', 'type': '[NotificationPreference]'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, - 'management_resource_preferences': {'key': 'managementResourcePreferences', 'type': 'ManagementResourcePreferences'}, + "notification_preferences": {"key": "notificationPreferences", "type": "[NotificationPreference]"}, + "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, + "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, + "management_resource_preferences": { + "key": "managementResourcePreferences", + "type": "ManagementResourcePreferences", + }, } def __init__( self, *, - notification_preferences: Optional[List["NotificationPreference"]] = None, - transport_preferences: Optional["TransportPreferences"] = None, - encryption_preferences: Optional["EncryptionPreferences"] = None, - management_resource_preferences: Optional["ManagementResourcePreferences"] = None, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) + notification_preferences: Optional[List["_models.NotificationPreference"]] = None, + transport_preferences: Optional["_models.TransportPreferences"] = None, + encryption_preferences: Optional["_models.EncryptionPreferences"] = None, + management_resource_preferences: Optional["_models.ManagementResourcePreferences"] = None, + **kwargs: Any + ) -> None: + """ + :keyword notification_preferences: Notification preferences. + :paramtype notification_preferences: + list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.NotificationPreference] + :keyword transport_preferences: Preferences related to the shipment logistics of the order. + :paramtype transport_preferences: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.TransportPreferences + :keyword encryption_preferences: Preferences related to the Encryption. + :paramtype encryption_preferences: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.EncryptionPreferences + :keyword management_resource_preferences: Preferences related to the Management resource. + :paramtype management_resource_preferences: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ManagementResourcePreferences + """ + super().__init__(**kwargs) self.notification_preferences = notification_preferences self.transport_preferences = transport_preferences self.encryption_preferences = encryption_preferences self.management_resource_preferences = management_resource_preferences -class Product(msrest.serialization.Model): +class Product(_serialization.Model): """List of Products. Variables are only populated by the server, and will be ignored when sending a request. @@ -2067,32 +2151,30 @@ class Product(msrest.serialization.Model): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'configurations': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'configurations': {'key': 'properties.configurations', 'type': '[Configuration]'}, - } - - def __init__( - self, - **kwargs - ): - super(Product, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "configurations": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "configurations": {"key": "properties.configurations", "type": "[Configuration]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -2103,23 +2185,23 @@ def __init__( self.configurations = None -class ProductDetails(msrest.serialization.Model): +class ProductDetails(_serialization.Model): """Represents product 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 display_info: Display details of the product. - :type display_info: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DisplayInfo - :param hierarchy_information: Required. Hierarchy of the product which uniquely identifies the - product. - :type hierarchy_information: + :ivar display_info: Display details of the product. + :vartype display_info: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DisplayInfo + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the product. + Required. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation :ivar count: Quantity of the product. :vartype count: int :ivar product_double_encryption_status: Double encryption status of the configuration. - Read-only field. Possible values include: "Disabled", "Enabled". + Read-only field. Known values are: "Disabled" and "Enabled". :vartype product_double_encryption_status: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DoubleEncryptionStatus :ivar device_details: list of device details. @@ -2127,28 +2209,36 @@ class ProductDetails(msrest.serialization.Model): """ _validation = { - 'hierarchy_information': {'required': True}, - 'count': {'readonly': True}, - 'product_double_encryption_status': {'readonly': True}, - 'device_details': {'readonly': True}, + "hierarchy_information": {"required": True}, + "count": {"readonly": True}, + "product_double_encryption_status": {"readonly": True}, + "device_details": {"readonly": True}, } _attribute_map = { - 'display_info': {'key': 'displayInfo', 'type': 'DisplayInfo'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'count': {'key': 'count', 'type': 'int'}, - 'product_double_encryption_status': {'key': 'productDoubleEncryptionStatus', 'type': 'str'}, - 'device_details': {'key': 'deviceDetails', 'type': '[DeviceDetails]'}, + "display_info": {"key": "displayInfo", "type": "DisplayInfo"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "count": {"key": "count", "type": "int"}, + "product_double_encryption_status": {"key": "productDoubleEncryptionStatus", "type": "str"}, + "device_details": {"key": "deviceDetails", "type": "[DeviceDetails]"}, } def __init__( self, *, - hierarchy_information: "HierarchyInformation", - display_info: Optional["DisplayInfo"] = None, - **kwargs - ): - super(ProductDetails, self).__init__(**kwargs) + hierarchy_information: "_models.HierarchyInformation", + display_info: Optional["_models.DisplayInfo"] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_info: Display details of the product. + :paramtype display_info: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DisplayInfo + :keyword hierarchy_information: Hierarchy of the product which uniquely identifies the product. + Required. + :paramtype hierarchy_information: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation + """ + super().__init__(**kwargs) self.display_info = display_info self.hierarchy_information = hierarchy_information self.count = None @@ -2156,38 +2246,37 @@ def __init__( self.device_details = None -class ProductFamilies(msrest.serialization.Model): +class ProductFamilies(_serialization.Model): """The list of product families. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of product families. :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] - :param next_link: Link for the next set of product families. - :type next_link: str + :ivar next_link: Link for the next set of product families. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductFamily]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ProductFamily]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(ProductFamilies, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of product families. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link -class ProductFamiliesMetadata(msrest.serialization.Model): +class ProductFamiliesMetadata(_serialization.Model): """Holds details about product family metadata. Variables are only populated by the server, and will be ignored when sending a request. @@ -2200,25 +2289,23 @@ class ProductFamiliesMetadata(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductFamiliesMetadataDetails]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ProductFamiliesMetadataDetails]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ProductFamiliesMetadata, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.value = None self.next_link = None -class ProductFamiliesMetadataDetails(msrest.serialization.Model): +class ProductFamiliesMetadataDetails(_serialization.Model): """Product families metadata details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2243,41 +2330,43 @@ class ProductFamiliesMetadataDetails(msrest.serialization.Model): list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] :ivar product_lines: List of product lines supported in the product family. :vartype product_lines: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'properties.productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'properties.resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - *, - resource_provider_details: Optional[List["ResourceProviderDetails"]] = None, - **kwargs - ): - super(ProductFamiliesMetadataDetails, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "product_lines": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, + "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, + } + + def __init__( + self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_provider_details: Contains details related to resource provider. + :paramtype resource_provider_details: + list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] + """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -2289,42 +2378,52 @@ def __init__( self.resource_provider_details = resource_provider_details -class ProductFamiliesRequest(msrest.serialization.Model): +class ProductFamiliesRequest(_serialization.Model): """The filters for showing the product families. All required parameters must be populated in order to send to Azure. - :param filterable_properties: Required. Dictionary of filterable properties on product family. - :type filterable_properties: dict[str, + :ivar filterable_properties: Dictionary of filterable properties on product family. Required. + :vartype filterable_properties: dict[str, list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty]] - :param customer_subscription_details: Customer subscription properties. Clients can display + :ivar customer_subscription_details: Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details. - :type customer_subscription_details: + :vartype customer_subscription_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionDetails """ _validation = { - 'filterable_properties': {'required': True}, + "filterable_properties": {"required": True}, } _attribute_map = { - 'filterable_properties': {'key': 'filterableProperties', 'type': '{[FilterableProperty]}'}, - 'customer_subscription_details': {'key': 'customerSubscriptionDetails', 'type': 'CustomerSubscriptionDetails'}, + "filterable_properties": {"key": "filterableProperties", "type": "{[FilterableProperty]}"}, + "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, } def __init__( self, *, - filterable_properties: Dict[str, List["FilterableProperty"]], - customer_subscription_details: Optional["CustomerSubscriptionDetails"] = None, - **kwargs - ): - super(ProductFamiliesRequest, self).__init__(**kwargs) + filterable_properties: Dict[str, List["_models.FilterableProperty"]], + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, + **kwargs: Any + ) -> None: + """ + :keyword filterable_properties: Dictionary of filterable properties on product family. + Required. + :paramtype filterable_properties: dict[str, + list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty]] + :keyword customer_subscription_details: Customer subscription properties. Clients can display + available products to unregistered customers by explicitly passing subscription details. + :paramtype customer_subscription_details: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionDetails + """ + super().__init__(**kwargs) self.filterable_properties = filterable_properties self.customer_subscription_details = customer_subscription_details -class ProductFamily(msrest.serialization.Model): +class ProductFamily(_serialization.Model): """Product Family. Variables are only populated by the server, and will be ignored when sending a request. @@ -2349,41 +2448,43 @@ class ProductFamily(msrest.serialization.Model): list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] :ivar product_lines: List of product lines supported in the product family. :vartype product_lines: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'properties.productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'properties.resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - *, - resource_provider_details: Optional[List["ResourceProviderDetails"]] = None, - **kwargs - ): - super(ProductFamily, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "product_lines": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, + "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, + } + + def __init__( + self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_provider_details: Contains details related to resource provider. + :paramtype resource_provider_details: + list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] + """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -2420,46 +2521,48 @@ class ProductFamilyProperties(CommonProperties): list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] :ivar product_lines: List of product lines supported in the product family. :vartype product_lines: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - *, - resource_provider_details: Optional[List["ResourceProviderDetails"]] = None, - **kwargs - ): - super(ProductFamilyProperties, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "product_lines": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "product_lines": {"key": "productLines", "type": "[ProductLine]"}, + "resource_provider_details": {"key": "resourceProviderDetails", "type": "[ResourceProviderDetails]"}, + } + + def __init__( + self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_provider_details: Contains details related to resource provider. + :paramtype resource_provider_details: + list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] + """ + super().__init__(**kwargs) self.product_lines = None self.resource_provider_details = resource_provider_details -class ProductLine(msrest.serialization.Model): +class ProductLine(_serialization.Model): """Product line. Variables are only populated by the server, and will be ignored when sending a request. @@ -2487,32 +2590,30 @@ class ProductLine(msrest.serialization.Model): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'products': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'products': {'key': 'properties.products', 'type': '[Product]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductLine, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "products": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "products": {"key": "properties.products", "type": "[Product]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -2551,32 +2652,30 @@ class ProductLineProperties(CommonProperties): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'products': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'products': {'key': 'products', 'type': '[Product]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductLineProperties, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "products": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "products": {"key": "products", "type": "[Product]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.products = None @@ -2608,32 +2707,30 @@ class ProductProperties(CommonProperties): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'configurations': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'configurations': {'key': 'configurations', 'type': '[Configuration]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductProperties, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "configurations": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "configurations": {"key": "configurations", "type": "[Configuration]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.configurations = None @@ -2644,12 +2741,11 @@ class PurchaseMeterDetails(MeterDetails): All required parameters must be populated in order to send to Azure. - :param billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType + :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType :ivar multiplier: Billing unit applicable for Pav2 billing. :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". + :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". :vartype charging_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ChargingType :ivar product_id: Product Id. :vartype product_id: str @@ -2660,41 +2756,39 @@ class PurchaseMeterDetails(MeterDetails): """ _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - 'product_id': {'readonly': True}, - 'sku_id': {'readonly': True}, - 'term_id': {'readonly': True}, + "billing_type": {"required": True}, + "multiplier": {"readonly": True}, + "charging_type": {"readonly": True}, + "product_id": {"readonly": True}, + "sku_id": {"readonly": True}, + "term_id": {"readonly": True}, } _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - 'product_id': {'key': 'productId', 'type': 'str'}, - 'sku_id': {'key': 'skuId', 'type': 'str'}, - 'term_id': {'key': 'termId', 'type': 'str'}, + "billing_type": {"key": "billingType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, + "charging_type": {"key": "chargingType", "type": "str"}, + "product_id": {"key": "productId", "type": "str"}, + "sku_id": {"key": "skuId", "type": "str"}, + "term_id": {"key": "termId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(PurchaseMeterDetails, self).__init__(**kwargs) - self.billing_type = 'Purchase' # type: str + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_type: str = "Purchase" self.product_id = None self.sku_id = None self.term_id = None -class ResourceIdentity(msrest.serialization.Model): +class ResourceIdentity(_serialization.Model): """Msi identity details of the resource. 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. @@ -2702,29 +2796,28 @@ class ResourceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + "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'}, + "type": {"key": "type", "type": "str"}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - *, - type: Optional[str] = None, - **kwargs - ): - super(ResourceIdentity, self).__init__(**kwargs) + def __init__(self, *, type: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword type: Identity type. + :paramtype type: str + """ + super().__init__(**kwargs) self.type = type self.principal_id = None self.tenant_id = None -class ResourceProviderDetails(msrest.serialization.Model): +class ResourceProviderDetails(_serialization.Model): """Management RP details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2734,64 +2827,72 @@ class ResourceProviderDetails(msrest.serialization.Model): """ _validation = { - 'resource_provider_namespace': {'readonly': True}, + "resource_provider_namespace": {"readonly": True}, } _attribute_map = { - 'resource_provider_namespace': {'key': 'resourceProviderNamespace', 'type': 'str'}, + "resource_provider_namespace": {"key": "resourceProviderNamespace", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ResourceProviderDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.resource_provider_namespace = None -class ReturnOrderItemDetails(msrest.serialization.Model): +class ReturnOrderItemDetails(_serialization.Model): """Return order item request body. All required parameters must be populated in order to send to Azure. - :param return_address: customer return address. - :type return_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - :param return_reason: Required. Return Reason. - :type return_reason: str - :param service_tag: Service tag (located on the bottom-right corner of the device). - :type service_tag: str - :param shipping_box_required: Shipping Box required. - :type shipping_box_required: bool + :ivar return_address: customer return address. + :vartype return_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties + :ivar return_reason: Return Reason. Required. + :vartype return_reason: str + :ivar service_tag: Service tag (located on the bottom-right corner of the device). + :vartype service_tag: str + :ivar shipping_box_required: Shipping Box required. + :vartype shipping_box_required: bool """ _validation = { - 'return_reason': {'required': True}, + "return_reason": {"required": True}, } _attribute_map = { - 'return_address': {'key': 'returnAddress', 'type': 'AddressProperties'}, - 'return_reason': {'key': 'returnReason', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'shipping_box_required': {'key': 'shippingBoxRequired', 'type': 'bool'}, + "return_address": {"key": "returnAddress", "type": "AddressProperties"}, + "return_reason": {"key": "returnReason", "type": "str"}, + "service_tag": {"key": "serviceTag", "type": "str"}, + "shipping_box_required": {"key": "shippingBoxRequired", "type": "bool"}, } def __init__( self, *, return_reason: str, - return_address: Optional["AddressProperties"] = None, + return_address: Optional["_models.AddressProperties"] = None, service_tag: Optional[str] = None, - shipping_box_required: Optional[bool] = False, - **kwargs - ): - super(ReturnOrderItemDetails, self).__init__(**kwargs) + shipping_box_required: bool = False, + **kwargs: Any + ) -> None: + """ + :keyword return_address: customer return address. + :paramtype return_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties + :keyword return_reason: Return Reason. Required. + :paramtype return_reason: str + :keyword service_tag: Service tag (located on the bottom-right corner of the device). + :paramtype service_tag: str + :keyword shipping_box_required: Shipping Box required. + :paramtype shipping_box_required: bool + """ + super().__init__(**kwargs) self.return_address = return_address self.return_reason = return_reason self.service_tag = service_tag self.shipping_box_required = shipping_box_required -class ReverseShippingDetails(msrest.serialization.Model): +class ReverseShippingDetails(_serialization.Model): """Reverse shipment details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2810,26 +2911,24 @@ class ReverseShippingDetails(msrest.serialization.Model): """ _validation = { - 'sas_key_for_label': {'readonly': True}, - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "sas_key_for_label": {"readonly": True}, + "carrier_name": {"readonly": True}, + "carrier_display_name": {"readonly": True}, + "tracking_id": {"readonly": True}, + "tracking_url": {"readonly": True}, } _attribute_map = { - 'sas_key_for_label': {'key': 'sasKeyForLabel', 'type': 'str'}, - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + "sas_key_for_label": {"key": "sasKeyForLabel", "type": "str"}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ReverseShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.sas_key_for_label = None self.carrier_name = None self.carrier_display_name = None @@ -2837,50 +2936,49 @@ def __init__( self.tracking_url = None -class ShippingAddress(msrest.serialization.Model): +class ShippingAddress(_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: 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.edgeorder.v2020_12_01_preview.models.AddressType + :ivar street_address1: Street Address line 1. Required. + :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: Name of the Country. Required. + :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. Known values are: "None", "Residential", and "Commercial". + :vartype address_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressType """ _validation = { - 'street_address1': {'required': True}, - 'country': {'required': True}, + "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'}, + "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__( @@ -2895,10 +2993,33 @@ 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, - **kwargs - ): - super(ShippingAddress, self).__init__(**kwargs) + address_type: Optional[Union[str, "_models.AddressType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword street_address1: Street Address line 1. Required. + :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: Name of the Country. Required. + :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. Known values are: "None", "Residential", and + "Commercial". + :paramtype address_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressType + """ + super().__init__(**kwargs) self.street_address1 = street_address1 self.street_address2 = street_address2 self.street_address3 = street_address3 @@ -2911,7 +3032,7 @@ def __init__( self.address_type = address_type -class ShippingDetails(msrest.serialization.Model): +class ShippingDetails(_serialization.Model): """Package shipping details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2928,31 +3049,29 @@ class ShippingDetails(msrest.serialization.Model): """ _validation = { - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "carrier_name": {"readonly": True}, + "carrier_display_name": {"readonly": True}, + "tracking_id": {"readonly": True}, + "tracking_url": {"readonly": True}, } _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.carrier_name = None self.carrier_display_name = None self.tracking_id = None self.tracking_url = None -class Specification(msrest.serialization.Model): +class Specification(_serialization.Model): """Specifications of the configurations. Variables are only populated by the server, and will be ignored when sending a request. @@ -2964,35 +3083,33 @@ class Specification(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Specification, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.name = None self.value = None -class StageDetails(msrest.serialization.Model): +class StageDetails(_serialization.Model): """Resource stage details. Variables are only populated by the server, and will be ignored when sending a request. - :ivar stage_status: Stage status. Possible values include: "None", "InProgress", "Succeeded", - "Failed", "Cancelled", "Cancelling". + :ivar stage_status: Stage status. Known values are: "None", "InProgress", "Succeeded", + "Failed", "Cancelled", and "Cancelling". :vartype stage_status: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageStatus - :ivar stage_name: Stage name. Possible values include: "Placed", "InReview", "Confirmed", + :ivar stage_name: Stage name. Known values are: "Placed", "InReview", "Confirmed", "ReadyToShip", "Shipped", "Delivered", "InUse", "ReturnInitiated", "ReturnPickedUp", - "ReturnedToMicrosoft", "ReturnCompleted", "Cancelled". + "ReturnedToMicrosoft", "ReturnCompleted", and "Cancelled". :vartype stage_name: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageName :ivar display_name: Display name of the resource stage. :vartype display_name: str @@ -3001,71 +3118,87 @@ class StageDetails(msrest.serialization.Model): """ _validation = { - 'stage_status': {'readonly': True}, - 'stage_name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'start_time': {'readonly': True}, + "stage_status": {"readonly": True}, + "stage_name": {"readonly": True}, + "display_name": {"readonly": True}, + "start_time": {"readonly": True}, } _attribute_map = { - 'stage_status': {'key': 'stageStatus', 'type': 'str'}, - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + "stage_status": {"key": "stageStatus", "type": "str"}, + "stage_name": {"key": "stageName", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): - super(StageDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.stage_status = None self.stage_name = None self.display_name = None self.start_time = None -class SystemData(msrest.serialization.Model): +class SystemData(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: 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. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime """ _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'}, + "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, *, created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, created_at: Optional[datetime.datetime] = None, last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type self.created_at = created_at @@ -3074,30 +3207,31 @@ def __init__( self.last_modified_at = last_modified_at -class TransportPreferences(msrest.serialization.Model): +class TransportPreferences(_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 + :ivar preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. + Required. Known values are: "CustomerManaged" and "MicrosoftManaged". + :vartype preferred_shipment_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.TransportShipmentTypes """ _validation = { - 'preferred_shipment_type': {'required': True}, + "preferred_shipment_type": {"required": True}, } _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, + "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, } - def __init__( - self, - *, - preferred_shipment_type: Union[str, "TransportShipmentTypes"], - **kwargs - ): - super(TransportPreferences, self).__init__(**kwargs) + def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], **kwargs: Any) -> None: + """ + :keyword preferred_shipment_type: Indicates Shipment Logistics type that the customer + preferred. Required. Known values are: "CustomerManaged" and "MicrosoftManaged". + :paramtype preferred_shipment_type: str or + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.TransportShipmentTypes + """ + super().__init__(**kwargs) self.preferred_shipment_type = preferred_shipment_type diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/__init__.py index 6003776a8eee..9e856f64458f 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/__init__.py @@ -8,6 +8,12 @@ from ._edge_order_management_client_operations import EdgeOrderManagementClientOperationsMixin +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'EdgeOrderManagementClientOperationsMixin', + "EdgeOrderManagementClientOperationsMixin", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_edge_order_management_client_operations.py index c72f177b5618..9f8fb6b4edd6 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_edge_order_management_client_operations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_edge_order_management_client_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,1977 +6,3711 @@ # 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 warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import 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.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models +from ..._serialization import Serializer +from .._vendor import EdgeOrderManagementClientMixinABC, _convert_request, _format_url_section -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False -class EdgeOrderManagementClientOperationsMixin(object): - def list_operations( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] +def build_list_operations_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.EdgeOrder/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_addresses_at_subscription_level_request( + subscription_id: str, *, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_product_families_request( + subscription_id: str, *, expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_configurations_request( + subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_product_families_metadata_request( + subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_order_at_subscription_level_request( + subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_order_items_at_subscription_level_request( + subscription_id: str, + *, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_addresses_at_resource_group_level_request( + resource_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_address_by_name_request( + address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_address_request( + address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_address_by_name_request( + address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_address_request( + address_name: str, resource_group_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_order_at_resource_group_level_request( + resource_group_name: str, subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_order_by_name_request( + order_name: str, resource_group_name: str, location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderName": _SERIALIZER.url("order_name", order_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_order_items_at_resource_group_level_request( + resource_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_order_item_by_name_request( + order_item_name: str, resource_group_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_order_item_request( + order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_order_item_by_name_request( + order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_order_item_request( + order_item_name: str, + resource_group_name: str, + subscription_id: str, + *, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_cancel_order_item_request( + order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_return_order_item_request( + order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class EdgeOrderManagementClientOperationsMixin( + EdgeOrderManagementClientMixinABC +): # pylint: disable=too-many-public-methods + @distributed_trace + def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: """This method gets all the operations that are exposed for customer. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_operations.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 = self._client.get(url, query_parameters, header_parameters) + request = build_list_operations_request( + api_version=api_version, + template_url=self.list_operations.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_operations.metadata = {'url': '/providers/Microsoft.EdgeOrder/operations'} # type: ignore + return ItemPaged(get_next, extract_data) + list_operations.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} + + @distributed_trace def list_addresses_at_subscription_level( - self, - filter=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AddressResourceList"] + self, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.AddressResource"]: """Lists all the addresses available under the subscription. :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. + page in the list of addresses. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_addresses_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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_addresses_at_subscription_level_request( + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_addresses_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', pipeline_response) + deserialized = self._deserialize("AddressResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_addresses_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore + return ItemPaged(get_next, extract_data) + list_addresses_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses" + } + + @overload + def list_product_families( + self, + product_families_request: _models.ProductFamiliesRequest, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: + """This method provides the list of product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload def list_product_families( self, - product_families_request, # type: "_models.ProductFamiliesRequest" - expand=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProductFamilies"] + product_families_request: IO, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: """This method provides the list of product families for the given subscription. - :param product_families_request: Filters for showing the product families. - :type product_families_request: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: IO :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. + details on the configurations for the product. Default value is None. :type expand: str :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. + page in the list of product families. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamilies or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamilies] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamilies"] + + @distributed_trace + def list_product_families( + self, + product_families_request: Union[_models.ProductFamiliesRequest, IO], + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: + """This method provides the list of product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO type. Required. + :type product_families_request: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest or IO + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = "application/json" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(product_families_request, (IO, bytes)): + _content = product_families_request + else: + _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") 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_product_families.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + request = build_list_product_families_request( + subscription_id=self._config.subscription_id, + expand=expand, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_product_families.metadata["url"], + headers=_headers, + params=_params, + ) + 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(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamilies', pipeline_response) + deserialized = self._deserialize("ProductFamilies", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_product_families.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies'} # type: ignore + return ItemPaged(get_next, extract_data) + list_product_families.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" + } + + @overload def list_configurations( self, - configurations_request, # type: "_models.ConfigurationsRequest" - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.Configurations"] + configurations_request: _models.ConfigurationsRequest, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.Configuration"]: """This method provides the list of configurations for the given product family, product line and product under subscription. - :param configurations_request: Filters for showing the configurations. - :type configurations_request: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. + page in the list of configurations. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configurations or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configurations] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Configurations"] + + @overload + def list_configurations( + self, + configurations_request: IO, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.Configuration"]: + """This method provides the list of configurations for the given product family, product line and + product under subscription. + + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_configurations( + self, + configurations_request: Union[_models.ConfigurationsRequest, IO], + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.Configuration"]: + """This method provides the list of configurations for the given product family, product line and + product under subscription. + + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO type. Required. + :type configurations_request: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest or IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = "application/json" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configurations_request, (IO, bytes)): + _content = configurations_request + else: + _json = self._serialize.body(configurations_request, "ConfigurationsRequest") 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_configurations.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + request = build_list_configurations_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_configurations.metadata["url"], + headers=_headers, + params=_params, + ) + 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(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('Configurations', pipeline_response) + deserialized = self._deserialize("Configurations", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations'} # type: ignore + return ItemPaged(get_next, extract_data) + list_configurations.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" + } + + @distributed_trace def list_product_families_metadata( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProductFamiliesMetadata"] + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.ProductFamiliesMetadataDetails"]: """This method provides the list of product families metadata for the given subscription. :param skip_token: $skipToken is supported on list of product families metadata, which provides - the next page in the list of product families metadata. + the next page in the list of product families metadata. Default value is None. :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 ProductFamiliesMetadata or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadata] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamiliesMetadata"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_product_families_metadata.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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.post(url, query_parameters, header_parameters) + + request = build_list_product_families_metadata_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_product_families_metadata.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamiliesMetadata', pipeline_response) + deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_product_families_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_product_families_metadata.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" + } + @distributed_trace def list_order_at_subscription_level( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OrderResourceList"] + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.OrderResource"]: """Lists order at subscription level. :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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_order_at_subscription_level_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', pipeline_response) + deserialized = self._deserialize("OrderResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_order_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders'} # type: ignore + return ItemPaged(get_next, extract_data) + list_order_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders" + } + + @distributed_trace def list_order_items_at_subscription_level( self, - filter=None, # type: Optional[str] - expand=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OrderItemResourceList"] + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.OrderItemResource"]: """Lists order item at subscription level. :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_items_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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_order_items_at_subscription_level_request( + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_items_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', pipeline_response) + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_order_items_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_order_items_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems" + } + @distributed_trace def list_addresses_at_resource_group_level( - self, - resource_group_name, # type: str - filter=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AddressResourceList"] + self, resource_group_name: str, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.AddressResource"]: """Lists all the addresses available under the given resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of address. + page in the list of address. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_addresses_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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_addresses_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_addresses_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', pipeline_response) + deserialized = self._deserialize("AddressResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_addresses_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore + return ItemPaged(get_next, extract_data) + list_addresses_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" + } + + @distributed_trace def get_address_by_name( - self, - address_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressResource" + self, address_name: str, resource_group_name: str, **kwargs: Any + ) -> _models.AddressResource: """Gets information about the specified address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource, or the result of cls(response) + :return: AddressResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_address_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + + request = build_get_address_by_name_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_address_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + + get_address_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } def _create_address_initial( self, - address_name, # type: str - resource_group_name, # type: str - address_resource, # type: "_models.AddressResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AddressResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] + address_name: str, + resource_group_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> Optional[_models.AddressResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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['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(address_resource, 'AddressResource') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_resource, (IO, bytes)): + _content = address_resource + else: + _json = self._serialize.body(address_resource, "AddressResource") + + request = build_create_address_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_address_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _create_address_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload def begin_create_address( self, - address_name, # type: str - resource_group_name, # type: str - address_resource, # type: "_models.AddressResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AddressResource"] + address_name: str, + resource_group_name: str, + address_resource: _models.AddressResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: """Creates a new address with the specified parameters. Existing address cannot be updated with this API and should instead be updated with the Update address API. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_resource: Address details from request body. + :param address_resource: Address details from request body. Required. :type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_address( + self, + address_name: str, + resource_group_name: str, + address_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Creates a new address with the specified parameters. Existing address cannot be updated with + this API and should instead be updated with the Update address API. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_resource: Address details from request body. Required. + :type address_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_address( + self, + address_name: str, + resource_group_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Creates a new address with the specified parameters. Existing address cannot be updated with + this API and should instead be updated with the Update address API. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_resource: Address details from request body. Is either a AddressResource type or + a IO type. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._create_address_initial( address_name=address_name, resource_group_name=resource_group_name, address_resource=address_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) - + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _delete_address_by_name_initial( - self, - address_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + begin_create_address.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements + self, address_name: str, resource_group_name: str, **kwargs: Any + ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_address_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_address_by_name_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_address_by_name_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_address_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _delete_address_by_name_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + @distributed_trace def begin_delete_address_by_name( - self, - address_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + self, address_name: str, resource_group_name: str, **kwargs: Any + ) -> LROPoller[None]: """Deletes an address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_address_by_name_initial( + raw_result = self._delete_address_by_name_initial( # type: ignore address_name=address_name, resource_group_name=resource_group_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete_address_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } def _update_address_initial( self, - address_name, # type: str - resource_group_name, # type: str - address_update_parameter, # type: "_models.AddressUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AddressResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] + address_name: str, + resource_group_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.AddressResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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(address_update_parameter, 'AddressUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_update_parameter, (IO, bytes)): + _content = address_update_parameter + else: + _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") + + request = build_update_address_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_address_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _update_address_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload def begin_update_address( self, - address_name, # type: str - resource_group_name, # type: str - address_update_parameter, # type: "_models.AddressUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AddressResource"] + address_name: str, + resource_group_name: str, + address_update_parameter: _models.AddressUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: """Updates the properties of an existing address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. - :type address_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter :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. + of the job on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + + @overload + def begin_update_address( + self, + address_name: str, + resource_group_name: str, + address_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Updates the properties of an existing address. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_address( + self, + address_name: str, + resource_group_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Updates the properties of an existing address. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_update_parameter: Address update parameters from request body. Is either a + AddressUpdateParameter type or a IO type. Required. + :type address_update_parameter: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._update_address_initial( address_name=address_name, resource_group_name=resource_group_name, address_update_parameter=address_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) - + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update_address.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + @distributed_trace def list_order_at_resource_group_level( - self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OrderResourceList"] + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.OrderResource"]: """Lists order at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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_order_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', pipeline_response) + deserialized = self._deserialize("OrderResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_order_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_order_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" + } + @distributed_trace def get_order_by_name( - self, - order_name, # type: str - resource_group_name, # type: str - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OrderResource" + self, order_name: str, resource_group_name: str, location: str, **kwargs: Any + ) -> _models.OrderResource: """Gets an order. - :param order_name: The name of the order. + :param order_name: The name of the order. Required. :type order_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param location: The name of Azure region. + :param location: The name of Azure region. Required. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource, or the result of cls(response) + :return: OrderResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_order_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderName': self._serialize.url("order_name", order_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'location': self._serialize.url("location", location, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) + + request = build_get_order_by_name_request( + order_name=order_name, + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_order_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('OrderResource', pipeline_response) + deserialized = self._deserialize("OrderResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_order_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}'} # type: ignore + get_order_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" + } + + @distributed_trace def list_order_items_at_resource_group_level( self, - resource_group_name, # type: str - filter=None, # type: Optional[str] - expand=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OrderItemResourceList"] + resource_group_name: str, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.OrderItemResource"]: """Lists order item at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_items_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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_order_items_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_items_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', pipeline_response) + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_order_items_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_order_items_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" + } + @distributed_trace def get_order_item_by_name( - self, - order_item_name, # type: str - resource_group_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.OrderItemResource" + self, order_item_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> _models.OrderItemResource: """Gets an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource, or the result of cls(response) + :return: OrderItemResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self.get_order_item_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) - # 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') + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + + request = build_get_order_item_by_name_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + template_url=self.get_order_item_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + + get_order_item_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } def _create_order_item_initial( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_resource, # type: "_models.OrderItemResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OrderItemResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] + order_item_name: str, + resource_group_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> Optional[_models.OrderItemResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(order_item_resource, 'OrderItemResource') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_resource, (IO, bytes)): + _content = order_item_resource + else: + _json = self._serialize.body(order_item_resource, "OrderItemResource") + + request = build_create_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _create_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + def begin_create_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_resource: _models.OrderItemResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Creates an order item. Existing order item cannot be updated with this api and should instead + be updated with the Update order item API. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_resource: Order item details from request body. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Creates an order item. Existing order item cannot be updated with this api and should instead + be updated with the Update order item API. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_resource: Order item details from request body. Required. + :type order_item_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace def begin_create_order_item( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_resource, # type: "_models.OrderItemResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OrderItemResource"] + order_item_name: str, + resource_group_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: """Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_resource: Order item details from request body. + :param order_item_resource: Order item details from request body. Is either a OrderItemResource + type or a IO type. Required. :type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._create_order_item_initial( order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_resource=order_item_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _delete_order_item_by_name_initial( - self, - order_item_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + begin_create_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements + self, order_item_name: str, resource_group_name: str, **kwargs: Any + ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_order_item_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop("error_map", {}) or {}) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_order_item_by_name_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_order_item_by_name_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_order_item_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _delete_order_item_by_name_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + @distributed_trace def begin_delete_order_item_by_name( - self, - order_item_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + self, order_item_name: str, resource_group_name: str, **kwargs: Any + ) -> LROPoller[None]: """Deletes an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_order_item_by_name_initial( + raw_result = self._delete_order_item_by_name_initial( # type: ignore order_item_name=order_item_name, resource_group_name=resource_group_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete_order_item_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } def _update_order_item_initial( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_update_parameter, # type: "_models.OrderItemUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OrderItemResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.OrderItemResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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(order_item_update_parameter, 'OrderItemUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_update_parameter, (IO, bytes)): + _content = order_item_update_parameter + else: + _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") + + request = build_update_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _update_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + def begin_update_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: _models.OrderItemUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Updates the properties of an existing order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_update_parameter: order item update parameters from request body. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Updates the properties of an existing order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_update_parameter: order item update parameters from request body. Required. + :type order_item_update_parameter: IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace def begin_update_order_item( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_update_parameter, # type: "_models.OrderItemUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OrderItemResource"] + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: """Updates the properties of an existing order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. - :type order_item_update_parameter: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter + :param order_item_update_parameter: order item update parameters from request body. Is either a + OrderItemUpdateParameter type or a IO type. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. + of the order on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._update_order_item_initial( order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_update_parameter=order_item_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } - def cancel_order_item( + @overload + def cancel_order_item( # pylint: disable=inconsistent-return-statements self, - order_item_name, # type: str - resource_group_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + order_item_name: str, + resource_group_name: str, + cancellation_reason: _models.CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: """Cancel order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. + :param cancellation_reason: Reason for cancellation. Required. :type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def cancel_order_item( # pylint: disable=inconsistent-return-statements + self, + order_item_name: str, + resource_group_name: str, + cancellation_reason: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Cancel order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def cancel_order_item( # pylint: disable=inconsistent-return-statements + self, + order_item_name: str, + resource_group_name: str, + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any + ) -> None: + """Cancel order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO type. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: """ - 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-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel_order_item.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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['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(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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cancellation_reason, (IO, bytes)): + _content = cancellation_reason + else: + _json = self._serialize.body(cancellation_reason, "CancellationReason") + + request = build_cancel_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.cancel_order_item.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - cancel_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel'} # type: ignore + cancel_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" + } - def _return_order_item_initial( + def _return_order_item_initial( # pylint: disable=inconsistent-return-statements self, - order_item_name, # type: str - resource_group_name, # type: str - return_order_item_details, # type: "_models.ReturnOrderItemDetails" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + order_item_name: str, + resource_group_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._return_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(return_order_item_details, 'ReturnOrderItemDetails') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(return_order_item_details, (IO, bytes)): + _content = return_order_item_details + else: + _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") + + request = build_return_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._return_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _return_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore + _return_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } + @overload def begin_return_order_item( self, - order_item_name, # type: str - resource_group_name, # type: str - return_order_item_details, # type: "_models.ReturnOrderItemDetails" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + order_item_name: str, + resource_group_name: str, + return_order_item_details: _models.ReturnOrderItemDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: """Return order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. - :type return_order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails + :param return_order_item_details: Return order item CurrentStatus. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + + @overload + def begin_return_order_item( + self, + order_item_name: str, + resource_group_name: str, + return_order_item_details: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Return order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param return_order_item_details: Return order item CurrentStatus. Required. + :type return_order_item_details: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + + @distributed_trace + def begin_return_order_item( + self, + order_item_name: str, + resource_group_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> LROPoller[None]: + """Return order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param return_order_item_details: Return order item CurrentStatus. Is either a + ReturnOrderItemDetails type or a IO type. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2020-12-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2020-12-01-preview") ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._return_order_item_initial( + raw_result = self._return_order_item_initial( # type: ignore order_item_name=order_item_name, resource_group_name=resource_group_name, return_order_item_details=return_order_item_details, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_return_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_return_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/__init__.py index 6a0b62b08a4c..cf345f5e5ed1 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/__init__.py @@ -10,10 +10,17 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['EdgeOrderManagementClient'] try: - from ._patch import patch_sdk # type: ignore - patch_sdk() + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: - pass + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EdgeOrderManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_configuration.py index f0a779062d5c..9842256d512b 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_configuration.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_configuration.py @@ -6,66 +6,67 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import sys +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 sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential -class EdgeOrderManagementClientConfiguration(Configuration): +class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for EdgeOrderManagementClient. 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-12-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", "2021-12-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-12-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-edgeorder/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".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') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_edge_order_management_client.py index bd6f90006bc1..30dbd3ca5bbf 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_edge_order_management_client.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_edge_order_management_client.py @@ -6,80 +6,85 @@ # 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, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer + +from . import models as _models +from .._serialization import Deserializer, Serializer +from ._configuration import EdgeOrderManagementClientConfiguration +from .operations import EdgeOrderManagementClientOperationsMixin if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import EdgeOrderManagementClientConfiguration -from .operations import EdgeOrderManagementClientOperationsMixin -from . import models -class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin): +class EdgeOrderManagementClient( + EdgeOrderManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword """The EdgeOrder Client. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :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 api_version: Api Version. Default value is "2021-12-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ 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 = EdgeOrderManagementClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = EdgeOrderManagementClientConfiguration( + 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)} + 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 - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> 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/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - def close(self): - # type: () -> None + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> EdgeOrderManagementClient + def __enter__(self) -> "EdgeOrderManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_metadata.json b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_metadata.json index f53b9e9e72d0..afaa0d0192d4 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_metadata.json +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_metadata.json @@ -5,39 +5,41 @@ "name": "EdgeOrderManagementClient", "filename": "_edge_order_management_client", "description": "The EdgeOrder 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, - "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\": [\"EdgeOrderManagementClientConfiguration\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "global_parameters": { "sync": { "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true + "required": true, + "method_location": "positional" }, "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The ID of the target subscription.", + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. Required.", "docstring_type": "str", - "required": true + "required": true, + "method_location": "positional" } }, "async": { "credential": { "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", + "description": "Credential needed for the client to connect to Azure. Required.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { "signature": "subscription_id: str,", - "description": "The ID of the target subscription.", + "description": "The ID of the target subscription. Required.", "docstring_type": "str", "required": true } @@ -48,22 +50,25 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "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 + "required": false, + "method_location": "positional" }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } }, "async": { @@ -71,19 +76,22 @@ "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 + "required": false, + "method_location": "positional" }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", - "required": false + "required": false, + "method_location": "positional" }, "profile": { "signature": "profile: KnownProfiles = KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", - "required": false + "required": false, + "method_location": "positional" } } } @@ -91,354 +99,381 @@ "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, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"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\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "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": { }, "operation_mixins": { - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.mgmt.core.polling.arm_polling\": [\"ARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\", \"Union\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.mgmt.core.polling.async_arm_polling\": [\"AsyncARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"azurecore\": {\"azure.core.paging\": [\"ItemPaged\"], \"azure.core.polling\": [\"LROPoller\"]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"azurecore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"], \"azure.core.polling\": [\"AsyncLROPoller\"]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", "operations": { "list_operations" : { "sync": { - "signature": "def list_operations(\n self,\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OperationListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OperationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.Operation\"]:\n", + "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Operation or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "**kwargs" }, "async": { "coroutine": false, - "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OperationListResult\"]:\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OperationListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OperationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "" + "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.Operation\"]:\n", + "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Operation or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "**kwargs" + } }, "list_addresses_at_subscription_level" : { "sync": { - "signature": "def list_addresses_at_subscription_level(\n self,\n filter=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.AddressResource\"]:\n", + "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "filter, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.AddressResourceList\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "filter, skip_token" + "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.AddressResource\"]:\n", + "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "filter, skip_token, **kwargs" + } }, "list_product_families" : { "sync": { - "signature": "def list_product_families(\n self,\n product_families_request, # type: \"_models.ProductFamiliesRequest\"\n expand=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families.\n:type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamilies or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamilies]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_product_families(\n self,\n product_families_request: Union[_models.ProductFamiliesRequest, IO],\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ProductFamily\"]:\n", + "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families. Is either a\n ProductFamiliesRequest type or a IO type. Required.\n:type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest\n or IO\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product. Default value is None.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamily or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "product_families_request, expand, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_product_families(\n self,\n product_families_request: \"_models.ProductFamiliesRequest\",\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ProductFamilies\"]:\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families.\n:type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamilies or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamilies]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "product_families_request, expand, skip_token" + "signature": "def list_product_families(\n self,\n product_families_request: Union[_models.ProductFamiliesRequest, IO],\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ProductFamily\"]:\n", + "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families. Is either a\n ProductFamiliesRequest type or a IO type. Required.\n:type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest\n or IO\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product. Default value is None.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamily or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "product_families_request, expand, skip_token, **kwargs" + } }, "list_configurations" : { "sync": { - "signature": "def list_configurations(\n self,\n configurations_request, # type: \"_models.ConfigurationsRequest\"\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations.\n:type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configurations or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configurations]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_configurations(\n self,\n configurations_request: Union[_models.ConfigurationsRequest, IO],\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.Configuration\"]:\n", + "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations. Is either a\n ConfigurationsRequest type or a IO type. Required.\n:type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or\n IO\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configuration or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "configurations_request, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_configurations(\n self,\n configurations_request: \"_models.ConfigurationsRequest\",\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.Configurations\"]:\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations.\n:type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configurations or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configurations]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "configurations_request, skip_token" + "signature": "def list_configurations(\n self,\n configurations_request: Union[_models.ConfigurationsRequest, IO],\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.Configuration\"]:\n", + "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations. Is either a\n ConfigurationsRequest type or a IO type. Required.\n:type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or\n IO\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configuration or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "configurations_request, skip_token, **kwargs" + } }, "list_product_families_metadata" : { "sync": { - "signature": "def list_product_families_metadata(\n self,\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadata or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadata]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ProductFamiliesMetadataDetails\"]:\n", + "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of\n cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ProductFamiliesMetadata\"]:\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadata or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadata]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "skip_token" + "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ProductFamiliesMetadataDetails\"]:\n", + "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of\n cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "skip_token, **kwargs" + } }, "list_order_at_subscription_level" : { "sync": { - "signature": "def list_order_at_subscription_level(\n self,\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderResource\"]:\n", + "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderResourceList\"]:\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "skip_token" + "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderResource\"]:\n", + "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "skip_token, **kwargs" + } }, "list_order_items_at_subscription_level" : { "sync": { - "signature": "def list_order_items_at_subscription_level(\n self,\n filter=None, # type: Optional[str]\n expand=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderItemResource\"]:\n", + "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "filter, expand, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderItemResourceList\"]:\n", - "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "filter, expand, skip_token" + "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderItemResource\"]:\n", + "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "filter, expand, skip_token, **kwargs" + } }, "list_addresses_at_resource_group_level" : { "sync": { - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name, # type: str\n filter=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.AddressResource\"]:\n", + "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, filter, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.AddressResourceList\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "resource_group_name, filter, skip_token" + "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.AddressResource\"]:\n", + "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, filter, skip_token, **kwargs" + } }, "get_address_by_name" : { "sync": { - "signature": "def get_address_by_name(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e _models.AddressResource:\n", + "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, - "signature": "async def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e \"_models.AddressResource\":\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "address_name, resource_group_name" + "signature": "async def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e _models.AddressResource:\n", + "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, **kwargs" + } }, "_create_address_initial" : { "sync": { - "signature": "def _create_address_initial(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_resource, # type: \"_models.AddressResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", + "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_resource, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: \"_models.AddressResource\",\n **kwargs: Any\n) -\u003e Optional[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_resource" + "signature": "async def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", + "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_resource, **kwargs" + } }, "begin_create_address" : { "sync": { - "signature": "def begin_create_address(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_resource, # type: \"_models.AddressResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e LROPoller[_models.AddressResource]:\n", + "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_resource, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: \"_models.AddressResource\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_resource: Address details from request body.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_resource" + "signature": "async def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.AddressResource]:\n", + "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_resource, **kwargs" + } }, "_delete_address_by_name_initial" : { "sync": { - "signature": "def _delete_address_by_name_initial(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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\"\"\"" + "signature": "def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\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": "address_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _delete_address_by_name_initial(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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": "address_name, resource_group_name" + "signature": "async def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\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": "address_name, resource_group_name, **kwargs" + } }, "begin_delete_address_by_name" : { "sync": { - "signature": "def begin_delete_address_by_name(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_delete_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", + "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, "signature": "async def begin_delete_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "address_name, resource_group_name" + "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, **kwargs" + } }, "_update_address_initial" : { "sync": { - "signature": "def _update_address_initial(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_update_parameter, # type: \"_models.AddressUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", + "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: \"_models.AddressUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_update_parameter, if_match" + "signature": "async def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", + "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" + } }, "begin_update_address" : { "sync": { - "signature": "def begin_update_address(\n self,\n address_name, # type: str\n resource_group_name, # type: str\n address_update_parameter, # type: \"_models.AddressUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[_models.AddressResource]:\n", + "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: \"_models.AddressUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "address_name, resource_group_name, address_update_parameter, if_match" + "signature": "async def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.AddressResource]:\n", + "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" + } }, "list_order_at_resource_group_level" : { "sync": { - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name, # type: str\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderResource\"]:\n", + "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderResourceList\"]:\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "resource_group_name, skip_token" + "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderResource\"]:\n", + "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, skip_token, **kwargs" + } }, "get_order_by_name" : { "sync": { - "signature": "def get_order_by_name(\n self,\n order_name, # type: str\n resource_group_name, # type: str\n location, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param location: The name of Azure region.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e _models.OrderResource:\n", + "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order. Required.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param location: The name of Azure region. Required.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_name, resource_group_name, location, **kwargs" }, "async": { "coroutine": true, - "signature": "async def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e \"_models.OrderResource\":\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param location: The name of Azure region.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_name, resource_group_name, location" + "signature": "async def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e _models.OrderResource:\n", + "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order. Required.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param location: The name of Azure region. Required.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_name, resource_group_name, location, **kwargs" + } }, "list_order_items_at_resource_group_level" : { "sync": { - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name, # type: str\n filter=None, # type: Optional[str]\n expand=None, # type: Optional[str]\n skip_token=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderItemResource\"]:\n", + "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, filter, expand, skip_token, **kwargs" }, "async": { "coroutine": false, - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.OrderItemResourceList\"]:\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResourceList or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "resource_group_name, filter, expand, skip_token" + "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderItemResource\"]:\n", + "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "resource_group_name, filter, expand, skip_token, **kwargs" + } }, "get_order_item_by_name" : { "sync": { - "signature": "def get_order_item_by_name(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n expand=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e _models.OrderItemResource:\n", + "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, expand, **kwargs" }, "async": { "coroutine": true, - "signature": "async def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e \"_models.OrderItemResource\":\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, expand" + "signature": "async def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e _models.OrderItemResource:\n", + "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, expand, **kwargs" + } }, "_create_order_item_initial" : { "sync": { - "signature": "def _create_order_item_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_resource, # type: \"_models.OrderItemResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", + "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: \"_models.OrderItemResource\",\n **kwargs: Any\n) -\u003e Optional[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_resource" + "signature": "async def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", + "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" + } }, "begin_create_order_item" : { "sync": { - "signature": "def begin_create_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_resource, # type: \"_models.OrderItemResource\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e LROPoller[_models.OrderItemResource]:\n", + "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: \"_models.OrderItemResource\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_resource" + "signature": "async def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.OrderItemResource]:\n", + "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" + } }, "_delete_order_item_by_name_initial" : { "sync": { - "signature": "def _delete_order_item_by_name_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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\"\"\"" + "signature": "def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\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": "order_item_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _delete_order_item_by_name_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\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": "order_item_name, resource_group_name" + "signature": "async def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\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": "order_item_name, resource_group_name, **kwargs" + } }, "begin_delete_order_item_by_name" : { "sync": { - "signature": "def begin_delete_order_item_by_name(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_delete_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", + "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, **kwargs" }, "async": { "coroutine": true, "signature": "async def begin_delete_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name" + "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, **kwargs" + } }, "_update_order_item_initial" : { "sync": { - "signature": "def _update_order_item_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_update_parameter, # type: \"_models.OrderItemUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", + "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: \"_models.OrderItemUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource, or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match" + "signature": "async def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", + "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" + } }, "begin_update_order_item" : { "sync": { - "signature": "def begin_update_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n order_item_update_parameter, # type: \"_models.OrderItemUpdateParameter\"\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[_models.OrderItemResource]:\n", + "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: \"_models.OrderItemUpdateParameter\",\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body.\n:type order_item_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value.\n:type if_match: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match" + "signature": "async def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.OrderItemResource]:\n", + "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" + } }, "cancel_order_item" : { "sync": { - "signature": "def cancel_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n cancellation_reason, # type: \"_models.CancellationReason\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason\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\"\"\"" + "signature": "def cancel_order_item( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: Union[_models.CancellationReason, IO],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a\n IO type. Required.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\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": "order_item_name, resource_group_name, cancellation_reason, **kwargs" }, "async": { "coroutine": true, - "signature": "async def cancel_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: \"_models.CancellationReason\",\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason\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": "order_item_name, resource_group_name, cancellation_reason" + "signature": "async def cancel_order_item( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: Union[_models.CancellationReason, IO],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a\n IO type. Required.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\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": "order_item_name, resource_group_name, cancellation_reason, **kwargs" + } }, "_return_order_item_initial" : { "sync": { - "signature": "def _return_order_item_initial(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n return_order_item_details, # type: \"_models.ReturnOrderItemDetails\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails\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\"\"\"" + "signature": "def _return_order_item_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\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": "order_item_name, resource_group_name, return_order_item_details, **kwargs" }, "async": { "coroutine": true, - "signature": "async def _return_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: \"_models.ReturnOrderItemDetails\",\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails\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": "order_item_name, resource_group_name, return_order_item_details" + "signature": "async def _return_order_item_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\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": "order_item_name, resource_group_name, return_order_item_details, **kwargs" + } }, "begin_return_order_item" : { "sync": { - "signature": "def begin_return_order_item(\n self,\n order_item_name, # type: str\n resource_group_name, # type: str\n return_order_item_details, # type: \"_models.ReturnOrderItemDetails\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + "signature": "def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", + "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: \"_models.ReturnOrderItemDetails\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus.\n:type return_order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling.\n Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" - }, - "call": "order_item_name, resource_group_name, return_order_item_details" + "signature": "async def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" + } } } } -} \ No newline at end of file +} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_vendor.py new file mode 100644 index 000000000000..7f8e08518951 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_vendor.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------- +# 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 abc import ABC +from typing import List, TYPE_CHECKING, cast + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import EdgeOrderManagementClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import PipelineClient + + from .._serialization import Deserializer, Serializer + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) + + +class EdgeOrderManagementClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: EdgeOrderManagementClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_version.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_version.py index c47f66669f1b..e5754a47ce68 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_version.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/__init__.py index b8c98d8145e8..b9eec9b0ea44 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/__init__.py @@ -7,4 +7,17 @@ # -------------------------------------------------------------------------- from ._edge_order_management_client import EdgeOrderManagementClient -__all__ = ['EdgeOrderManagementClient'] + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EdgeOrderManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_configuration.py index 4d23b41124c2..cfdb96f35136 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_configuration.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_configuration.py @@ -6,62 +6,67 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys 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 sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class EdgeOrderManagementClientConfiguration(Configuration): +class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for EdgeOrderManagementClient. 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. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-12-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", "2021-12-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-12-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-edgeorder/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".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') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_edge_order_management_client.py index 5c0a179b3789..9275fbfdaacd 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_edge_order_management_client.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_edge_order_management_client.py @@ -6,66 +6,78 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer + +from .. import models as _models +from ..._serialization import Deserializer, Serializer +from ._configuration import EdgeOrderManagementClientConfiguration +from .operations import EdgeOrderManagementClientOperationsMixin if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import EdgeOrderManagementClientConfiguration -from .operations import EdgeOrderManagementClientOperationsMixin -from .. import models - -class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin): +class EdgeOrderManagementClient( + EdgeOrderManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword """The EdgeOrder Client. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :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 api_version: Api Version. Default value is "2021-12-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ 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 = EdgeOrderManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = EdgeOrderManagementClientConfiguration( + 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)} + 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 - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> 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/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + 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() @@ -74,5 +86,5 @@ async def __aenter__(self) -> "EdgeOrderManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_vendor.py new file mode 100644 index 000000000000..0c61995427f8 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# 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 abc import ABC +from typing import TYPE_CHECKING + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import EdgeOrderManagementClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import AsyncPipelineClient + + from ..._serialization import Deserializer, Serializer + + +class EdgeOrderManagementClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: EdgeOrderManagementClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/__init__.py index 6003776a8eee..9e856f64458f 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/__init__.py @@ -8,6 +8,12 @@ from ._edge_order_management_client_operations import EdgeOrderManagementClientOperationsMixin +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'EdgeOrderManagementClientOperationsMixin', + "EdgeOrderManagementClientOperationsMixin", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_edge_order_management_client_operations.py index 0238d927339e..161c6f585578 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_edge_order_management_client_operations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_edge_order_management_client_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,1236 +6,1785 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, 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.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - -T = TypeVar('T') +from ..._vendor import _convert_request +from ...operations._edge_order_management_client_operations import ( + build_cancel_order_item_request, + build_create_address_request, + build_create_order_item_request, + build_delete_address_by_name_request, + build_delete_order_item_by_name_request, + build_get_address_by_name_request, + build_get_order_by_name_request, + build_get_order_item_by_name_request, + build_list_addresses_at_resource_group_level_request, + build_list_addresses_at_subscription_level_request, + build_list_configurations_request, + build_list_operations_request, + build_list_order_at_resource_group_level_request, + build_list_order_at_subscription_level_request, + build_list_order_items_at_resource_group_level_request, + build_list_order_items_at_subscription_level_request, + build_list_product_families_metadata_request, + build_list_product_families_request, + build_return_order_item_request, + build_update_address_request, + build_update_order_item_request, +) +from .._vendor import EdgeOrderManagementClientMixinABC + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class EdgeOrderManagementClientOperationsMixin: - def list_operations( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: +class EdgeOrderManagementClientOperationsMixin( + EdgeOrderManagementClientMixinABC +): # pylint: disable=too-many-public-methods + @distributed_trace + def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """This method gets all the operations that are exposed for customer. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_operations.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 = self._client.get(url, query_parameters, header_parameters) + request = build_list_operations_request( + api_version=api_version, + template_url=self.list_operations.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_operations.metadata = {'url': '/providers/Microsoft.EdgeOrder/operations'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_operations.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} + + @distributed_trace def list_addresses_at_subscription_level( - self, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.AddressResourceList"]: + self, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.AddressResource"]: """Lists all the addresses available under the subscription. :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. + page in the list of addresses. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_addresses_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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_addresses_at_subscription_level_request( + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_addresses_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', pipeline_response) + deserialized = self._deserialize("AddressResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_addresses_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_addresses_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses" + } + + @overload + def list_product_families( + self, + product_families_request: _models.ProductFamiliesRequest, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.ProductFamily"]: + """This method provides the list of product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_product_families( + self, + product_families_request: IO, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.ProductFamily"]: + """This method provides the list of product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: IO + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace def list_product_families( self, - product_families_request: "_models.ProductFamiliesRequest", + product_families_request: Union[_models.ProductFamiliesRequest, IO], expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.ProductFamilies"]: + ) -> AsyncIterable["_models.ProductFamily"]: """This method provides the list of product families for the given subscription. - :param product_families_request: Filters for showing the product families. + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO type. Required. :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest + or IO :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. + details on the configurations for the product. Default value is None. :type expand: str :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. + page in the list of product families. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamilies or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamilies] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamilies"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = "application/json" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(product_families_request, (IO, bytes)): + _content = product_families_request + else: + _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") 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_product_families.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + request = build_list_product_families_request( + subscription_id=self._config.subscription_id, + expand=expand, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_product_families.metadata["url"], + headers=_headers, + params=_params, + ) + 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(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamilies', pipeline_response) + deserialized = self._deserialize("ProductFamilies", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_product_families.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_product_families.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" + } + + @overload def list_configurations( self, - configurations_request: "_models.ConfigurationsRequest", + configurations_request: _models.ConfigurationsRequest, skip_token: Optional[str] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable["_models.Configurations"]: + ) -> AsyncIterable["_models.Configuration"]: """This method provides the list of configurations for the given product family, product line and product under subscription. - :param configurations_request: Filters for showing the configurations. + :param configurations_request: Filters for showing the configurations. Required. :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_configurations( + self, + configurations_request: IO, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.Configuration"]: + """This method provides the list of configurations for the given product family, product line and + product under subscription. + + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_configurations( + self, + configurations_request: Union[_models.ConfigurationsRequest, IO], + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.Configuration"]: + """This method provides the list of configurations for the given product family, product line and + product under subscription. + + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO type. Required. + :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or + IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configurations or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configurations] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Configurations"] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = "application/json" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configurations_request, (IO, bytes)): + _content = configurations_request + else: + _json = self._serialize.body(configurations_request, "ConfigurationsRequest") 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_configurations.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + request = build_list_configurations_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_configurations.metadata["url"], + headers=_headers, + params=_params, + ) + 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(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('Configurations', pipeline_response) + deserialized = self._deserialize("Configurations", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_configurations.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" + } + + @distributed_trace def list_product_families_metadata( - self, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamiliesMetadata"]: + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.ProductFamiliesMetadataDetails"]: """This method provides the list of product families metadata for the given subscription. :param skip_token: $skipToken is supported on list of product families metadata, which provides - the next page in the list of product families metadata. + the next page in the list of product families metadata. Default value is None. :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 ProductFamiliesMetadata or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadata] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamiliesMetadata"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_product_families_metadata.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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.post(url, query_parameters, header_parameters) + + request = build_list_product_families_metadata_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_product_families_metadata.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamiliesMetadata', pipeline_response) + deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_product_families_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_product_families_metadata.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" + } + + @distributed_trace def list_order_at_subscription_level( - self, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderResourceList"]: + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.OrderResource"]: """Lists order at subscription level. :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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_order_at_subscription_level_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', pipeline_response) + deserialized = self._deserialize("OrderResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_order_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_order_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders" + } + + @distributed_trace def list_order_items_at_subscription_level( self, filter: Optional[str] = None, expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResourceList"]: + ) -> AsyncIterable["_models.OrderItemResource"]: """Lists order item at subscription level. :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_items_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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_order_items_at_subscription_level_request( + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_items_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', pipeline_response) + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_order_items_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_order_items_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems" + } + @distributed_trace def list_addresses_at_resource_group_level( - self, - resource_group_name: str, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.AddressResourceList"]: + self, resource_group_name: str, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.AddressResource"]: """Lists all the addresses available under the given resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of address. + page in the list of address. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_addresses_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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_addresses_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_addresses_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', pipeline_response) + deserialized = self._deserialize("AddressResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_addresses_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_addresses_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" + } + @distributed_trace_async async def get_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any - ) -> "_models.AddressResource": + self, address_name: str, resource_group_name: str, **kwargs: Any + ) -> _models.AddressResource: """Gets information about the specified address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource, or the result of cls(response) + :return: AddressResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self.get_address_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + + request = build_get_address_by_name_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_address_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + + get_address_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } async def _create_address_initial( self, address_name: str, resource_group_name: str, - address_resource: "_models.AddressResource", + address_resource: Union[_models.AddressResource, IO], **kwargs: Any - ) -> Optional["_models.AddressResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] + ) -> Optional[_models.AddressResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(address_resource, 'AddressResource') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_resource, (IO, bytes)): + _content = address_resource + else: + _json = self._serialize.body(address_resource, "AddressResource") + + request = build_create_address_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_address_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _create_address_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload async def begin_create_address( self, address_name: str, resource_group_name: str, - address_resource: "_models.AddressResource", + address_resource: _models.AddressResource, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller["_models.AddressResource"]: + ) -> AsyncLROPoller[_models.AddressResource]: """Creates a new address with the specified parameters. Existing address can be updated with this API. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_resource: Address details from request body. + :param address_resource: Address details from request body. Required. :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @overload + async def begin_create_address( + self, + address_name: str, + resource_group_name: str, + address_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Creates a new address with the specified parameters. Existing address can be updated with this + API. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_resource: Address details from request body. Required. + :type address_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_address( + self, + address_name: str, + resource_group_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Creates a new address with the specified parameters. Existing address can be updated with this + API. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_resource: Address details from request body. Is either a AddressResource type or + a IO type. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_address_initial( address_name=address_name, resource_group_name=resource_group_name, address_resource=address_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) - + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _delete_address_by_name_initial( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any + begin_create_address.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + async def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements + self, address_name: str, resource_group_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self._delete_address_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_address_by_name_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_address_by_name_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_address_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _delete_address_by_name_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + @distributed_trace_async async def begin_delete_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any + self, address_name: str, resource_group_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes an address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, 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] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_address_by_name_initial( + raw_result = await self._delete_address_by_name_initial( # type: ignore address_name=address_name, resource_group_name=resource_group_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete_address_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } async def _update_address_initial( self, address_name: str, resource_group_name: str, - address_update_parameter: "_models.AddressUpdateParameter", + address_update_parameter: Union[_models.AddressUpdateParameter, IO], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional["_models.AddressResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] + ) -> Optional[_models.AddressResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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(address_update_parameter, 'AddressUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_update_parameter, (IO, bytes)): + _content = address_update_parameter + else: + _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") + + request = build_update_address_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_address_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _update_address_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload async def begin_update_address( self, address_name: str, resource_group_name: str, - address_update_parameter: "_models.AddressUpdateParameter", + address_update_parameter: _models.AddressUpdateParameter, if_match: Optional[str] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller["_models.AddressResource"]: + ) -> AsyncLROPoller[_models.AddressResource]: """Updates the properties of an existing address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. + :param address_update_parameter: Address update parameters from request body. Required. :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter :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. + of the job on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - 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_address_initial( - address_name=address_name, - resource_group_name=resource_group_name, - address_update_parameter=address_update_parameter, - if_match=if_match, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) + @overload + async def begin_update_address( + self, + address_name: str, + resource_group_name: str, + address_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Updates the properties of an existing address. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_address( + self, + address_name: str, + resource_group_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Updates the properties of an existing address. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_update_parameter: Address update parameters from request body. Is either a + AddressUpdateParameter type or a IO type. Required. + :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter + or IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_address_initial( + address_name=address_name, + resource_group_name=resource_group_name, + address_update_parameter=address_update_parameter, + if_match=if_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + begin_update_address.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @distributed_trace def list_order_at_resource_group_level( - self, - resource_group_name: str, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderResourceList"]: + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.OrderResource"]: """Lists order at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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_order_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', pipeline_response) + deserialized = self._deserialize("OrderResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_order_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + list_order_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" + } + + @distributed_trace_async async def get_order_by_name( - self, - order_name: str, - resource_group_name: str, - location: str, - **kwargs: Any - ) -> "_models.OrderResource": + self, order_name: str, resource_group_name: str, location: str, **kwargs: Any + ) -> _models.OrderResource: """Gets an order. - :param order_name: The name of the order. + :param order_name: The name of the order. Required. :type order_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param location: The name of Azure region. + :param location: The name of Azure region. Required. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource, or the result of cls(response) + :return: OrderResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self.get_order_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderName': self._serialize.url("order_name", order_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'location': self._serialize.url("location", location, 'str', min_length=1), - } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) + + request = build_get_order_by_name_request( + order_name=order_name, + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_order_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('OrderResource', pipeline_response) + deserialized = self._deserialize("OrderResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_order_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}'} # type: ignore + get_order_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" + } + + @distributed_trace def list_order_items_at_resource_group_level( self, resource_group_name: str, @@ -1242,708 +1792,1111 @@ def list_order_items_at_resource_group_level( expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResourceList"]: + ) -> AsyncIterable["_models.OrderItemResource"]: """Lists order item at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_items_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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_order_items_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_items_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', pipeline_response) + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( - get_next, extract_data - ) - list_order_items_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore + return AsyncItemPaged(get_next, extract_data) + + list_order_items_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" + } + @distributed_trace_async async def get_order_item_by_name( - self, - order_item_name: str, - resource_group_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.OrderItemResource": + self, order_item_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> _models.OrderItemResource: """Gets an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource, or the result of cls(response) + :return: OrderItemResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self.get_order_item_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + + request = build_get_order_item_by_name_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + template_url=self.get_order_item_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + + get_order_item_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } async def _create_order_item_initial( self, order_item_name: str, resource_group_name: str, - order_item_resource: "_models.OrderItemResource", + order_item_resource: Union[_models.OrderItemResource, IO], **kwargs: Any - ) -> Optional["_models.OrderItemResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] + ) -> Optional[_models.OrderItemResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(order_item_resource, 'OrderItemResource') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_resource, (IO, bytes)): + _content = order_item_resource + else: + _json = self._serialize.body(order_item_resource, "OrderItemResource") + + request = build_create_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _create_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload async def begin_create_order_item( self, order_item_name: str, resource_group_name: str, - order_item_resource: "_models.OrderItemResource", + order_item_resource: _models.OrderItemResource, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller["_models.OrderItemResource"]: + ) -> AsyncLROPoller[_models.OrderItemResource]: """Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_resource: Order item details from request body. + :param order_item_resource: Order item details from request body. Required. :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @overload + async def begin_create_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Creates an order item. Existing order item cannot be updated with this api and should instead + be updated with the Update order item API. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_resource: Order item details from request body. Required. + :type order_item_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Creates an order item. Existing order item cannot be updated with this api and should instead + be updated with the Update order item API. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_resource: Order item details from request body. Is either a OrderItemResource + type or a IO type. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_order_item_initial( order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_resource=order_item_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _delete_order_item_by_name_initial( - self, - order_item_name: str, - resource_group_name: str, - **kwargs: Any + begin_create_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + async def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements + self, order_item_name: str, resource_group_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 = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self._delete_order_item_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_order_item_by_name_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_order_item_by_name_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_order_item_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _delete_order_item_by_name_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + @distributed_trace_async async def begin_delete_order_item_by_name( - self, - order_item_name: str, - resource_group_name: str, - **kwargs: Any + self, order_item_name: str, resource_group_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, 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] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_order_item_by_name_initial( + raw_result = await self._delete_order_item_by_name_initial( # type: ignore order_item_name=order_item_name, resource_group_name=resource_group_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete_order_item_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } async def _update_order_item_initial( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: "_models.OrderItemUpdateParameter", + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional["_models.OrderItemResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] + ) -> Optional[_models.OrderItemResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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(order_item_update_parameter, 'OrderItemUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_update_parameter, (IO, bytes)): + _content = order_item_update_parameter + else: + _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") + + request = build_update_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _update_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload async def begin_update_order_item( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: "_models.OrderItemUpdateParameter", + order_item_update_parameter: _models.OrderItemUpdateParameter, if_match: Optional[str] = None, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller["_models.OrderItemResource"]: + ) -> AsyncLROPoller[_models.OrderItemResource]: """Updates the properties of an existing order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. - :type order_item_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter + :param order_item_update_parameter: order item update parameters from request body. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. + of the order on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @overload + async def begin_update_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Updates the properties of an existing order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_update_parameter: order item update parameters from request body. Required. + :type order_item_update_parameter: IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Updates the properties of an existing order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_update_parameter: order item update parameters from request body. Is either a + OrderItemUpdateParameter type or a IO type. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._update_order_item_initial( order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_update_parameter=order_item_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } - async def cancel_order_item( + @overload + async def cancel_order_item( # pylint: disable=inconsistent-return-statements self, order_item_name: str, resource_group_name: str, - cancellation_reason: "_models.CancellationReason", + cancellation_reason: _models.CancellationReason, + *, + content_type: str = "application/json", **kwargs: Any ) -> None: """Cancel order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. + :param cancellation_reason: Reason for cancellation. Required. :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def cancel_order_item( # pylint: disable=inconsistent-return-statements + self, + order_item_name: str, + resource_group_name: str, + cancellation_reason: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Cancel order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def cancel_order_item( # pylint: disable=inconsistent-return-statements + self, + order_item_name: str, + resource_group_name: str, + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any + ) -> None: + """Cancel order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO type. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: """ - 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 = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel_order_item.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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['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(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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cancellation_reason, (IO, bytes)): + _content = cancellation_reason + else: + _json = self._serialize.body(cancellation_reason, "CancellationReason") + + request = build_cancel_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.cancel_order_item.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - cancel_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel'} # type: ignore + cancel_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" + } - async def _return_order_item_initial( + async def _return_order_item_initial( # pylint: disable=inconsistent-return-statements self, order_item_name: str, resource_group_name: str, - return_order_item_details: "_models.ReturnOrderItemDetails", + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._return_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(return_order_item_details, 'ReturnOrderItemDetails') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(return_order_item_details, (IO, bytes)): + _content = return_order_item_details + else: + _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") + + request = build_return_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._return_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _return_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore + _return_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } + @overload async def begin_return_order_item( self, order_item_name: str, resource_group_name: str, - return_order_item_details: "_models.ReturnOrderItemDetails", + return_order_item_details: _models.ReturnOrderItemDetails, + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: """Return order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. - :type return_order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails + :param return_order_item_details: Return order item CurrentStatus. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, 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] + + @overload + async def begin_return_order_item( + self, + order_item_name: str, + resource_group_name: str, + return_order_item_details: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Return order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param return_order_item_details: Return order item CurrentStatus. Required. + :type return_order_item_details: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + + @distributed_trace_async + async def begin_return_order_item( + self, + order_item_name: str, + resource_group_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Return order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param return_order_item_details: Return order item CurrentStatus. Is either a + ReturnOrderItemDetails type or a IO type. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._return_order_item_initial( + raw_result = await self._return_order_item_initial( # type: ignore order_item_name=order_item_name, resource_group_name=resource_group_name, return_order_item_details=return_order_item_details, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_return_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_return_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/__init__.py index 4ad497e9c13d..d3d9ea404673 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/__init__.py @@ -6,274 +6,204 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import AddressDetails - from ._models_py3 import AddressProperties - from ._models_py3 import AddressResource - from ._models_py3 import AddressResourceList - from ._models_py3 import AddressUpdateParameter - from ._models_py3 import AvailabilityInformation - from ._models_py3 import BasicInformation - from ._models_py3 import BillingMeterDetails - from ._models_py3 import CancellationReason - from ._models_py3 import CommonProperties - from ._models_py3 import Configuration - from ._models_py3 import ConfigurationFilters - from ._models_py3 import ConfigurationProperties - from ._models_py3 import Configurations - from ._models_py3 import ConfigurationsRequest - from ._models_py3 import ContactDetails - from ._models_py3 import CostInformation - from ._models_py3 import CustomerSubscriptionDetails - from ._models_py3 import CustomerSubscriptionRegisteredFeatures - from ._models_py3 import Description - from ._models_py3 import DeviceDetails - from ._models_py3 import Dimensions - from ._models_py3 import DisplayInfo - from ._models_py3 import EncryptionPreferences - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import FilterableProperty - from ._models_py3 import ForwardShippingDetails - from ._models_py3 import HierarchyInformation - from ._models_py3 import ImageInformation - from ._models_py3 import Link - from ._models_py3 import ManagementResourcePreferences - from ._models_py3 import MeterDetails - from ._models_py3 import NotificationPreference - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import OrderItemDetails - from ._models_py3 import OrderItemResource - from ._models_py3 import OrderItemResourceList - from ._models_py3 import OrderItemUpdateParameter - from ._models_py3 import OrderResource - from ._models_py3 import OrderResourceList - from ._models_py3 import Pav2MeterDetails - from ._models_py3 import Preferences - from ._models_py3 import Product - from ._models_py3 import ProductDetails - from ._models_py3 import ProductFamilies - from ._models_py3 import ProductFamiliesMetadata - from ._models_py3 import ProductFamiliesMetadataDetails - from ._models_py3 import ProductFamiliesRequest - from ._models_py3 import ProductFamily - from ._models_py3 import ProductFamilyProperties - from ._models_py3 import ProductLine - from ._models_py3 import ProductLineProperties - from ._models_py3 import ProductProperties - from ._models_py3 import ProxyResource - from ._models_py3 import PurchaseMeterDetails - from ._models_py3 import Resource - from ._models_py3 import ResourceIdentity - from ._models_py3 import ResourceProviderDetails - from ._models_py3 import ReturnOrderItemDetails - from ._models_py3 import ReverseShippingDetails - from ._models_py3 import ShippingAddress - from ._models_py3 import ShippingDetails - from ._models_py3 import Specification - from ._models_py3 import StageDetails - from ._models_py3 import SystemData - from ._models_py3 import TrackedResource - from ._models_py3 import TransportPreferences -except (SyntaxError, ImportError): - from ._models import AddressDetails # type: ignore - from ._models import AddressProperties # type: ignore - from ._models import AddressResource # type: ignore - from ._models import AddressResourceList # type: ignore - from ._models import AddressUpdateParameter # type: ignore - from ._models import AvailabilityInformation # type: ignore - from ._models import BasicInformation # type: ignore - from ._models import BillingMeterDetails # type: ignore - from ._models import CancellationReason # type: ignore - from ._models import CommonProperties # type: ignore - from ._models import Configuration # type: ignore - from ._models import ConfigurationFilters # type: ignore - from ._models import ConfigurationProperties # type: ignore - from ._models import Configurations # type: ignore - from ._models import ConfigurationsRequest # type: ignore - from ._models import ContactDetails # type: ignore - from ._models import CostInformation # type: ignore - from ._models import CustomerSubscriptionDetails # type: ignore - from ._models import CustomerSubscriptionRegisteredFeatures # type: ignore - from ._models import Description # type: ignore - from ._models import DeviceDetails # type: ignore - from ._models import Dimensions # type: ignore - from ._models import DisplayInfo # type: ignore - from ._models import EncryptionPreferences # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import FilterableProperty # type: ignore - from ._models import ForwardShippingDetails # type: ignore - from ._models import HierarchyInformation # type: ignore - from ._models import ImageInformation # type: ignore - from ._models import Link # type: ignore - from ._models import ManagementResourcePreferences # type: ignore - from ._models import MeterDetails # type: ignore - from ._models import NotificationPreference # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OrderItemDetails # type: ignore - from ._models import OrderItemResource # type: ignore - from ._models import OrderItemResourceList # type: ignore - from ._models import OrderItemUpdateParameter # type: ignore - from ._models import OrderResource # type: ignore - from ._models import OrderResourceList # type: ignore - from ._models import Pav2MeterDetails # type: ignore - from ._models import Preferences # type: ignore - from ._models import Product # type: ignore - from ._models import ProductDetails # type: ignore - from ._models import ProductFamilies # type: ignore - from ._models import ProductFamiliesMetadata # type: ignore - from ._models import ProductFamiliesMetadataDetails # type: ignore - from ._models import ProductFamiliesRequest # type: ignore - from ._models import ProductFamily # type: ignore - from ._models import ProductFamilyProperties # type: ignore - from ._models import ProductLine # type: ignore - from ._models import ProductLineProperties # type: ignore - from ._models import ProductProperties # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import PurchaseMeterDetails # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceIdentity # type: ignore - from ._models import ResourceProviderDetails # type: ignore - from ._models import ReturnOrderItemDetails # type: ignore - from ._models import ReverseShippingDetails # type: ignore - from ._models import ShippingAddress # type: ignore - from ._models import ShippingDetails # type: ignore - from ._models import Specification # type: ignore - from ._models import StageDetails # type: ignore - from ._models import SystemData # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import TransportPreferences # type: ignore +from ._models_py3 import AddressDetails +from ._models_py3 import AddressProperties +from ._models_py3 import AddressResource +from ._models_py3 import AddressResourceList +from ._models_py3 import AddressUpdateParameter +from ._models_py3 import AvailabilityInformation +from ._models_py3 import BasicInformation +from ._models_py3 import BillingMeterDetails +from ._models_py3 import CancellationReason +from ._models_py3 import CommonProperties +from ._models_py3 import Configuration +from ._models_py3 import ConfigurationFilters +from ._models_py3 import ConfigurationProperties +from ._models_py3 import Configurations +from ._models_py3 import ConfigurationsRequest +from ._models_py3 import ContactDetails +from ._models_py3 import CostInformation +from ._models_py3 import CustomerSubscriptionDetails +from ._models_py3 import CustomerSubscriptionRegisteredFeatures +from ._models_py3 import Description +from ._models_py3 import DeviceDetails +from ._models_py3 import Dimensions +from ._models_py3 import DisplayInfo +from ._models_py3 import EncryptionPreferences +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import FilterableProperty +from ._models_py3 import ForwardShippingDetails +from ._models_py3 import HierarchyInformation +from ._models_py3 import ImageInformation +from ._models_py3 import Link +from ._models_py3 import ManagementResourcePreferences +from ._models_py3 import MeterDetails +from ._models_py3 import NotificationPreference +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import OrderItemDetails +from ._models_py3 import OrderItemResource +from ._models_py3 import OrderItemResourceList +from ._models_py3 import OrderItemUpdateParameter +from ._models_py3 import OrderResource +from ._models_py3 import OrderResourceList +from ._models_py3 import Pav2MeterDetails +from ._models_py3 import Preferences +from ._models_py3 import Product +from ._models_py3 import ProductDetails +from ._models_py3 import ProductFamilies +from ._models_py3 import ProductFamiliesMetadata +from ._models_py3 import ProductFamiliesMetadataDetails +from ._models_py3 import ProductFamiliesRequest +from ._models_py3 import ProductFamily +from ._models_py3 import ProductFamilyProperties +from ._models_py3 import ProductLine +from ._models_py3 import ProductLineProperties +from ._models_py3 import ProductProperties +from ._models_py3 import ProxyResource +from ._models_py3 import PurchaseMeterDetails +from ._models_py3 import Resource +from ._models_py3 import ResourceIdentity +from ._models_py3 import ResourceProviderDetails +from ._models_py3 import ReturnOrderItemDetails +from ._models_py3 import ReverseShippingDetails +from ._models_py3 import ShippingAddress +from ._models_py3 import ShippingDetails +from ._models_py3 import Specification +from ._models_py3 import StageDetails +from ._models_py3 import SystemData +from ._models_py3 import TrackedResource +from ._models_py3 import TransportPreferences -from ._edge_order_management_client_enums import ( - ActionStatusEnum, - ActionType, - AddressType, - AddressValidationStatus, - AvailabilityStage, - BillingType, - ChargingType, - CreatedByType, - DescriptionType, - DisabledReason, - DoubleEncryptionStatus, - ImageType, - LengthHeightUnit, - LinkType, - MeteringType, - NotificationStageName, - OrderItemCancellationEnum, - OrderItemReturnEnum, - OrderItemType, - Origin, - StageName, - StageStatus, - SupportedFilterTypes, - TransportShipmentTypes, - WeightMeasurementUnit, -) +from ._edge_order_management_client_enums import ActionStatusEnum +from ._edge_order_management_client_enums import ActionType +from ._edge_order_management_client_enums import AddressType +from ._edge_order_management_client_enums import AddressValidationStatus +from ._edge_order_management_client_enums import AvailabilityStage +from ._edge_order_management_client_enums import BillingType +from ._edge_order_management_client_enums import ChargingType +from ._edge_order_management_client_enums import CreatedByType +from ._edge_order_management_client_enums import DescriptionType +from ._edge_order_management_client_enums import DisabledReason +from ._edge_order_management_client_enums import DoubleEncryptionStatus +from ._edge_order_management_client_enums import ImageType +from ._edge_order_management_client_enums import LengthHeightUnit +from ._edge_order_management_client_enums import LinkType +from ._edge_order_management_client_enums import MeteringType +from ._edge_order_management_client_enums import NotificationStageName +from ._edge_order_management_client_enums import OrderItemCancellationEnum +from ._edge_order_management_client_enums import OrderItemReturnEnum +from ._edge_order_management_client_enums import OrderItemType +from ._edge_order_management_client_enums import Origin +from ._edge_order_management_client_enums import StageName +from ._edge_order_management_client_enums import StageStatus +from ._edge_order_management_client_enums import SupportedFilterTypes +from ._edge_order_management_client_enums import TransportShipmentTypes +from ._edge_order_management_client_enums import WeightMeasurementUnit +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk __all__ = [ - 'AddressDetails', - 'AddressProperties', - 'AddressResource', - 'AddressResourceList', - 'AddressUpdateParameter', - 'AvailabilityInformation', - 'BasicInformation', - 'BillingMeterDetails', - 'CancellationReason', - 'CommonProperties', - 'Configuration', - 'ConfigurationFilters', - 'ConfigurationProperties', - 'Configurations', - 'ConfigurationsRequest', - 'ContactDetails', - 'CostInformation', - 'CustomerSubscriptionDetails', - 'CustomerSubscriptionRegisteredFeatures', - 'Description', - 'DeviceDetails', - 'Dimensions', - 'DisplayInfo', - 'EncryptionPreferences', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'FilterableProperty', - 'ForwardShippingDetails', - 'HierarchyInformation', - 'ImageInformation', - 'Link', - 'ManagementResourcePreferences', - 'MeterDetails', - 'NotificationPreference', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'OrderItemDetails', - 'OrderItemResource', - 'OrderItemResourceList', - 'OrderItemUpdateParameter', - 'OrderResource', - 'OrderResourceList', - 'Pav2MeterDetails', - 'Preferences', - 'Product', - 'ProductDetails', - 'ProductFamilies', - 'ProductFamiliesMetadata', - 'ProductFamiliesMetadataDetails', - 'ProductFamiliesRequest', - 'ProductFamily', - 'ProductFamilyProperties', - 'ProductLine', - 'ProductLineProperties', - 'ProductProperties', - 'ProxyResource', - 'PurchaseMeterDetails', - 'Resource', - 'ResourceIdentity', - 'ResourceProviderDetails', - 'ReturnOrderItemDetails', - 'ReverseShippingDetails', - 'ShippingAddress', - 'ShippingDetails', - 'Specification', - 'StageDetails', - 'SystemData', - 'TrackedResource', - 'TransportPreferences', - 'ActionStatusEnum', - 'ActionType', - 'AddressType', - 'AddressValidationStatus', - 'AvailabilityStage', - 'BillingType', - 'ChargingType', - 'CreatedByType', - 'DescriptionType', - 'DisabledReason', - 'DoubleEncryptionStatus', - 'ImageType', - 'LengthHeightUnit', - 'LinkType', - 'MeteringType', - 'NotificationStageName', - 'OrderItemCancellationEnum', - 'OrderItemReturnEnum', - 'OrderItemType', - 'Origin', - 'StageName', - 'StageStatus', - 'SupportedFilterTypes', - 'TransportShipmentTypes', - 'WeightMeasurementUnit', + "AddressDetails", + "AddressProperties", + "AddressResource", + "AddressResourceList", + "AddressUpdateParameter", + "AvailabilityInformation", + "BasicInformation", + "BillingMeterDetails", + "CancellationReason", + "CommonProperties", + "Configuration", + "ConfigurationFilters", + "ConfigurationProperties", + "Configurations", + "ConfigurationsRequest", + "ContactDetails", + "CostInformation", + "CustomerSubscriptionDetails", + "CustomerSubscriptionRegisteredFeatures", + "Description", + "DeviceDetails", + "Dimensions", + "DisplayInfo", + "EncryptionPreferences", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "FilterableProperty", + "ForwardShippingDetails", + "HierarchyInformation", + "ImageInformation", + "Link", + "ManagementResourcePreferences", + "MeterDetails", + "NotificationPreference", + "Operation", + "OperationDisplay", + "OperationListResult", + "OrderItemDetails", + "OrderItemResource", + "OrderItemResourceList", + "OrderItemUpdateParameter", + "OrderResource", + "OrderResourceList", + "Pav2MeterDetails", + "Preferences", + "Product", + "ProductDetails", + "ProductFamilies", + "ProductFamiliesMetadata", + "ProductFamiliesMetadataDetails", + "ProductFamiliesRequest", + "ProductFamily", + "ProductFamilyProperties", + "ProductLine", + "ProductLineProperties", + "ProductProperties", + "ProxyResource", + "PurchaseMeterDetails", + "Resource", + "ResourceIdentity", + "ResourceProviderDetails", + "ReturnOrderItemDetails", + "ReverseShippingDetails", + "ShippingAddress", + "ShippingDetails", + "Specification", + "StageDetails", + "SystemData", + "TrackedResource", + "TransportPreferences", + "ActionStatusEnum", + "ActionType", + "AddressType", + "AddressValidationStatus", + "AvailabilityStage", + "BillingType", + "ChargingType", + "CreatedByType", + "DescriptionType", + "DisabledReason", + "DoubleEncryptionStatus", + "ImageType", + "LengthHeightUnit", + "LinkType", + "MeteringType", + "NotificationStageName", + "OrderItemCancellationEnum", + "OrderItemReturnEnum", + "OrderItemType", + "Origin", + "StageName", + "StageStatus", + "SupportedFilterTypes", + "TransportShipmentTypes", + "WeightMeasurementUnit", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_edge_order_management_client_enums.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_edge_order_management_client_enums.py index 9ca4d57a1387..08fee5827f42 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_edge_order_management_client_enums.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_edge_order_management_client_enums.py @@ -6,312 +6,297 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta -from six import with_metaclass - -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 ActionStatusEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Describes whether the order item is deletable or not. - """ +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class ActionStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes whether the order item is deletable or not.""" - #: Allowed flag. ALLOWED = "Allowed" - #: Not Allowed flag. + """Allowed flag.""" NOT_ALLOWED = "NotAllowed" + """Not Allowed flag.""" -class ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """ + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" INTERNAL = "Internal" -class AddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of address. - """ - #: Address type not known. +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + NONE = "None" - #: Residential Address. + """Address type not known.""" RESIDENTIAL = "Residential" - #: Commercial Address. + """Residential Address.""" COMMERCIAL = "Commercial" + """Commercial Address.""" -class AddressValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Status of address validation - """ - #: Address provided is valid. +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of address validation.""" + VALID = "Valid" - #: Address provided is invalid or not supported. + """Address provided is valid.""" INVALID = "Invalid" - #: Address provided is ambiguous, please choose one of the alternate addresses returned. + """Address provided is invalid or not supported.""" AMBIGUOUS = "Ambiguous" + """Address provided is ambiguous, please choose one of the alternate addresses returned.""" -class AvailabilityStage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Current availability stage of the product. Availability stage - """ - #: Product is available. +class AvailabilityStage(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current availability stage of the product. Availability stage.""" + AVAILABLE = "Available" - #: Product is coming soon. + """Product is available.""" COMING_SOON = "ComingSoon" - #: Product is in preview. + """Product is coming soon.""" PREVIEW = "Preview" - #: Product is deprecated. + """Product is in preview.""" DEPRECATED = "Deprecated" - #: Product is available only on signup. + """Product is deprecated.""" SIGNUP = "Signup" - #: Product is not available. + """Product is available only on signup.""" UNAVAILABLE = "Unavailable" + """Product is not available.""" -class BillingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents billing type. - """ - #: PaV2 billing. +class BillingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents billing type.""" + PAV2 = "Pav2" - #: Purchase billing. + """PaV2 billing.""" PURCHASE = "Purchase" + """Purchase billing.""" -class ChargingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Charging type. - """ - #: Per order charging type. +class ChargingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Charging type.""" + PER_ORDER = "PerOrder" - #: Per device charging type. + """Per order charging type.""" PER_DEVICE = "PerDevice" + """Per device charging type.""" -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class DescriptionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of description. - """ - #: Base description. +class DescriptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of description.""" + BASE = "Base" + """Base description.""" -class DisabledReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Reason why the product is disabled. - """ - #: Not disabled. +class DisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the product is disabled.""" + NONE = "None" - #: Not available in the requested country. + """Not disabled.""" COUNTRY = "Country" - #: Not available to push data to the requested Azure region. + """Not available in the requested country.""" REGION = "Region" - #: Required features are not enabled. + """Not available to push data to the requested Azure region.""" FEATURE = "Feature" - #: Subscription does not have required offer types. + """Required features are not enabled.""" OFFER_TYPE = "OfferType" - #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification. + """Subscription does not have required offer types.""" NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - #: The product is not yet available. + """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification.""" NOT_AVAILABLE = "NotAvailable" - #: The product is out of stock. + """The product is not yet available.""" OUT_OF_STOCK = "OutOfStock" + """The product is out of stock.""" + -class DoubleEncryptionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DoubleEncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Double encryption status as entered by the customer. It is compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. """ - #: Double encryption is disabled. DISABLED = "Disabled" - #: Double encryption is enabled. + """Double encryption is disabled""" ENABLED = "Enabled" + """Double encryption is enabled""" -class ImageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the image - """ - #: Main image. +class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the image.""" + MAIN_IMAGE = "MainImage" - #: Bullet image. + """Main image.""" BULLET_IMAGE = "BulletImage" - #: Generic image. + """Bullet image.""" GENERIC_IMAGE = "GenericImage" + """Generic image.""" -class LengthHeightUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Unit for the dimensions of length, height and width. - """ - #: Inch, applicable for West US. - IN_ENUM = "IN" - #: Centimeter. +class LengthHeightUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Unit for the dimensions of length, height and width.""" + + IN = "IN" + """Inch, applicable for West US.""" CM = "CM" + """Centimeter.""" -class LinkType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of link - """ - #: Generic link. +class LinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of link.""" + GENERIC = "Generic" - #: Terms and conditions link. + """Generic link.""" TERMS_AND_CONDITIONS = "TermsAndConditions" - #: Link to product specification. + """Terms and conditions link.""" SPECIFICATION = "Specification" - #: Link to product documentation. + """Link to product specification.""" DOCUMENTATION = "Documentation" - #: Link to know more. + """Link to product documentation""" KNOW_MORE = "KnowMore" - #: Link to sign up for products. + """Link to know more""" SIGN_UP = "SignUp" + """Link to sign up for products""" -class MeteringType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents Metering type (eg one-time or recurrent) - """ - #: One time billing. +class MeteringType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents Metering type (eg one-time or recurrent).""" + ONE_TIME = "OneTime" - #: Recurring billing. + """One time billing.""" RECURRING = "Recurring" - #: Adhoc billing. + """Recurring billing.""" ADHOC = "Adhoc" + """Adhoc billing.""" -class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of the stage. - """ - #: Notification at order item shipped from microsoft datacenter. +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + SHIPPED = "Shipped" - #: Notification at order item delivered to customer. + """Notification at order item shipped from microsoft datacenter.""" DELIVERED = "Delivered" + """Notification at order item delivered to customer.""" -class OrderItemCancellationEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Describes whether the order item is cancellable or not. - """ - #: Order item can be cancelled without fee. +class OrderItemCancellationEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes whether the order item is cancellable or not.""" + CANCELLABLE = "Cancellable" - #: Order item can be cancelled with fee. + """Order item can be cancelled without fee.""" CANCELLABLE_WITH_FEE = "CancellableWithFee" - #: Order item not cancellable. + """Order item can be cancelled with fee.""" NOT_CANCELLABLE = "NotCancellable" + """Order item not cancellable.""" -class OrderItemReturnEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Describes whether the order item is returnable or not. - """ - #: Order item can be returned without fee. +class OrderItemReturnEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes whether the order item is returnable or not.""" + RETURNABLE = "Returnable" - #: Order item can be returned with fee. + """Order item can be returned without fee.""" RETURNABLE_WITH_FEE = "ReturnableWithFee" - #: Order item not returnable. + """Order item can be returned with fee.""" NOT_RETURNABLE = "NotReturnable" + """Order item not returnable.""" -class OrderItemType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Order item type. - """ - #: Purchase OrderItem. +class OrderItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Order item type.""" + PURCHASE = "Purchase" - #: Rental OrderItem. + """Purchase OrderItem.""" RENTAL = "Rental" + """Rental OrderItem.""" + -class Origin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system" + logs UX. Default value is "user,system". """ USER = "user" SYSTEM = "system" USER_SYSTEM = "user,system" -class StageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Stage name - """ - #: Currently in draft mode and can still be cancelled. +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Stage name.""" + PLACED = "Placed" - #: Order is currently in draft mode and can still be cancelled. + """Currently in draft mode and can still be cancelled""" IN_REVIEW = "InReview" - #: Order is confirmed. + """Order is currently in draft mode and can still be cancelled""" CONFIRMED = "Confirmed" - #: Order is ready to ship. + """Order is confirmed""" READY_TO_SHIP = "ReadyToShip" - #: Order is in transit to customer. + """Order is ready to ship""" SHIPPED = "Shipped" - #: Order is delivered to customer. + """Order is in transit to customer""" DELIVERED = "Delivered" - #: Order is in use at customer site. + """Order is delivered to customer""" IN_USE = "InUse" - #: Return has been initiated by customer. + """Order is in use at customer site""" RETURN_INITIATED = "ReturnInitiated" - #: Order is in transit from customer to microsoft. + """Return has been initiated by customer.""" RETURN_PICKED_UP = "ReturnPickedUp" - #: Order has been received back to microsoft. + """Order is in transit from customer to microsoft.""" RETURNED_TO_MICROSOFT = "ReturnedToMicrosoft" - #: Return has now completed. + """Order has been received back to microsoft.""" RETURN_COMPLETED = "ReturnCompleted" - #: Order has been cancelled. + """Return has now completed.""" CANCELLED = "Cancelled" + """Order has been cancelled.""" -class StageStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Stage status. - """ - #: No status available yet. +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Stage status.""" + NONE = "None" - #: Stage is in progress. + """No status available yet.""" IN_PROGRESS = "InProgress" - #: Stage has succeeded. + """Stage is in progress.""" SUCCEEDED = "Succeeded" - #: Stage has failed. + """Stage has succeeded.""" FAILED = "Failed" - #: Stage has been cancelled. + """Stage has failed.""" CANCELLED = "Cancelled" - #: Stage is cancelling. + """Stage has been cancelled.""" CANCELLING = "Cancelling" + """Stage is cancelling.""" -class SupportedFilterTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of product filter. - """ - #: Ship to country. +class SupportedFilterTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of product filter.""" + SHIP_TO_COUNTRIES = "ShipToCountries" - #: Double encryption status. + """Ship to country""" DOUBLE_ENCRYPTION_STATUS = "DoubleEncryptionStatus" + """Double encryption status""" -class TransportShipmentTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates Shipment Logistics type that the customer preferred. - """ - #: Shipment Logistics is handled by the customer. +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates Shipment Logistics type that the customer preferred.""" + CUSTOMER_MANAGED = "CustomerManaged" - #: Shipment Logistics is handled by Microsoft. + """Shipment Logistics is handled by the customer.""" MICROSOFT_MANAGED = "MicrosoftManaged" + """Shipment Logistics is handled by Microsoft.""" -class WeightMeasurementUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Unit for the dimensions of weight. - """ - #: Pounds. +class WeightMeasurementUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Unit for the dimensions of weight.""" + LBS = "LBS" - #: Kilograms. + """Pounds.""" KGS = "KGS" + """Kilograms.""" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models.py deleted file mode 100644 index ae4b56047e31..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models.py +++ /dev/null @@ -1,2948 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class AddressDetails(msrest.serialization.Model): - """Address details for an order item. - - 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 forward_address: Required. Customer address and contact details. It should be address - resource. - :type forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties - :ivar return_address: Return shipping address. - :vartype return_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties - """ - - _validation = { - 'forward_address': {'required': True}, - 'return_address': {'readonly': True}, - } - - _attribute_map = { - 'forward_address': {'key': 'forwardAddress', 'type': 'AddressProperties'}, - 'return_address': {'key': 'returnAddress', 'type': 'AddressProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressDetails, self).__init__(**kwargs) - self.forward_address = kwargs['forward_address'] - self.return_address = None - - -class AddressProperties(msrest.serialization.Model): - """Address Properties. - - 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 shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress - :param contact_details: Required. Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails - :ivar address_validation_status: Status of address validation. Possible values include: - "Valid", "Invalid", "Ambiguous". - :vartype address_validation_status: str or - ~azure.mgmt.edgeorder.v2021_12_01.models.AddressValidationStatus - """ - - _validation = { - 'contact_details': {'required': True}, - 'address_validation_status': {'readonly': True}, - } - - _attribute_map = { - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'address_validation_status': {'key': 'addressValidationStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressProperties, self).__init__(**kwargs) - self.shipping_address = kwargs.get('shipping_address', None) - self.contact_details = kwargs['contact_details'] - self.address_validation_status = None - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a '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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] - - -class AddressResource(TrackedResource): - """Address 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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2021_12_01.models.SystemData - :param shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress - :param contact_details: Required. Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails - :ivar address_validation_status: Status of address validation. Possible values include: - "Valid", "Invalid", "Ambiguous". - :vartype address_validation_status: str or - ~azure.mgmt.edgeorder.v2021_12_01.models.AddressValidationStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'contact_details': {'required': True}, - 'address_validation_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'properties.contactDetails', 'type': 'ContactDetails'}, - 'address_validation_status': {'key': 'properties.addressValidationStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressResource, self).__init__(**kwargs) - self.system_data = None - self.shipping_address = kwargs.get('shipping_address', None) - self.contact_details = kwargs['contact_details'] - self.address_validation_status = None - - -class AddressResourceList(msrest.serialization.Model): - """Address Resource Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of address resources. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :param next_link: Link for the next set of job resources. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[AddressResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressResourceList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class AddressUpdateParameter(msrest.serialization.Model): - """The Address update parameters. - - :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 shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress - :param contact_details: Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'properties.contactDetails', 'type': 'ContactDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.shipping_address = kwargs.get('shipping_address', None) - self.contact_details = kwargs.get('contact_details', None) - - -class AvailabilityInformation(msrest.serialization.Model): - """Availability information of a product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar availability_stage: Current availability stage of the product. Availability stage. - Possible values include: "Available", "ComingSoon", "Preview", "Deprecated", "Signup", - "Unavailable". - :vartype availability_stage: str or ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityStage - :ivar disabled_reason: Reason why the product is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo", "NotAvailable", - "OutOfStock". - :vartype disabled_reason: str or ~azure.mgmt.edgeorder.v2021_12_01.models.DisabledReason - :ivar disabled_reason_message: Message for why the product is disabled. - :vartype disabled_reason_message: str - """ - - _validation = { - 'availability_stage': {'readonly': True}, - 'disabled_reason': {'readonly': True}, - 'disabled_reason_message': {'readonly': True}, - } - - _attribute_map = { - 'availability_stage': {'key': 'availabilityStage', 'type': 'str'}, - 'disabled_reason': {'key': 'disabledReason', 'type': 'str'}, - 'disabled_reason_message': {'key': 'disabledReasonMessage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AvailabilityInformation, self).__init__(**kwargs) - self.availability_stage = None - self.disabled_reason = None - self.disabled_reason_message = None - - -class BasicInformation(msrest.serialization.Model): - """Basic information for any product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - } - - def __init__( - self, - **kwargs - ): - super(BasicInformation, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - - -class BillingMeterDetails(msrest.serialization.Model): - """Holds billing meter details for each type of billing. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Represents Billing type name. - :vartype name: str - :ivar meter_details: Represents MeterDetails. - :vartype meter_details: ~azure.mgmt.edgeorder.v2021_12_01.models.MeterDetails - :ivar metering_type: Represents Metering type (eg one-time or recurrent). Possible values - include: "OneTime", "Recurring", "Adhoc". - :vartype metering_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.MeteringType - :ivar frequency: Frequency of recurrence. - :vartype frequency: str - """ - - _validation = { - 'name': {'readonly': True}, - 'meter_details': {'readonly': True}, - 'metering_type': {'readonly': True}, - 'frequency': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, - 'metering_type': {'key': 'meteringType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(BillingMeterDetails, self).__init__(**kwargs) - self.name = None - self.meter_details = None - self.metering_type = None - self.frequency = 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 CommonProperties(BasicInformation): - """Represents common properties across product hierarchy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(CommonProperties, self).__init__(**kwargs) - self.filterable_properties = None - - -class Configuration(msrest.serialization.Model): - """Configuration object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2021_12_01.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2021_12_01.models.Dimensions - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'specifications': {'readonly': True}, - 'dimensions': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'specifications': {'key': 'properties.specifications', 'type': '[Specification]'}, - 'dimensions': {'key': 'properties.dimensions', 'type': 'Dimensions'}, - } - - def __init__( - self, - **kwargs - ): - super(Configuration, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.specifications = None - self.dimensions = None - - -class ConfigurationFilters(msrest.serialization.Model): - """Configuration filters. - - All required parameters must be populated in order to send to Azure. - - :param hierarchy_information: Required. Product hierarchy information. - :type hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :param filterable_property: Filters specific to product. - :type filterable_property: list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - """ - - _validation = { - 'hierarchy_information': {'required': True}, - } - - _attribute_map = { - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_property': {'key': 'filterableProperty', 'type': '[FilterableProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationFilters, self).__init__(**kwargs) - self.hierarchy_information = kwargs['hierarchy_information'] - self.filterable_property = kwargs.get('filterable_property', None) - - -class ConfigurationProperties(CommonProperties): - """Properties of configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2021_12_01.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2021_12_01.models.Dimensions - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'specifications': {'readonly': True}, - 'dimensions': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'specifications': {'key': 'specifications', 'type': '[Specification]'}, - 'dimensions': {'key': 'dimensions', 'type': 'Dimensions'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationProperties, self).__init__(**kwargs) - self.specifications = None - self.dimensions = None - - -class Configurations(msrest.serialization.Model): - """The list of configurations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of configurations. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] - :param next_link: Link for the next set of configurations. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Configuration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Configurations, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class ConfigurationsRequest(msrest.serialization.Model): - """Configuration request object. - - All required parameters must be populated in order to send to Azure. - - :param configuration_filters: Required. Holds details about product hierarchy information and - filterable property. - :type configuration_filters: - list[~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationFilters] - :param customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :type customer_subscription_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionDetails - """ - - _validation = { - 'configuration_filters': {'required': True, 'unique': True}, - } - - _attribute_map = { - 'configuration_filters': {'key': 'configurationFilters', 'type': '[ConfigurationFilters]'}, - 'customer_subscription_details': {'key': 'customerSubscriptionDetails', 'type': 'CustomerSubscriptionDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationsRequest, self).__init__(**kwargs) - self.configuration_filters = kwargs['configuration_filters'] - self.customer_subscription_details = kwargs.get('customer_subscription_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] - """ - - _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]'}, - } - - 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'] - - -class CostInformation(msrest.serialization.Model): - """Cost information for the product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar billing_meter_details: Details on the various billing aspects for the product system. - :vartype billing_meter_details: - list[~azure.mgmt.edgeorder.v2021_12_01.models.BillingMeterDetails] - :ivar billing_info_url: Default url to display billing information. - :vartype billing_info_url: str - """ - - _validation = { - 'billing_meter_details': {'readonly': True}, - 'billing_info_url': {'readonly': True}, - } - - _attribute_map = { - 'billing_meter_details': {'key': 'billingMeterDetails', 'type': '[BillingMeterDetails]'}, - 'billing_info_url': {'key': 'billingInfoUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CostInformation, self).__init__(**kwargs) - self.billing_meter_details = None - self.billing_info_url = None - - -class CustomerSubscriptionDetails(msrest.serialization.Model): - """Holds Customer subscription details. Clients can display available products to unregistered customers by explicitly passing subscription details. - - All required parameters must be populated in order to send to Azure. - - :param registered_features: List of registered feature flags for subscription. - :type registered_features: - list[~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionRegisteredFeatures] - :param location_placement_id: Location placement Id of a subscription. - :type location_placement_id: str - :param quota_id: Required. Quota ID of a subscription. - :type quota_id: str - """ - - _validation = { - 'quota_id': {'required': True}, - } - - _attribute_map = { - 'registered_features': {'key': 'registeredFeatures', 'type': '[CustomerSubscriptionRegisteredFeatures]'}, - 'location_placement_id': {'key': 'locationPlacementId', 'type': 'str'}, - 'quota_id': {'key': 'quotaId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CustomerSubscriptionDetails, self).__init__(**kwargs) - self.registered_features = kwargs.get('registered_features', None) - self.location_placement_id = kwargs.get('location_placement_id', None) - self.quota_id = kwargs['quota_id'] - - -class CustomerSubscriptionRegisteredFeatures(msrest.serialization.Model): - """Represents subscription registered features. - - :param name: Name of subscription registered feature. - :type name: str - :param state: State of subscription registered feature. - :type state: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CustomerSubscriptionRegisteredFeatures, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.state = kwargs.get('state', None) - - -class Description(msrest.serialization.Model): - """Description related properties of a product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description_type: Type of description. Possible values include: "Base". - :vartype description_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.DescriptionType - :ivar short_description: Short description of the product system. - :vartype short_description: str - :ivar long_description: Long description of the product system. - :vartype long_description: str - :ivar keywords: Keywords for the product system. - :vartype keywords: list[str] - :ivar attributes: Attributes for the product system. - :vartype attributes: list[str] - :ivar links: Links for the product system. - :vartype links: list[~azure.mgmt.edgeorder.v2021_12_01.models.Link] - """ - - _validation = { - 'description_type': {'readonly': True}, - 'short_description': {'readonly': True}, - 'long_description': {'readonly': True}, - 'keywords': {'readonly': True}, - 'attributes': {'readonly': True}, - 'links': {'readonly': True}, - } - - _attribute_map = { - 'description_type': {'key': 'descriptionType', 'type': 'str'}, - 'short_description': {'key': 'shortDescription', 'type': 'str'}, - 'long_description': {'key': 'longDescription', 'type': 'str'}, - 'keywords': {'key': 'keywords', 'type': '[str]'}, - 'attributes': {'key': 'attributes', 'type': '[str]'}, - 'links': {'key': 'links', 'type': '[Link]'}, - } - - def __init__( - self, - **kwargs - ): - super(Description, self).__init__(**kwargs) - self.description_type = None - self.short_description = None - self.long_description = None - self.keywords = None - self.attributes = None - self.links = None - - -class DeviceDetails(msrest.serialization.Model): - """Device details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar serial_number: device serial number. - :vartype serial_number: str - :ivar management_resource_id: Management Resource Id. - :vartype management_resource_id: str - :ivar management_resource_tenant_id: Management Resource Tenant ID. - :vartype management_resource_tenant_id: str - """ - - _validation = { - 'serial_number': {'readonly': True}, - 'management_resource_id': {'readonly': True}, - 'management_resource_tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'serial_number': {'key': 'serialNumber', 'type': 'str'}, - 'management_resource_id': {'key': 'managementResourceId', 'type': 'str'}, - 'management_resource_tenant_id': {'key': 'managementResourceTenantId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DeviceDetails, self).__init__(**kwargs) - self.serial_number = None - self.management_resource_id = None - self.management_resource_tenant_id = None - - -class Dimensions(msrest.serialization.Model): - """Dimensions of a configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar length: Length of the device. - :vartype length: float - :ivar height: Height of the device. - :vartype height: float - :ivar width: Width of the device. - :vartype width: float - :ivar length_height_unit: Unit for the dimensions of length, height and width. Possible values - include: "IN", "CM". - :vartype length_height_unit: str or ~azure.mgmt.edgeorder.v2021_12_01.models.LengthHeightUnit - :ivar weight: Weight of the device. - :vartype weight: float - :ivar depth: Depth of the device. - :vartype depth: float - :ivar weight_unit: Unit for the dimensions of weight. Possible values include: "LBS", "KGS". - :vartype weight_unit: str or ~azure.mgmt.edgeorder.v2021_12_01.models.WeightMeasurementUnit - """ - - _validation = { - 'length': {'readonly': True}, - 'height': {'readonly': True}, - 'width': {'readonly': True}, - 'length_height_unit': {'readonly': True}, - 'weight': {'readonly': True}, - 'depth': {'readonly': True}, - 'weight_unit': {'readonly': True}, - } - - _attribute_map = { - 'length': {'key': 'length', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'length_height_unit': {'key': 'lengthHeightUnit', 'type': 'str'}, - 'weight': {'key': 'weight', 'type': 'float'}, - 'depth': {'key': 'depth', 'type': 'float'}, - 'weight_unit': {'key': 'weightUnit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Dimensions, self).__init__(**kwargs) - self.length = None - self.height = None - self.width = None - self.length_height_unit = None - self.weight = None - self.depth = None - self.weight_unit = None - - -class DisplayInfo(msrest.serialization.Model): - """Describes product display information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar product_family_display_name: Product family display name. - :vartype product_family_display_name: str - :ivar configuration_display_name: Configuration display name. - :vartype configuration_display_name: str - """ - - _validation = { - 'product_family_display_name': {'readonly': True}, - 'configuration_display_name': {'readonly': True}, - } - - _attribute_map = { - 'product_family_display_name': {'key': 'productFamilyDisplayName', 'type': 'str'}, - 'configuration_display_name': {'key': 'configurationDisplayName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DisplayInfo, self).__init__(**kwargs) - self.product_family_display_name = None - self.configuration_display_name = None - - -class EncryptionPreferences(msrest.serialization.Model): - """Preferences related to the double encryption. - - :param double_encryption_status: Double encryption status as entered by the customer. It is - compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Possible - values include: "Disabled", "Enabled". - :type double_encryption_status: str or - ~azure.mgmt.edgeorder.v2021_12_01.models.DoubleEncryptionStatus - """ - - _attribute_map = { - 'double_encryption_status': {'key': 'doubleEncryptionStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EncryptionPreferences, self).__init__(**kwargs) - self.double_encryption_status = kwargs.get('double_encryption_status', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.edgeorder.v2021_12_01.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - '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': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :param error: The error object. - :type error: ~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class FilterableProperty(msrest.serialization.Model): - """Different types of filters supported and its values. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Type of product filter. Possible values include: "ShipToCountries", - "DoubleEncryptionStatus". - :type type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.SupportedFilterTypes - :param supported_values: Required. Values to be filtered. - :type supported_values: list[str] - """ - - _validation = { - 'type': {'required': True}, - 'supported_values': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'supported_values': {'key': 'supportedValues', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(FilterableProperty, self).__init__(**kwargs) - self.type = kwargs['type'] - self.supported_values = kwargs['supported_values'] - - -class ForwardShippingDetails(msrest.serialization.Model): - """Forward shipment 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 carrier_display_name: Carrier Name for display purpose. Not to be used for any - processing. - :vartype carrier_display_name: str - :ivar tracking_id: TrackingId of the package. - :vartype tracking_id: str - :ivar tracking_url: TrackingUrl of the package. - :vartype tracking_url: str - """ - - _validation = { - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, - } - - _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ForwardShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = None - - -class HierarchyInformation(msrest.serialization.Model): - """Holds details about product hierarchy information. - - :param product_family_name: Represents product family name that uniquely identifies product - family. - :type product_family_name: str - :param product_line_name: Represents product line name that uniquely identifies product line. - :type product_line_name: str - :param product_name: Represents product name that uniquely identifies product. - :type product_name: str - :param configuration_name: Represents configuration name that uniquely identifies - configuration. - :type configuration_name: str - """ - - _attribute_map = { - 'product_family_name': {'key': 'productFamilyName', 'type': 'str'}, - 'product_line_name': {'key': 'productLineName', 'type': 'str'}, - 'product_name': {'key': 'productName', 'type': 'str'}, - 'configuration_name': {'key': 'configurationName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HierarchyInformation, self).__init__(**kwargs) - self.product_family_name = kwargs.get('product_family_name', None) - self.product_line_name = kwargs.get('product_line_name', None) - self.product_name = kwargs.get('product_name', None) - self.configuration_name = kwargs.get('configuration_name', None) - - -class ImageInformation(msrest.serialization.Model): - """Image for the product. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar image_type: Type of the image. Possible values include: "MainImage", "BulletImage", - "GenericImage". - :vartype image_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ImageType - :ivar image_url: Url of the image. - :vartype image_url: str - """ - - _validation = { - 'image_type': {'readonly': True}, - 'image_url': {'readonly': True}, - } - - _attribute_map = { - 'image_type': {'key': 'imageType', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ImageInformation, self).__init__(**kwargs) - self.image_type = None - self.image_url = None - - -class Link(msrest.serialization.Model): - """Returns link related to the product. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar link_type: Type of link. Possible values include: "Generic", "TermsAndConditions", - "Specification", "Documentation", "KnowMore", "SignUp". - :vartype link_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.LinkType - :ivar link_url: Url of the link. - :vartype link_url: str - """ - - _validation = { - 'link_type': {'readonly': True}, - 'link_url': {'readonly': True}, - } - - _attribute_map = { - 'link_type': {'key': 'linkType', 'type': 'str'}, - 'link_url': {'key': 'linkUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Link, self).__init__(**kwargs) - self.link_type = None - self.link_url = None - - -class ManagementResourcePreferences(msrest.serialization.Model): - """Management resource preference to link device. - - :param preferred_management_resource_id: Customer preferred Management resource ARM ID. - :type preferred_management_resource_id: str - """ - - _attribute_map = { - 'preferred_management_resource_id': {'key': 'preferredManagementResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManagementResourcePreferences, self).__init__(**kwargs) - self.preferred_management_resource_id = kwargs.get('preferred_management_resource_id', None) - - -class MeterDetails(msrest.serialization.Model): - """Holds details about billing type and its meter guids. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Pav2MeterDetails, PurchaseMeterDetails. - - 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 billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ChargingType - """ - - _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - } - - _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - } - - _subtype_map = { - 'billing_type': {'Pav2': 'Pav2MeterDetails', 'Purchase': 'PurchaseMeterDetails'} - } - - def __init__( - self, - **kwargs - ): - super(MeterDetails, self).__init__(**kwargs) - self.billing_type = None # type: Optional[str] - self.multiplier = None - self.charging_type = 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: "Shipped", - "Delivered". - :type stage_name: str or ~azure.mgmt.edgeorder.v2021_12_01.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): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :param display: Localized display information for this particular operation. - :type display: ~azure.mgmt.edgeorder.v2021_12_01.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". - :vartype origin: str or ~azure.mgmt.edgeorder.v2021_12_01.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". - :vartype action_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ActionType - """ - - _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = kwargs.get('display', None) - self.origin = None - self.action_type = None - - -class OperationDisplay(msrest.serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _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 = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OrderItemDetails(msrest.serialization.Model): - """Order item 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 product_details: Required. Unique identifier for configuration. - :type product_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductDetails - :param order_item_type: Required. Order item type. Possible values include: "Purchase", - "Rental". - :type order_item_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemType - :ivar current_stage: Current Order item Status. - :vartype current_stage: ~azure.mgmt.edgeorder.v2021_12_01.models.StageDetails - :ivar order_item_stage_history: Order item status history. - :vartype order_item_stage_history: list[~azure.mgmt.edgeorder.v2021_12_01.models.StageDetails] - :param preferences: Customer notification Preferences. - :type preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences - :ivar forward_shipping_details: Forward Package Shipping details. - :vartype forward_shipping_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ForwardShippingDetails - :ivar reverse_shipping_details: Reverse Package Shipping details. - :vartype reverse_shipping_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ReverseShippingDetails - :param notification_email_list: Additional notification email list. - :type notification_email_list: list[str] - :ivar cancellation_reason: Cancellation reason. - :vartype cancellation_reason: str - :ivar cancellation_status: Describes whether the order item is cancellable or not. Possible - values include: "Cancellable", "CancellableWithFee", "NotCancellable". - :vartype cancellation_status: str or - ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemCancellationEnum - :ivar deletion_status: Describes whether the order item is deletable or not. Possible values - include: "Allowed", "NotAllowed". - :vartype deletion_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ActionStatusEnum - :ivar return_reason: Return reason. - :vartype return_reason: str - :ivar return_status: Describes whether the order item is returnable or not. Possible values - include: "Returnable", "ReturnableWithFee", "NotReturnable". - :vartype return_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemReturnEnum - :ivar management_rp_details: Parent RP details - this returns only the first or default parent - RP from the entire list. - :vartype management_rp_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails - :ivar management_rp_details_list: List of parent RP details supported for configuration. - :vartype management_rp_details_list: - list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail - """ - - _validation = { - 'product_details': {'required': True}, - 'order_item_type': {'required': True}, - 'current_stage': {'readonly': True}, - 'order_item_stage_history': {'readonly': True}, - 'forward_shipping_details': {'readonly': True}, - 'reverse_shipping_details': {'readonly': True}, - 'cancellation_reason': {'readonly': True}, - 'cancellation_status': {'readonly': True}, - 'deletion_status': {'readonly': True}, - 'return_reason': {'readonly': True}, - 'return_status': {'readonly': True}, - 'management_rp_details': {'readonly': True}, - 'management_rp_details_list': {'readonly': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'product_details': {'key': 'productDetails', 'type': 'ProductDetails'}, - 'order_item_type': {'key': 'orderItemType', 'type': 'str'}, - 'current_stage': {'key': 'currentStage', 'type': 'StageDetails'}, - 'order_item_stage_history': {'key': 'orderItemStageHistory', 'type': '[StageDetails]'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'forward_shipping_details': {'key': 'forwardShippingDetails', 'type': 'ForwardShippingDetails'}, - 'reverse_shipping_details': {'key': 'reverseShippingDetails', 'type': 'ReverseShippingDetails'}, - 'notification_email_list': {'key': 'notificationEmailList', 'type': '[str]'}, - 'cancellation_reason': {'key': 'cancellationReason', 'type': 'str'}, - 'cancellation_status': {'key': 'cancellationStatus', 'type': 'str'}, - 'deletion_status': {'key': 'deletionStatus', 'type': 'str'}, - 'return_reason': {'key': 'returnReason', 'type': 'str'}, - 'return_status': {'key': 'returnStatus', 'type': 'str'}, - 'management_rp_details': {'key': 'managementRpDetails', 'type': 'ResourceProviderDetails'}, - 'management_rp_details_list': {'key': 'managementRpDetailsList', 'type': '[ResourceProviderDetails]'}, - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderItemDetails, self).__init__(**kwargs) - self.product_details = kwargs['product_details'] - self.order_item_type = kwargs['order_item_type'] - self.current_stage = None - self.order_item_stage_history = None - self.preferences = kwargs.get('preferences', None) - self.forward_shipping_details = None - self.reverse_shipping_details = None - self.notification_email_list = kwargs.get('notification_email_list', None) - self.cancellation_reason = None - self.cancellation_status = None - self.deletion_status = None - self.return_reason = None - self.return_status = None - self.management_rp_details = None - self.management_rp_details_list = None - self.error = None - - -class OrderItemResource(TrackedResource): - """Represents order item contract. - - 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 id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2021_12_01.models.SystemData - :param order_item_details: Required. Represents order item details. - :type order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemDetails - :param address_details: Required. Represents shipping and return address for order item. - :type address_details: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressDetails - :ivar start_time: Start time of order item. - :vartype start_time: ~datetime.datetime - :param order_id: Required. Id of the order to which order item belongs to. - :type order_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'order_item_details': {'required': True}, - 'address_details': {'required': True}, - 'start_time': {'readonly': True}, - 'order_id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'order_item_details': {'key': 'properties.orderItemDetails', 'type': 'OrderItemDetails'}, - 'address_details': {'key': 'properties.addressDetails', 'type': 'AddressDetails'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'order_id': {'key': 'properties.orderId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderItemResource, self).__init__(**kwargs) - self.system_data = None - self.order_item_details = kwargs['order_item_details'] - self.address_details = kwargs['address_details'] - self.start_time = None - self.order_id = kwargs['order_id'] - - -class OrderItemResourceList(msrest.serialization.Model): - """List of orderItems. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of order item resources. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :param next_link: Link for the next set of order item resources. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OrderItemResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderItemResourceList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class OrderItemUpdateParameter(msrest.serialization.Model): - """Updates order item parameters. - - :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 forward_address: Updates forward shipping address and contact details. - :type forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties - :param preferences: Customer preference. - :type preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences - :param notification_email_list: Additional notification email list. - :type notification_email_list: list[str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'forward_address': {'key': 'properties.forwardAddress', 'type': 'AddressProperties'}, - 'preferences': {'key': 'properties.preferences', 'type': 'Preferences'}, - 'notification_email_list': {'key': 'properties.notificationEmailList', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderItemUpdateParameter, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.forward_address = kwargs.get('forward_address', None) - self.preferences = kwargs.get('preferences', None) - self.notification_email_list = kwargs.get('notification_email_list', None) - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class OrderResource(ProxyResource): - """Specifies the properties or parameters for an order. Order is a grouping of one or more order items. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2021_12_01.models.SystemData - :ivar order_item_ids: List of order item ARM Ids which are part of an order. - :vartype order_item_ids: list[str] - :ivar current_stage: Order current status. - :vartype current_stage: ~azure.mgmt.edgeorder.v2021_12_01.models.StageDetails - :ivar order_stage_history: Order status history. - :vartype order_stage_history: list[~azure.mgmt.edgeorder.v2021_12_01.models.StageDetails] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'order_item_ids': {'readonly': True}, - 'current_stage': {'readonly': True}, - 'order_stage_history': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'order_item_ids': {'key': 'properties.orderItemIds', 'type': '[str]'}, - 'current_stage': {'key': 'properties.currentStage', 'type': 'StageDetails'}, - 'order_stage_history': {'key': 'properties.orderStageHistory', 'type': '[StageDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderResource, self).__init__(**kwargs) - self.system_data = None - self.order_item_ids = None - self.current_stage = None - self.order_stage_history = None - - -class OrderResourceList(msrest.serialization.Model): - """List of orders. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of order resources. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] - :param next_link: Link for the next set of order resources. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OrderResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrderResourceList, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class Pav2MeterDetails(MeterDetails): - """Billing type PAV2 meter 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 billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ChargingType - :ivar meter_guid: Validation status of requested data center and transport. - :vartype meter_guid: str - """ - - _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - 'meter_guid': {'readonly': True}, - } - - _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - 'meter_guid': {'key': 'meterGuid', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Pav2MeterDetails, self).__init__(**kwargs) - self.billing_type = 'Pav2' # type: str - self.meter_guid = None - - -class Preferences(msrest.serialization.Model): - """Preferences related to the order. - - :param notification_preferences: Notification preferences. - :type notification_preferences: - list[~azure.mgmt.edgeorder.v2021_12_01.models.NotificationPreference] - :param transport_preferences: Preferences related to the shipment logistics of the order. - :type transport_preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.TransportPreferences - :param encryption_preferences: Preferences related to the Encryption. - :type encryption_preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.EncryptionPreferences - :param management_resource_preferences: Preferences related to the Management resource. - :type management_resource_preferences: - ~azure.mgmt.edgeorder.v2021_12_01.models.ManagementResourcePreferences - """ - - _attribute_map = { - 'notification_preferences': {'key': 'notificationPreferences', 'type': '[NotificationPreference]'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, - 'management_resource_preferences': {'key': 'managementResourcePreferences', 'type': 'ManagementResourcePreferences'}, - } - - def __init__( - self, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) - self.notification_preferences = kwargs.get('notification_preferences', None) - self.transport_preferences = kwargs.get('transport_preferences', None) - self.encryption_preferences = kwargs.get('encryption_preferences', None) - self.management_resource_preferences = kwargs.get('management_resource_preferences', None) - - -class Product(msrest.serialization.Model): - """List of Products. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'configurations': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'configurations': {'key': 'properties.configurations', 'type': '[Configuration]'}, - } - - def __init__( - self, - **kwargs - ): - super(Product, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.configurations = None - - -class ProductDetails(msrest.serialization.Model): - """Represents product 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 display_info: Display details of the product. - :type display_info: ~azure.mgmt.edgeorder.v2021_12_01.models.DisplayInfo - :param hierarchy_information: Required. Hierarchy of the product which uniquely identifies the - product. - :type hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar count: Quantity of the product. - :vartype count: int - :ivar product_double_encryption_status: Double encryption status of the configuration. - Read-only field. Possible values include: "Disabled", "Enabled". - :vartype product_double_encryption_status: str or - ~azure.mgmt.edgeorder.v2021_12_01.models.DoubleEncryptionStatus - :ivar device_details: list of device details. - :vartype device_details: list[~azure.mgmt.edgeorder.v2021_12_01.models.DeviceDetails] - """ - - _validation = { - 'hierarchy_information': {'required': True}, - 'count': {'readonly': True}, - 'product_double_encryption_status': {'readonly': True}, - 'device_details': {'readonly': True}, - } - - _attribute_map = { - 'display_info': {'key': 'displayInfo', 'type': 'DisplayInfo'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'count': {'key': 'count', 'type': 'int'}, - 'product_double_encryption_status': {'key': 'productDoubleEncryptionStatus', 'type': 'str'}, - 'device_details': {'key': 'deviceDetails', 'type': '[DeviceDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductDetails, self).__init__(**kwargs) - self.display_info = kwargs.get('display_info', None) - self.hierarchy_information = kwargs['hierarchy_information'] - self.count = None - self.product_double_encryption_status = None - self.device_details = None - - -class ProductFamilies(msrest.serialization.Model): - """The list of product families. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of product families. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] - :param next_link: Link for the next set of product families. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductFamily]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamilies, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class ProductFamiliesMetadata(msrest.serialization.Model): - """Holds details about product family metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of product family metadata details. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] - :ivar next_link: Link for the next set of product families. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductFamiliesMetadataDetails]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamiliesMetadata, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ProductFamiliesMetadataDetails(msrest.serialization.Model): - """Product families metadata details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: - list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'properties.productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'properties.resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamiliesMetadataDetails, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.product_lines = None - self.resource_provider_details = kwargs.get('resource_provider_details', None) - - -class ProductFamiliesRequest(msrest.serialization.Model): - """The filters for showing the product families. - - All required parameters must be populated in order to send to Azure. - - :param filterable_properties: Required. Dictionary of filterable properties on product family. - :type filterable_properties: dict[str, - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty]] - :param customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :type customer_subscription_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionDetails - """ - - _validation = { - 'filterable_properties': {'required': True}, - } - - _attribute_map = { - 'filterable_properties': {'key': 'filterableProperties', 'type': '{[FilterableProperty]}'}, - 'customer_subscription_details': {'key': 'customerSubscriptionDetails', 'type': 'CustomerSubscriptionDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamiliesRequest, self).__init__(**kwargs) - self.filterable_properties = kwargs['filterable_properties'] - self.customer_subscription_details = kwargs.get('customer_subscription_details', None) - - -class ProductFamily(msrest.serialization.Model): - """Product Family. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: - list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'properties.productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'properties.resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamily, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.product_lines = None - self.resource_provider_details = kwargs.get('resource_provider_details', None) - - -class ProductFamilyProperties(CommonProperties): - """Properties of product family. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: - list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductFamilyProperties, self).__init__(**kwargs) - self.product_lines = None - self.resource_provider_details = kwargs.get('resource_provider_details', None) - - -class ProductLine(msrest.serialization.Model): - """Product line. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2021_12_01.models.Product] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'products': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'products': {'key': 'properties.products', 'type': '[Product]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductLine, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.filterable_properties = None - self.products = None - - -class ProductLineProperties(CommonProperties): - """Properties of product line. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2021_12_01.models.Product] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'products': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'products': {'key': 'products', 'type': '[Product]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductLineProperties, self).__init__(**kwargs) - self.products = None - - -class ProductProperties(CommonProperties): - """Properties of products. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'configurations': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'configurations': {'key': 'configurations', 'type': '[Configuration]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductProperties, self).__init__(**kwargs) - self.configurations = None - - -class PurchaseMeterDetails(MeterDetails): - """Billing type Purchase meter 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 billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ChargingType - :ivar product_id: Product Id. - :vartype product_id: str - :ivar sku_id: Sku Id. - :vartype sku_id: str - :ivar term_id: Term Id. - :vartype term_id: str - """ - - _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - 'product_id': {'readonly': True}, - 'sku_id': {'readonly': True}, - 'term_id': {'readonly': True}, - } - - _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - 'product_id': {'key': 'productId', 'type': 'str'}, - 'sku_id': {'key': 'skuId', 'type': 'str'}, - 'term_id': {'key': 'termId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PurchaseMeterDetails, self).__init__(**kwargs) - self.billing_type = 'Purchase' # type: str - self.product_id = None - self.sku_id = None - self.term_id = 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. - - :param type: Identity type. - :type 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 - """ - - _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'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.principal_id = None - self.tenant_id = None - - -class ResourceProviderDetails(msrest.serialization.Model): - """Management RP details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar resource_provider_namespace: Resource provider namespace. - :vartype resource_provider_namespace: str - """ - - _validation = { - 'resource_provider_namespace': {'readonly': True}, - } - - _attribute_map = { - 'resource_provider_namespace': {'key': 'resourceProviderNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderDetails, self).__init__(**kwargs) - self.resource_provider_namespace = None - - -class ReturnOrderItemDetails(msrest.serialization.Model): - """Return order item request body. - - All required parameters must be populated in order to send to Azure. - - :param return_address: customer return address. - :type return_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties - :param return_reason: Required. Return Reason. - :type return_reason: str - :param service_tag: Service tag (located on the bottom-right corner of the device). - :type service_tag: str - :param shipping_box_required: Shipping Box required. - :type shipping_box_required: bool - """ - - _validation = { - 'return_reason': {'required': True}, - } - - _attribute_map = { - 'return_address': {'key': 'returnAddress', 'type': 'AddressProperties'}, - 'return_reason': {'key': 'returnReason', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'shipping_box_required': {'key': 'shippingBoxRequired', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ReturnOrderItemDetails, self).__init__(**kwargs) - self.return_address = kwargs.get('return_address', None) - self.return_reason = kwargs['return_reason'] - self.service_tag = kwargs.get('service_tag', None) - self.shipping_box_required = kwargs.get('shipping_box_required', False) - - -class ReverseShippingDetails(msrest.serialization.Model): - """Reverse shipment details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sas_key_for_label: SAS key to download the reverse shipment label of the package. - :vartype sas_key_for_label: str - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar carrier_display_name: Carrier Name for display purpose. Not to be used for any - processing. - :vartype carrier_display_name: str - :ivar tracking_id: TrackingId of the package. - :vartype tracking_id: str - :ivar tracking_url: TrackingUrl of the package. - :vartype tracking_url: str - """ - - _validation = { - 'sas_key_for_label': {'readonly': True}, - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, - } - - _attribute_map = { - 'sas_key_for_label': {'key': 'sasKeyForLabel', 'type': 'str'}, - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReverseShippingDetails, self).__init__(**kwargs) - self.sas_key_for_label = None - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = 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: 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.edgeorder.v2021_12_01.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, - **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.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) - - -class ShippingDetails(msrest.serialization.Model): - """Package 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 carrier_display_name: Carrier Name for display purpose. Not to be used for any - processing. - :vartype carrier_display_name: str - :ivar tracking_id: TrackingId of the package. - :vartype tracking_id: str - :ivar tracking_url: TrackingUrl of the package. - :vartype tracking_url: str - """ - - _validation = { - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, - } - - _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ShippingDetails, self).__init__(**kwargs) - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = None - - -class Specification(msrest.serialization.Model): - """Specifications of the configurations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the specification. - :vartype name: str - :ivar value: Value of the specification. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Specification, self).__init__(**kwargs) - self.name = None - self.value = None - - -class StageDetails(msrest.serialization.Model): - """Resource stage details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar stage_status: Stage status. Possible values include: "None", "InProgress", "Succeeded", - "Failed", "Cancelled", "Cancelling". - :vartype stage_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.StageStatus - :ivar stage_name: Stage name. Possible values include: "Placed", "InReview", "Confirmed", - "ReadyToShip", "Shipped", "Delivered", "InUse", "ReturnInitiated", "ReturnPickedUp", - "ReturnedToMicrosoft", "ReturnCompleted", "Cancelled". - :vartype stage_name: str or ~azure.mgmt.edgeorder.v2021_12_01.models.StageName - :ivar display_name: Display name of the resource stage. - :vartype display_name: str - :ivar start_time: Stage start time. - :vartype start_time: ~datetime.datetime - """ - - _validation = { - 'stage_status': {'readonly': True}, - 'stage_name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'start_time': {'readonly': True}, - } - - _attribute_map = { - 'stage_status': {'key': 'stageStatus', 'type': 'str'}, - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(StageDetails, self).__init__(**kwargs) - self.stage_status = None - self.stage_name = None - self.display_name = None - self.start_time = None - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _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 = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', 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.edgeorder.v2021_12_01.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'] diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models_py3.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models_py3.py index a41d29e1df46..f71d4263aeda 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models_py3.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models_py3.py @@ -1,4 +1,5 @@ # coding=utf-8 +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -7,91 +8,98 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from azure.core.exceptions import HttpResponseError -import msrest.serialization +from ... import _serialization -from ._edge_order_management_client_enums import * +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models -class AddressDetails(msrest.serialization.Model): +class AddressDetails(_serialization.Model): """Address details for an order item. 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 forward_address: Required. Customer address and contact details. It should be address - resource. - :type forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :ivar forward_address: Customer address and contact details. It should be address resource. + Required. + :vartype forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties :ivar return_address: Return shipping address. :vartype return_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties """ _validation = { - 'forward_address': {'required': True}, - 'return_address': {'readonly': True}, + "forward_address": {"required": True}, + "return_address": {"readonly": True}, } _attribute_map = { - 'forward_address': {'key': 'forwardAddress', 'type': 'AddressProperties'}, - 'return_address': {'key': 'returnAddress', 'type': 'AddressProperties'}, + "forward_address": {"key": "forwardAddress", "type": "AddressProperties"}, + "return_address": {"key": "returnAddress", "type": "AddressProperties"}, } - def __init__( - self, - *, - forward_address: "AddressProperties", - **kwargs - ): - super(AddressDetails, self).__init__(**kwargs) + def __init__(self, *, forward_address: "_models.AddressProperties", **kwargs: Any) -> None: + """ + :keyword forward_address: Customer address and contact details. It should be address resource. + Required. + :paramtype forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + """ + super().__init__(**kwargs) self.forward_address = forward_address self.return_address = None -class AddressProperties(msrest.serialization.Model): +class AddressProperties(_serialization.Model): """Address Properties. 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 shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress - :param contact_details: Required. Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails - :ivar address_validation_status: Status of address validation. Possible values include: - "Valid", "Invalid", "Ambiguous". + :ivar shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :ivar contact_details: Contact details for the address. Required. + :vartype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + :ivar address_validation_status: Status of address validation. Known values are: "Valid", + "Invalid", and "Ambiguous". :vartype address_validation_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.AddressValidationStatus """ _validation = { - 'contact_details': {'required': True}, - 'address_validation_status': {'readonly': True}, + "contact_details": {"required": True}, + "address_validation_status": {"readonly": True}, } _attribute_map = { - 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, - 'address_validation_status': {'key': 'addressValidationStatus', 'type': 'str'}, + "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, + "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, + "address_validation_status": {"key": "addressValidationStatus", "type": "str"}, } def __init__( self, *, - contact_details: "ContactDetails", - shipping_address: Optional["ShippingAddress"] = None, - **kwargs - ): - super(AddressProperties, self).__init__(**kwargs) + contact_details: "_models.ContactDetails", + shipping_address: Optional["_models.ShippingAddress"] = None, + **kwargs: Any + ) -> None: + """ + :keyword shipping_address: Shipping details for the address. + :paramtype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :keyword contact_details: Contact details for the address. Required. + :paramtype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + """ + super().__init__(**kwargs) self.shipping_address = shipping_address self.contact_details = contact_details self.address_validation_status = None -class Resource(msrest.serialization.Model): +class Resource(_serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. @@ -107,29 +115,28 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.id = None self.name = None self.type = None class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. @@ -143,35 +150,35 @@ class TrackedResource(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + """ + super().__init__(**kwargs) self.tags = tags self.location = location @@ -191,163 +198,177 @@ class AddressResource(TrackedResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar system_data: Represents resource creation and update time. :vartype system_data: ~azure.mgmt.edgeorder.v2021_12_01.models.SystemData - :param shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress - :param contact_details: Required. Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails - :ivar address_validation_status: Status of address validation. Possible values include: - "Valid", "Invalid", "Ambiguous". + :ivar shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :ivar contact_details: Contact details for the address. Required. + :vartype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + :ivar address_validation_status: Status of address validation. Known values are: "Valid", + "Invalid", and "Ambiguous". :vartype address_validation_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.AddressValidationStatus """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'contact_details': {'required': True}, - 'address_validation_status': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, + "system_data": {"readonly": True}, + "contact_details": {"required": True}, + "address_validation_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'properties.contactDetails', 'type': 'ContactDetails'}, - 'address_validation_status': {'key': 'properties.addressValidationStatus', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, + "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, + "address_validation_status": {"key": "properties.addressValidationStatus", "type": "str"}, } def __init__( self, *, location: str, - contact_details: "ContactDetails", + contact_details: "_models.ContactDetails", tags: Optional[Dict[str, str]] = None, - shipping_address: Optional["ShippingAddress"] = None, - **kwargs - ): - super(AddressResource, self).__init__(tags=tags, location=location, **kwargs) + shipping_address: Optional["_models.ShippingAddress"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword shipping_address: Shipping details for the address. + :paramtype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :keyword contact_details: Contact details for the address. Required. + :paramtype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + """ + super().__init__(tags=tags, location=location, **kwargs) self.system_data = None self.shipping_address = shipping_address self.contact_details = contact_details self.address_validation_status = None -class AddressResourceList(msrest.serialization.Model): +class AddressResourceList(_serialization.Model): """Address Resource Collection. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of address resources. :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :param next_link: Link for the next set of job resources. - :type next_link: str + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AddressResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AddressResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(AddressResourceList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link -class AddressUpdateParameter(msrest.serialization.Model): +class AddressUpdateParameter(_serialization.Model): """The Address update parameters. - :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 shipping_address: Shipping details for the address. - :type shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress - :param contact_details: Contact details for the address. - :type contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + :ivar 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 shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :ivar contact_details: Contact details for the address. + :vartype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'shipping_address': {'key': 'properties.shippingAddress', 'type': 'ShippingAddress'}, - 'contact_details': {'key': 'properties.contactDetails', 'type': 'ContactDetails'}, + "tags": {"key": "tags", "type": "{str}"}, + "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, + "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, - shipping_address: Optional["ShippingAddress"] = None, - contact_details: Optional["ContactDetails"] = None, - **kwargs - ): - super(AddressUpdateParameter, self).__init__(**kwargs) + shipping_address: Optional["_models.ShippingAddress"] = None, + contact_details: Optional["_models.ContactDetails"] = None, + **kwargs: Any + ) -> None: + """ + :keyword 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 shipping_address: Shipping details for the address. + :paramtype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :keyword contact_details: Contact details for the address. + :paramtype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + """ + super().__init__(**kwargs) self.tags = tags self.shipping_address = shipping_address self.contact_details = contact_details -class AvailabilityInformation(msrest.serialization.Model): +class AvailabilityInformation(_serialization.Model): """Availability information of a product system. Variables are only populated by the server, and will be ignored when sending a request. - :ivar availability_stage: Current availability stage of the product. Availability stage. - Possible values include: "Available", "ComingSoon", "Preview", "Deprecated", "Signup", - "Unavailable". + :ivar availability_stage: Current availability stage of the product. Availability stage. Known + values are: "Available", "ComingSoon", "Preview", "Deprecated", "Signup", and "Unavailable". :vartype availability_stage: str or ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityStage - :ivar disabled_reason: Reason why the product is disabled. Possible values include: "None", - "Country", "Region", "Feature", "OfferType", "NoSubscriptionInfo", "NotAvailable", - "OutOfStock". + :ivar disabled_reason: Reason why the product is disabled. Known values are: "None", "Country", + "Region", "Feature", "OfferType", "NoSubscriptionInfo", "NotAvailable", and "OutOfStock". :vartype disabled_reason: str or ~azure.mgmt.edgeorder.v2021_12_01.models.DisabledReason :ivar disabled_reason_message: Message for why the product is disabled. :vartype disabled_reason_message: str """ _validation = { - 'availability_stage': {'readonly': True}, - 'disabled_reason': {'readonly': True}, - 'disabled_reason_message': {'readonly': True}, + "availability_stage": {"readonly": True}, + "disabled_reason": {"readonly": True}, + "disabled_reason_message": {"readonly": True}, } _attribute_map = { - 'availability_stage': {'key': 'availabilityStage', 'type': 'str'}, - 'disabled_reason': {'key': 'disabledReason', 'type': 'str'}, - 'disabled_reason_message': {'key': 'disabledReasonMessage', 'type': 'str'}, + "availability_stage": {"key": "availabilityStage", "type": "str"}, + "disabled_reason": {"key": "disabledReason", "type": "str"}, + "disabled_reason_message": {"key": "disabledReasonMessage", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(AvailabilityInformation, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.availability_stage = None self.disabled_reason = None self.disabled_reason_message = None -class BasicInformation(msrest.serialization.Model): +class BasicInformation(_serialization.Model): """Basic information for any product system. Variables are only populated by the server, and will be ignored when sending a request. @@ -368,28 +389,26 @@ class BasicInformation(msrest.serialization.Model): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, } _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, } - def __init__( - self, - **kwargs - ): - super(BasicInformation, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -398,7 +417,7 @@ def __init__( self.hierarchy_information = None -class BillingMeterDetails(msrest.serialization.Model): +class BillingMeterDetails(_serialization.Model): """Holds billing meter details for each type of billing. Variables are only populated by the server, and will be ignored when sending a request. @@ -407,62 +426,59 @@ class BillingMeterDetails(msrest.serialization.Model): :vartype name: str :ivar meter_details: Represents MeterDetails. :vartype meter_details: ~azure.mgmt.edgeorder.v2021_12_01.models.MeterDetails - :ivar metering_type: Represents Metering type (eg one-time or recurrent). Possible values - include: "OneTime", "Recurring", "Adhoc". + :ivar metering_type: Represents Metering type (eg one-time or recurrent). Known values are: + "OneTime", "Recurring", and "Adhoc". :vartype metering_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.MeteringType :ivar frequency: Frequency of recurrence. :vartype frequency: str """ _validation = { - 'name': {'readonly': True}, - 'meter_details': {'readonly': True}, - 'metering_type': {'readonly': True}, - 'frequency': {'readonly': True}, + "name": {"readonly": True}, + "meter_details": {"readonly": True}, + "metering_type": {"readonly": True}, + "frequency": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, - 'metering_type': {'key': 'meteringType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "meter_details": {"key": "meterDetails", "type": "MeterDetails"}, + "metering_type": {"key": "meteringType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(BillingMeterDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.name = None self.meter_details = None self.metering_type = None self.frequency = None -class CancellationReason(msrest.serialization.Model): +class CancellationReason(_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 + :ivar reason: Reason for cancellation. Required. + :vartype reason: str """ _validation = { - 'reason': {'required': True}, + "reason": {"required": True}, } _attribute_map = { - 'reason': {'key': 'reason', 'type': 'str'}, + "reason": {"key": "reason", "type": "str"}, } - def __init__( - self, - *, - reason: str, - **kwargs - ): - super(CancellationReason, self).__init__(**kwargs) + def __init__(self, *, reason: str, **kwargs: Any) -> None: + """ + :keyword reason: Reason for cancellation. Required. + :paramtype reason: str + """ + super().__init__(**kwargs) self.reason = reason @@ -490,34 +506,32 @@ class CommonProperties(BasicInformation): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, } _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, } - def __init__( - self, - **kwargs - ): - super(CommonProperties, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.filterable_properties = None -class Configuration(msrest.serialization.Model): +class Configuration(_serialization.Model): """Configuration object. Variables are only populated by the server, and will be ignored when sending a request. @@ -545,34 +559,32 @@ class Configuration(msrest.serialization.Model): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'specifications': {'readonly': True}, - 'dimensions': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'specifications': {'key': 'properties.specifications', 'type': '[Specification]'}, - 'dimensions': {'key': 'properties.dimensions', 'type': 'Dimensions'}, - } - - def __init__( - self, - **kwargs - ): - super(Configuration, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "specifications": {"readonly": True}, + "dimensions": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "specifications": {"key": "properties.specifications", "type": "[Specification]"}, + "dimensions": {"key": "properties.dimensions", "type": "Dimensions"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -584,34 +596,41 @@ def __init__( self.dimensions = None -class ConfigurationFilters(msrest.serialization.Model): +class ConfigurationFilters(_serialization.Model): """Configuration filters. All required parameters must be populated in order to send to Azure. - :param hierarchy_information: Required. Product hierarchy information. - :type hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation - :param filterable_property: Filters specific to product. - :type filterable_property: list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] + :ivar hierarchy_information: Product hierarchy information. Required. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :ivar filterable_property: Filters specific to product. + :vartype filterable_property: list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] """ _validation = { - 'hierarchy_information': {'required': True}, + "hierarchy_information": {"required": True}, } _attribute_map = { - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_property': {'key': 'filterableProperty', 'type': '[FilterableProperty]'}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_property": {"key": "filterableProperty", "type": "[FilterableProperty]"}, } def __init__( self, *, - hierarchy_information: "HierarchyInformation", - filterable_property: Optional[List["FilterableProperty"]] = None, - **kwargs - ): - super(ConfigurationFilters, self).__init__(**kwargs) + hierarchy_information: "_models.HierarchyInformation", + filterable_property: Optional[List["_models.FilterableProperty"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword hierarchy_information: Product hierarchy information. Required. + :paramtype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :keyword filterable_property: Filters specific to product. + :paramtype filterable_property: + list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] + """ + super().__init__(**kwargs) self.hierarchy_information = hierarchy_information self.filterable_property = filterable_property @@ -644,134 +663,141 @@ class ConfigurationProperties(CommonProperties): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'specifications': {'readonly': True}, - 'dimensions': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'specifications': {'key': 'specifications', 'type': '[Specification]'}, - 'dimensions': {'key': 'dimensions', 'type': 'Dimensions'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationProperties, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "specifications": {"readonly": True}, + "dimensions": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "specifications": {"key": "specifications", "type": "[Specification]"}, + "dimensions": {"key": "dimensions", "type": "Dimensions"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.specifications = None self.dimensions = None -class Configurations(msrest.serialization.Model): +class Configurations(_serialization.Model): """The list of configurations. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of configurations. :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] - :param next_link: Link for the next set of configurations. - :type next_link: str + :ivar next_link: Link for the next set of configurations. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Configuration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Configuration]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(Configurations, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of configurations. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link -class ConfigurationsRequest(msrest.serialization.Model): +class ConfigurationsRequest(_serialization.Model): """Configuration request object. All required parameters must be populated in order to send to Azure. - :param configuration_filters: Required. Holds details about product hierarchy information and - filterable property. - :type configuration_filters: + :ivar configuration_filters: Holds details about product hierarchy information and filterable + property. Required. + :vartype configuration_filters: list[~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationFilters] - :param customer_subscription_details: Customer subscription properties. Clients can display + :ivar customer_subscription_details: Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details. - :type customer_subscription_details: + :vartype customer_subscription_details: ~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionDetails """ _validation = { - 'configuration_filters': {'required': True, 'unique': True}, + "configuration_filters": {"required": True, "unique": True}, } _attribute_map = { - 'configuration_filters': {'key': 'configurationFilters', 'type': '[ConfigurationFilters]'}, - 'customer_subscription_details': {'key': 'customerSubscriptionDetails', 'type': 'CustomerSubscriptionDetails'}, + "configuration_filters": {"key": "configurationFilters", "type": "[ConfigurationFilters]"}, + "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, } def __init__( self, *, - configuration_filters: List["ConfigurationFilters"], - customer_subscription_details: Optional["CustomerSubscriptionDetails"] = None, - **kwargs - ): - super(ConfigurationsRequest, self).__init__(**kwargs) + configuration_filters: List["_models.ConfigurationFilters"], + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, + **kwargs: Any + ) -> None: + """ + :keyword configuration_filters: Holds details about product hierarchy information and + filterable property. Required. + :paramtype configuration_filters: + list[~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationFilters] + :keyword customer_subscription_details: Customer subscription properties. Clients can display + available products to unregistered customers by explicitly passing subscription details. + :paramtype customer_subscription_details: + ~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionDetails + """ + super().__init__(**kwargs) self.configuration_filters = configuration_filters self.customer_subscription_details = customer_subscription_details -class ContactDetails(msrest.serialization.Model): +class ContactDetails(_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] + :ivar contact_name: Contact name of the person. Required. + :vartype contact_name: str + :ivar phone: Phone number of the contact person. Required. + :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: List of Email-ids to be notified about job progress. Required. + :vartype email_list: list[str] """ _validation = { - 'contact_name': {'required': True}, - 'phone': {'required': True}, - 'email_list': {'required': True}, + "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]'}, + "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]"}, } def __init__( @@ -782,9 +808,21 @@ def __init__( email_list: List[str], phone_extension: Optional[str] = None, mobile: Optional[str] = None, - **kwargs - ): - super(ContactDetails, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword contact_name: Contact name of the person. Required. + :paramtype contact_name: str + :keyword phone: Phone number of the contact person. Required. + :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: List of Email-ids to be notified about job progress. Required. + :paramtype email_list: list[str] + """ + super().__init__(**kwargs) self.contact_name = contact_name self.phone = phone self.phone_extension = phone_extension @@ -792,7 +830,7 @@ def __init__( self.email_list = email_list -class CostInformation(msrest.serialization.Model): +class CostInformation(_serialization.Model): """Cost information for the product system. Variables are only populated by the server, and will be ignored when sending a request. @@ -805,94 +843,102 @@ class CostInformation(msrest.serialization.Model): """ _validation = { - 'billing_meter_details': {'readonly': True}, - 'billing_info_url': {'readonly': True}, + "billing_meter_details": {"readonly": True}, + "billing_info_url": {"readonly": True}, } _attribute_map = { - 'billing_meter_details': {'key': 'billingMeterDetails', 'type': '[BillingMeterDetails]'}, - 'billing_info_url': {'key': 'billingInfoUrl', 'type': 'str'}, + "billing_meter_details": {"key": "billingMeterDetails", "type": "[BillingMeterDetails]"}, + "billing_info_url": {"key": "billingInfoUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(CostInformation, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.billing_meter_details = None self.billing_info_url = None -class CustomerSubscriptionDetails(msrest.serialization.Model): - """Holds Customer subscription details. Clients can display available products to unregistered customers by explicitly passing subscription details. +class CustomerSubscriptionDetails(_serialization.Model): + """Holds Customer subscription details. Clients can display available products to unregistered + customers by explicitly passing subscription details. All required parameters must be populated in order to send to Azure. - :param registered_features: List of registered feature flags for subscription. - :type registered_features: + :ivar registered_features: List of registered feature flags for subscription. + :vartype registered_features: list[~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionRegisteredFeatures] - :param location_placement_id: Location placement Id of a subscription. - :type location_placement_id: str - :param quota_id: Required. Quota ID of a subscription. - :type quota_id: str + :ivar location_placement_id: Location placement Id of a subscription. + :vartype location_placement_id: str + :ivar quota_id: Quota ID of a subscription. Required. + :vartype quota_id: str """ _validation = { - 'quota_id': {'required': True}, + "quota_id": {"required": True}, } _attribute_map = { - 'registered_features': {'key': 'registeredFeatures', 'type': '[CustomerSubscriptionRegisteredFeatures]'}, - 'location_placement_id': {'key': 'locationPlacementId', 'type': 'str'}, - 'quota_id': {'key': 'quotaId', 'type': 'str'}, + "registered_features": {"key": "registeredFeatures", "type": "[CustomerSubscriptionRegisteredFeatures]"}, + "location_placement_id": {"key": "locationPlacementId", "type": "str"}, + "quota_id": {"key": "quotaId", "type": "str"}, } def __init__( self, *, quota_id: str, - registered_features: Optional[List["CustomerSubscriptionRegisteredFeatures"]] = None, + registered_features: Optional[List["_models.CustomerSubscriptionRegisteredFeatures"]] = None, location_placement_id: Optional[str] = None, - **kwargs - ): - super(CustomerSubscriptionDetails, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword registered_features: List of registered feature flags for subscription. + :paramtype registered_features: + list[~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionRegisteredFeatures] + :keyword location_placement_id: Location placement Id of a subscription. + :paramtype location_placement_id: str + :keyword quota_id: Quota ID of a subscription. Required. + :paramtype quota_id: str + """ + super().__init__(**kwargs) self.registered_features = registered_features self.location_placement_id = location_placement_id self.quota_id = quota_id -class CustomerSubscriptionRegisteredFeatures(msrest.serialization.Model): +class CustomerSubscriptionRegisteredFeatures(_serialization.Model): """Represents subscription registered features. - :param name: Name of subscription registered feature. - :type name: str - :param state: State of subscription registered feature. - :type state: str + :ivar name: Name of subscription registered feature. + :vartype name: str + :ivar state: State of subscription registered feature. + :vartype state: str """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "state": {"key": "state", "type": "str"}, } - def __init__( - self, - *, - name: Optional[str] = None, - state: Optional[str] = None, - **kwargs - ): - super(CustomerSubscriptionRegisteredFeatures, self).__init__(**kwargs) + def __init__(self, *, name: Optional[str] = None, state: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of subscription registered feature. + :paramtype name: str + :keyword state: State of subscription registered feature. + :paramtype state: str + """ + super().__init__(**kwargs) self.name = name self.state = state -class Description(msrest.serialization.Model): +class Description(_serialization.Model): """Description related properties of a product system. Variables are only populated by the server, and will be ignored when sending a request. - :ivar description_type: Type of description. Possible values include: "Base". + :ivar description_type: Type of description. "Base" :vartype description_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.DescriptionType :ivar short_description: Short description of the product system. :vartype short_description: str @@ -907,28 +953,26 @@ class Description(msrest.serialization.Model): """ _validation = { - 'description_type': {'readonly': True}, - 'short_description': {'readonly': True}, - 'long_description': {'readonly': True}, - 'keywords': {'readonly': True}, - 'attributes': {'readonly': True}, - 'links': {'readonly': True}, + "description_type": {"readonly": True}, + "short_description": {"readonly": True}, + "long_description": {"readonly": True}, + "keywords": {"readonly": True}, + "attributes": {"readonly": True}, + "links": {"readonly": True}, } _attribute_map = { - 'description_type': {'key': 'descriptionType', 'type': 'str'}, - 'short_description': {'key': 'shortDescription', 'type': 'str'}, - 'long_description': {'key': 'longDescription', 'type': 'str'}, - 'keywords': {'key': 'keywords', 'type': '[str]'}, - 'attributes': {'key': 'attributes', 'type': '[str]'}, - 'links': {'key': 'links', 'type': '[Link]'}, + "description_type": {"key": "descriptionType", "type": "str"}, + "short_description": {"key": "shortDescription", "type": "str"}, + "long_description": {"key": "longDescription", "type": "str"}, + "keywords": {"key": "keywords", "type": "[str]"}, + "attributes": {"key": "attributes", "type": "[str]"}, + "links": {"key": "links", "type": "[Link]"}, } - def __init__( - self, - **kwargs - ): - super(Description, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.description_type = None self.short_description = None self.long_description = None @@ -937,7 +981,7 @@ def __init__( self.links = None -class DeviceDetails(msrest.serialization.Model): +class DeviceDetails(_serialization.Model): """Device details. Variables are only populated by the server, and will be ignored when sending a request. @@ -951,28 +995,26 @@ class DeviceDetails(msrest.serialization.Model): """ _validation = { - 'serial_number': {'readonly': True}, - 'management_resource_id': {'readonly': True}, - 'management_resource_tenant_id': {'readonly': True}, + "serial_number": {"readonly": True}, + "management_resource_id": {"readonly": True}, + "management_resource_tenant_id": {"readonly": True}, } _attribute_map = { - 'serial_number': {'key': 'serialNumber', 'type': 'str'}, - 'management_resource_id': {'key': 'managementResourceId', 'type': 'str'}, - 'management_resource_tenant_id': {'key': 'managementResourceTenantId', 'type': 'str'}, + "serial_number": {"key": "serialNumber", "type": "str"}, + "management_resource_id": {"key": "managementResourceId", "type": "str"}, + "management_resource_tenant_id": {"key": "managementResourceTenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DeviceDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.serial_number = None self.management_resource_id = None self.management_resource_tenant_id = None -class Dimensions(msrest.serialization.Model): +class Dimensions(_serialization.Model): """Dimensions of a configuration. Variables are only populated by the server, and will be ignored when sending a request. @@ -983,42 +1025,40 @@ class Dimensions(msrest.serialization.Model): :vartype height: float :ivar width: Width of the device. :vartype width: float - :ivar length_height_unit: Unit for the dimensions of length, height and width. Possible values - include: "IN", "CM". + :ivar length_height_unit: Unit for the dimensions of length, height and width. Known values + are: "IN" and "CM". :vartype length_height_unit: str or ~azure.mgmt.edgeorder.v2021_12_01.models.LengthHeightUnit :ivar weight: Weight of the device. :vartype weight: float :ivar depth: Depth of the device. :vartype depth: float - :ivar weight_unit: Unit for the dimensions of weight. Possible values include: "LBS", "KGS". + :ivar weight_unit: Unit for the dimensions of weight. Known values are: "LBS" and "KGS". :vartype weight_unit: str or ~azure.mgmt.edgeorder.v2021_12_01.models.WeightMeasurementUnit """ _validation = { - 'length': {'readonly': True}, - 'height': {'readonly': True}, - 'width': {'readonly': True}, - 'length_height_unit': {'readonly': True}, - 'weight': {'readonly': True}, - 'depth': {'readonly': True}, - 'weight_unit': {'readonly': True}, + "length": {"readonly": True}, + "height": {"readonly": True}, + "width": {"readonly": True}, + "length_height_unit": {"readonly": True}, + "weight": {"readonly": True}, + "depth": {"readonly": True}, + "weight_unit": {"readonly": True}, } _attribute_map = { - 'length': {'key': 'length', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'length_height_unit': {'key': 'lengthHeightUnit', 'type': 'str'}, - 'weight': {'key': 'weight', 'type': 'float'}, - 'depth': {'key': 'depth', 'type': 'float'}, - 'weight_unit': {'key': 'weightUnit', 'type': 'str'}, + "length": {"key": "length", "type": "float"}, + "height": {"key": "height", "type": "float"}, + "width": {"key": "width", "type": "float"}, + "length_height_unit": {"key": "lengthHeightUnit", "type": "str"}, + "weight": {"key": "weight", "type": "float"}, + "depth": {"key": "depth", "type": "float"}, + "weight_unit": {"key": "weightUnit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Dimensions, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.length = None self.height = None self.width = None @@ -1028,7 +1068,7 @@ def __init__( self.weight_unit = None -class DisplayInfo(msrest.serialization.Model): +class DisplayInfo(_serialization.Model): """Describes product display information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1040,49 +1080,51 @@ class DisplayInfo(msrest.serialization.Model): """ _validation = { - 'product_family_display_name': {'readonly': True}, - 'configuration_display_name': {'readonly': True}, + "product_family_display_name": {"readonly": True}, + "configuration_display_name": {"readonly": True}, } _attribute_map = { - 'product_family_display_name': {'key': 'productFamilyDisplayName', 'type': 'str'}, - 'configuration_display_name': {'key': 'configurationDisplayName', 'type': 'str'}, + "product_family_display_name": {"key": "productFamilyDisplayName", "type": "str"}, + "configuration_display_name": {"key": "configurationDisplayName", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(DisplayInfo, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.product_family_display_name = None self.configuration_display_name = None -class EncryptionPreferences(msrest.serialization.Model): +class EncryptionPreferences(_serialization.Model): """Preferences related to the double encryption. - :param double_encryption_status: Double encryption status as entered by the customer. It is - compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Possible - values include: "Disabled", "Enabled". - :type double_encryption_status: str or + :ivar double_encryption_status: Double encryption status as entered by the customer. It is + compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known + values are: "Disabled" and "Enabled". + :vartype double_encryption_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.DoubleEncryptionStatus """ _attribute_map = { - 'double_encryption_status': {'key': 'doubleEncryptionStatus', 'type': 'str'}, + "double_encryption_status": {"key": "doubleEncryptionStatus", "type": "str"}, } def __init__( - self, - *, - double_encryption_status: Optional[Union[str, "DoubleEncryptionStatus"]] = None, - **kwargs - ): - super(EncryptionPreferences, self).__init__(**kwargs) + self, *, double_encryption_status: Optional[Union[str, "_models.DoubleEncryptionStatus"]] = None, **kwargs: Any + ) -> None: + """ + :keyword double_encryption_status: Double encryption status as entered by the customer. It is + compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known + values are: "Disabled" and "Enabled". + :paramtype double_encryption_status: str or + ~azure.mgmt.edgeorder.v2021_12_01.models.DoubleEncryptionStatus + """ + super().__init__(**kwargs) self.double_encryption_status = double_encryption_status -class ErrorAdditionalInfo(msrest.serialization.Model): +class ErrorAdditionalInfo(_serialization.Model): """The resource management error additional info. Variables are only populated by the server, and will be ignored when sending a request. @@ -1090,29 +1132,27 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: any + :vartype info: JSON """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.type = None self.info = None -class ErrorDetail(msrest.serialization.Model): +class ErrorDetail(_serialization.Model): """The error detail. Variables are only populated by the server, and will be ignored when sending a request. @@ -1130,26 +1170,24 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "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': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.code = None self.message = None self.target = None @@ -1157,62 +1195,65 @@ def __init__( self.additional_info = None -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). - :param error: The error object. - :type error: ~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail + :ivar error: The error object. + :vartype error: ~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail + """ + super().__init__(**kwargs) self.error = error -class FilterableProperty(msrest.serialization.Model): +class FilterableProperty(_serialization.Model): """Different types of filters supported and its values. All required parameters must be populated in order to send to Azure. - :param type: Required. Type of product filter. Possible values include: "ShipToCountries", + :ivar type: Type of product filter. Required. Known values are: "ShipToCountries" and "DoubleEncryptionStatus". - :type type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.SupportedFilterTypes - :param supported_values: Required. Values to be filtered. - :type supported_values: list[str] + :vartype type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.SupportedFilterTypes + :ivar supported_values: Values to be filtered. Required. + :vartype supported_values: list[str] """ _validation = { - 'type': {'required': True}, - 'supported_values': {'required': True}, + "type": {"required": True}, + "supported_values": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'supported_values': {'key': 'supportedValues', 'type': '[str]'}, + "type": {"key": "type", "type": "str"}, + "supported_values": {"key": "supportedValues", "type": "[str]"}, } def __init__( - self, - *, - type: Union[str, "SupportedFilterTypes"], - supported_values: List[str], - **kwargs - ): - super(FilterableProperty, self).__init__(**kwargs) + self, *, type: Union[str, "_models.SupportedFilterTypes"], supported_values: List[str], **kwargs: Any + ) -> None: + """ + :keyword type: Type of product filter. Required. Known values are: "ShipToCountries" and + "DoubleEncryptionStatus". + :paramtype type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.SupportedFilterTypes + :keyword supported_values: Values to be filtered. Required. + :paramtype supported_values: list[str] + """ + super().__init__(**kwargs) self.type = type self.supported_values = supported_values -class ForwardShippingDetails(msrest.serialization.Model): +class ForwardShippingDetails(_serialization.Model): """Forward shipment details. Variables are only populated by the server, and will be ignored when sending a request. @@ -1229,50 +1270,47 @@ class ForwardShippingDetails(msrest.serialization.Model): """ _validation = { - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "carrier_name": {"readonly": True}, + "carrier_display_name": {"readonly": True}, + "tracking_id": {"readonly": True}, + "tracking_url": {"readonly": True}, } _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ForwardShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.carrier_name = None self.carrier_display_name = None self.tracking_id = None self.tracking_url = None -class HierarchyInformation(msrest.serialization.Model): +class HierarchyInformation(_serialization.Model): """Holds details about product hierarchy information. - :param product_family_name: Represents product family name that uniquely identifies product + :ivar product_family_name: Represents product family name that uniquely identifies product family. - :type product_family_name: str - :param product_line_name: Represents product line name that uniquely identifies product line. - :type product_line_name: str - :param product_name: Represents product name that uniquely identifies product. - :type product_name: str - :param configuration_name: Represents configuration name that uniquely identifies - configuration. - :type configuration_name: str + :vartype product_family_name: str + :ivar product_line_name: Represents product line name that uniquely identifies product line. + :vartype product_line_name: str + :ivar product_name: Represents product name that uniquely identifies product. + :vartype product_name: str + :ivar configuration_name: Represents configuration name that uniquely identifies configuration. + :vartype configuration_name: str """ _attribute_map = { - 'product_family_name': {'key': 'productFamilyName', 'type': 'str'}, - 'product_line_name': {'key': 'productLineName', 'type': 'str'}, - 'product_name': {'key': 'productName', 'type': 'str'}, - 'configuration_name': {'key': 'configurationName', 'type': 'str'}, + "product_family_name": {"key": "productFamilyName", "type": "str"}, + "product_line_name": {"key": "productLineName", "type": "str"}, + "product_name": {"key": "productName", "type": "str"}, + "configuration_name": {"key": "configurationName", "type": "str"}, } def __init__( @@ -1282,21 +1320,33 @@ def __init__( product_line_name: Optional[str] = None, product_name: Optional[str] = None, configuration_name: Optional[str] = None, - **kwargs - ): - super(HierarchyInformation, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword product_family_name: Represents product family name that uniquely identifies product + family. + :paramtype product_family_name: str + :keyword product_line_name: Represents product line name that uniquely identifies product line. + :paramtype product_line_name: str + :keyword product_name: Represents product name that uniquely identifies product. + :paramtype product_name: str + :keyword configuration_name: Represents configuration name that uniquely identifies + configuration. + :paramtype configuration_name: str + """ + super().__init__(**kwargs) self.product_family_name = product_family_name self.product_line_name = product_line_name self.product_name = product_name self.configuration_name = configuration_name -class ImageInformation(msrest.serialization.Model): +class ImageInformation(_serialization.Model): """Image for the product. Variables are only populated by the server, and will be ignored when sending a request. - :ivar image_type: Type of the image. Possible values include: "MainImage", "BulletImage", + :ivar image_type: Type of the image. Known values are: "MainImage", "BulletImage", and "GenericImage". :vartype image_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ImageType :ivar image_url: Url of the image. @@ -1304,156 +1354,147 @@ class ImageInformation(msrest.serialization.Model): """ _validation = { - 'image_type': {'readonly': True}, - 'image_url': {'readonly': True}, + "image_type": {"readonly": True}, + "image_url": {"readonly": True}, } _attribute_map = { - 'image_type': {'key': 'imageType', 'type': 'str'}, - 'image_url': {'key': 'imageUrl', 'type': 'str'}, + "image_type": {"key": "imageType", "type": "str"}, + "image_url": {"key": "imageUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ImageInformation, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.image_type = None self.image_url = None -class Link(msrest.serialization.Model): +class Link(_serialization.Model): """Returns link related to the product. Variables are only populated by the server, and will be ignored when sending a request. - :ivar link_type: Type of link. Possible values include: "Generic", "TermsAndConditions", - "Specification", "Documentation", "KnowMore", "SignUp". + :ivar link_type: Type of link. Known values are: "Generic", "TermsAndConditions", + "Specification", "Documentation", "KnowMore", and "SignUp". :vartype link_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.LinkType :ivar link_url: Url of the link. :vartype link_url: str """ _validation = { - 'link_type': {'readonly': True}, - 'link_url': {'readonly': True}, + "link_type": {"readonly": True}, + "link_url": {"readonly": True}, } _attribute_map = { - 'link_type': {'key': 'linkType', 'type': 'str'}, - 'link_url': {'key': 'linkUrl', 'type': 'str'}, + "link_type": {"key": "linkType", "type": "str"}, + "link_url": {"key": "linkUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Link, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.link_type = None self.link_url = None -class ManagementResourcePreferences(msrest.serialization.Model): +class ManagementResourcePreferences(_serialization.Model): """Management resource preference to link device. - :param preferred_management_resource_id: Customer preferred Management resource ARM ID. - :type preferred_management_resource_id: str + :ivar preferred_management_resource_id: Customer preferred Management resource ARM ID. + :vartype preferred_management_resource_id: str """ _attribute_map = { - 'preferred_management_resource_id': {'key': 'preferredManagementResourceId', 'type': 'str'}, + "preferred_management_resource_id": {"key": "preferredManagementResourceId", "type": "str"}, } - def __init__( - self, - *, - preferred_management_resource_id: Optional[str] = None, - **kwargs - ): - super(ManagementResourcePreferences, self).__init__(**kwargs) + def __init__(self, *, preferred_management_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword preferred_management_resource_id: Customer preferred Management resource ARM ID. + :paramtype preferred_management_resource_id: str + """ + super().__init__(**kwargs) self.preferred_management_resource_id = preferred_management_resource_id -class MeterDetails(msrest.serialization.Model): +class MeterDetails(_serialization.Model): """Holds details about billing type and its meter guids. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Pav2MeterDetails, PurchaseMeterDetails. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + Pav2MeterDetails, PurchaseMeterDetails 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 billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.BillingType + :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.BillingType :ivar multiplier: Billing unit applicable for Pav2 billing. :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". + :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". :vartype charging_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ChargingType """ _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, + "billing_type": {"required": True}, + "multiplier": {"readonly": True}, + "charging_type": {"readonly": True}, } _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, + "billing_type": {"key": "billingType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, + "charging_type": {"key": "chargingType", "type": "str"}, } - _subtype_map = { - 'billing_type': {'Pav2': 'Pav2MeterDetails', 'Purchase': 'PurchaseMeterDetails'} - } + _subtype_map = {"billing_type": {"Pav2": "Pav2MeterDetails", "Purchase": "PurchaseMeterDetails"}} - def __init__( - self, - **kwargs - ): - super(MeterDetails, self).__init__(**kwargs) - self.billing_type = None # type: Optional[str] + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_type: Optional[str] = None self.multiplier = None self.charging_type = None -class NotificationPreference(msrest.serialization.Model): +class NotificationPreference(_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: "Shipped", - "Delivered". - :type stage_name: str or ~azure.mgmt.edgeorder.v2021_12_01.models.NotificationStageName - :param send_notification: Required. Notification is required or not. - :type send_notification: bool + :ivar stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". + :vartype stage_name: str or ~azure.mgmt.edgeorder.v2021_12_01.models.NotificationStageName + :ivar send_notification: Notification is required or not. Required. + :vartype send_notification: bool """ _validation = { - 'stage_name': {'required': True}, - 'send_notification': {'required': True}, + "stage_name": {"required": True}, + "send_notification": {"required": True}, } _attribute_map = { - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'send_notification': {'key': 'sendNotification', 'type': 'bool'}, + "stage_name": {"key": "stageName", "type": "str"}, + "send_notification": {"key": "sendNotification", "type": "bool"}, } def __init__( - self, - *, - stage_name: Union[str, "NotificationStageName"], - send_notification: bool, - **kwargs - ): - super(NotificationPreference, self).__init__(**kwargs) + self, *, stage_name: Union[str, "_models.NotificationStageName"], send_notification: bool, **kwargs: Any + ) -> None: + """ + :keyword stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". + :paramtype stage_name: str or ~azure.mgmt.edgeorder.v2021_12_01.models.NotificationStageName + :keyword send_notification: Notification is required or not. Required. + :paramtype send_notification: bool + """ + super().__init__(**kwargs) self.stage_name = stage_name self.send_notification = send_notification -class Operation(msrest.serialization.Model): +class Operation(_serialization.Model): """Details of a REST API operation, returned from the Resource Provider Operations API. Variables are only populated by the server, and will be ignored when sending a request. @@ -1464,39 +1505,38 @@ class Operation(msrest.serialization.Model): :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. :vartype is_data_action: bool - :param display: Localized display information for this particular operation. - :type display: ~azure.mgmt.edgeorder.v2021_12_01.models.OperationDisplay + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.edgeorder.v2021_12_01.models.OperationDisplay :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Possible values include: "user", - "system", "user,system". + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". :vartype origin: str or ~azure.mgmt.edgeorder.v2021_12_01.models.Origin :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. Possible values include: "Internal". + internal only APIs. "Internal" :vartype action_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ActionType """ _validation = { - 'name': {'readonly': True}, - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - 'action_type': {'readonly': True}, + "name": {"readonly": True}, + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + "action_type": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "origin": {"key": "origin", "type": "str"}, + "action_type": {"key": "actionType", "type": "str"}, } - def __init__( - self, - *, - display: Optional["OperationDisplay"] = None, - **kwargs - ): - super(Operation, self).__init__(**kwargs) + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: + """ + :keyword display: Localized display information for this particular operation. + :paramtype display: ~azure.mgmt.edgeorder.v2021_12_01.models.OperationDisplay + """ + super().__init__(**kwargs) self.name = None self.is_data_action = None self.display = display @@ -1504,7 +1544,7 @@ def __init__( self.action_type = None -class OperationDisplay(msrest.serialization.Model): +class OperationDisplay(_serialization.Model): """Localized display information for this particular operation. Variables are only populated by the server, and will be ignored when sending a request. @@ -1524,32 +1564,31 @@ class OperationDisplay(msrest.serialization.Model): """ _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, + "provider": {"readonly": True}, + "resource": {"readonly": True}, + "operation": {"readonly": True}, + "description": {"readonly": True}, } _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "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) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.provider = None self.resource = None self.operation = None self.description = None -class OperationListResult(msrest.serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. +class OperationListResult(_serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -1560,63 +1599,60 @@ class OperationListResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.value = None self.next_link = None -class OrderItemDetails(msrest.serialization.Model): +class OrderItemDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes """Order item 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 product_details: Required. Unique identifier for configuration. - :type product_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductDetails - :param order_item_type: Required. Order item type. Possible values include: "Purchase", - "Rental". - :type order_item_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemType + :ivar product_details: Unique identifier for configuration. Required. + :vartype product_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductDetails + :ivar order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". + :vartype order_item_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemType :ivar current_stage: Current Order item Status. :vartype current_stage: ~azure.mgmt.edgeorder.v2021_12_01.models.StageDetails :ivar order_item_stage_history: Order item status history. :vartype order_item_stage_history: list[~azure.mgmt.edgeorder.v2021_12_01.models.StageDetails] - :param preferences: Customer notification Preferences. - :type preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences + :ivar preferences: Customer notification Preferences. + :vartype preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences :ivar forward_shipping_details: Forward Package Shipping details. :vartype forward_shipping_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ForwardShippingDetails :ivar reverse_shipping_details: Reverse Package Shipping details. :vartype reverse_shipping_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ReverseShippingDetails - :param notification_email_list: Additional notification email list. - :type notification_email_list: list[str] + :ivar notification_email_list: Additional notification email list. + :vartype notification_email_list: list[str] :ivar cancellation_reason: Cancellation reason. :vartype cancellation_reason: str - :ivar cancellation_status: Describes whether the order item is cancellable or not. Possible - values include: "Cancellable", "CancellableWithFee", "NotCancellable". + :ivar cancellation_status: Describes whether the order item is cancellable or not. Known values + are: "Cancellable", "CancellableWithFee", and "NotCancellable". :vartype cancellation_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemCancellationEnum - :ivar deletion_status: Describes whether the order item is deletable or not. Possible values - include: "Allowed", "NotAllowed". + :ivar deletion_status: Describes whether the order item is deletable or not. Known values are: + "Allowed" and "NotAllowed". :vartype deletion_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ActionStatusEnum :ivar return_reason: Return reason. :vartype return_reason: str - :ivar return_status: Describes whether the order item is returnable or not. Possible values - include: "Returnable", "ReturnableWithFee", "NotReturnable". + :ivar return_status: Describes whether the order item is returnable or not. Known values are: + "Returnable", "ReturnableWithFee", and "NotReturnable". :vartype return_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemReturnEnum :ivar management_rp_details: Parent RP details - this returns only the first or default parent RP from the entire list. @@ -1630,51 +1666,61 @@ class OrderItemDetails(msrest.serialization.Model): """ _validation = { - 'product_details': {'required': True}, - 'order_item_type': {'required': True}, - 'current_stage': {'readonly': True}, - 'order_item_stage_history': {'readonly': True}, - 'forward_shipping_details': {'readonly': True}, - 'reverse_shipping_details': {'readonly': True}, - 'cancellation_reason': {'readonly': True}, - 'cancellation_status': {'readonly': True}, - 'deletion_status': {'readonly': True}, - 'return_reason': {'readonly': True}, - 'return_status': {'readonly': True}, - 'management_rp_details': {'readonly': True}, - 'management_rp_details_list': {'readonly': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'product_details': {'key': 'productDetails', 'type': 'ProductDetails'}, - 'order_item_type': {'key': 'orderItemType', 'type': 'str'}, - 'current_stage': {'key': 'currentStage', 'type': 'StageDetails'}, - 'order_item_stage_history': {'key': 'orderItemStageHistory', 'type': '[StageDetails]'}, - 'preferences': {'key': 'preferences', 'type': 'Preferences'}, - 'forward_shipping_details': {'key': 'forwardShippingDetails', 'type': 'ForwardShippingDetails'}, - 'reverse_shipping_details': {'key': 'reverseShippingDetails', 'type': 'ReverseShippingDetails'}, - 'notification_email_list': {'key': 'notificationEmailList', 'type': '[str]'}, - 'cancellation_reason': {'key': 'cancellationReason', 'type': 'str'}, - 'cancellation_status': {'key': 'cancellationStatus', 'type': 'str'}, - 'deletion_status': {'key': 'deletionStatus', 'type': 'str'}, - 'return_reason': {'key': 'returnReason', 'type': 'str'}, - 'return_status': {'key': 'returnStatus', 'type': 'str'}, - 'management_rp_details': {'key': 'managementRpDetails', 'type': 'ResourceProviderDetails'}, - 'management_rp_details_list': {'key': 'managementRpDetailsList', 'type': '[ResourceProviderDetails]'}, - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "product_details": {"required": True}, + "order_item_type": {"required": True}, + "current_stage": {"readonly": True}, + "order_item_stage_history": {"readonly": True}, + "forward_shipping_details": {"readonly": True}, + "reverse_shipping_details": {"readonly": True}, + "cancellation_reason": {"readonly": True}, + "cancellation_status": {"readonly": True}, + "deletion_status": {"readonly": True}, + "return_reason": {"readonly": True}, + "return_status": {"readonly": True}, + "management_rp_details": {"readonly": True}, + "management_rp_details_list": {"readonly": True}, + "error": {"readonly": True}, + } + + _attribute_map = { + "product_details": {"key": "productDetails", "type": "ProductDetails"}, + "order_item_type": {"key": "orderItemType", "type": "str"}, + "current_stage": {"key": "currentStage", "type": "StageDetails"}, + "order_item_stage_history": {"key": "orderItemStageHistory", "type": "[StageDetails]"}, + "preferences": {"key": "preferences", "type": "Preferences"}, + "forward_shipping_details": {"key": "forwardShippingDetails", "type": "ForwardShippingDetails"}, + "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, + "notification_email_list": {"key": "notificationEmailList", "type": "[str]"}, + "cancellation_reason": {"key": "cancellationReason", "type": "str"}, + "cancellation_status": {"key": "cancellationStatus", "type": "str"}, + "deletion_status": {"key": "deletionStatus", "type": "str"}, + "return_reason": {"key": "returnReason", "type": "str"}, + "return_status": {"key": "returnStatus", "type": "str"}, + "management_rp_details": {"key": "managementRpDetails", "type": "ResourceProviderDetails"}, + "management_rp_details_list": {"key": "managementRpDetailsList", "type": "[ResourceProviderDetails]"}, + "error": {"key": "error", "type": "ErrorDetail"}, } def __init__( self, *, - product_details: "ProductDetails", - order_item_type: Union[str, "OrderItemType"], - preferences: Optional["Preferences"] = None, + product_details: "_models.ProductDetails", + order_item_type: Union[str, "_models.OrderItemType"], + preferences: Optional["_models.Preferences"] = None, notification_email_list: Optional[List[str]] = None, - **kwargs - ): - super(OrderItemDetails, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword product_details: Unique identifier for configuration. Required. + :paramtype product_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductDetails + :keyword order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". + :paramtype order_item_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemType + :keyword preferences: Customer notification Preferences. + :paramtype preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences + :keyword notification_email_list: Additional notification email list. + :paramtype notification_email_list: list[str] + """ + super().__init__(**kwargs) self.product_details = product_details self.order_item_type = order_item_type self.current_stage = None @@ -1708,58 +1754,70 @@ class OrderItemResource(TrackedResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :type location: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar system_data: Represents resource creation and update time. :vartype system_data: ~azure.mgmt.edgeorder.v2021_12_01.models.SystemData - :param order_item_details: Required. Represents order item details. - :type order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemDetails - :param address_details: Required. Represents shipping and return address for order item. - :type address_details: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressDetails + :ivar order_item_details: Represents order item details. Required. + :vartype order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemDetails + :ivar address_details: Represents shipping and return address for order item. Required. + :vartype address_details: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressDetails :ivar start_time: Start time of order item. :vartype start_time: ~datetime.datetime - :param order_id: Required. Id of the order to which order item belongs to. - :type order_id: str + :ivar order_id: Id of the order to which order item belongs to. Required. + :vartype order_id: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - 'order_item_details': {'required': True}, - 'address_details': {'required': True}, - 'start_time': {'readonly': True}, - 'order_id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'order_item_details': {'key': 'properties.orderItemDetails', 'type': 'OrderItemDetails'}, - 'address_details': {'key': 'properties.addressDetails', 'type': 'AddressDetails'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'order_id': {'key': 'properties.orderId', 'type': 'str'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, + "system_data": {"readonly": True}, + "order_item_details": {"required": True}, + "address_details": {"required": True}, + "start_time": {"readonly": True}, + "order_id": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "order_item_details": {"key": "properties.orderItemDetails", "type": "OrderItemDetails"}, + "address_details": {"key": "properties.addressDetails", "type": "AddressDetails"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "order_id": {"key": "properties.orderId", "type": "str"}, } def __init__( self, *, location: str, - order_item_details: "OrderItemDetails", - address_details: "AddressDetails", + order_item_details: "_models.OrderItemDetails", + address_details: "_models.AddressDetails", order_id: str, tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(OrderItemResource, self).__init__(tags=tags, location=location, **kwargs) + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword order_item_details: Represents order item details. Required. + :paramtype order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemDetails + :keyword address_details: Represents shipping and return address for order item. Required. + :paramtype address_details: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressDetails + :keyword order_id: Id of the order to which order item belongs to. Required. + :paramtype order_id: str + """ + super().__init__(tags=tags, location=location, **kwargs) self.system_data = None self.order_item_details = order_item_details self.address_details = address_details @@ -1767,68 +1825,78 @@ def __init__( self.order_id = order_id -class OrderItemResourceList(msrest.serialization.Model): +class OrderItemResourceList(_serialization.Model): """List of orderItems. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of order item resources. :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :param next_link: Link for the next set of order item resources. - :type next_link: str + :ivar next_link: Link for the next set of order item resources. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[OrderItemResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[OrderItemResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(OrderItemResourceList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of order item resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link -class OrderItemUpdateParameter(msrest.serialization.Model): +class OrderItemUpdateParameter(_serialization.Model): """Updates order item parameters. - :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 forward_address: Updates forward shipping address and contact details. - :type forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties - :param preferences: Customer preference. - :type preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences - :param notification_email_list: Additional notification email list. - :type notification_email_list: list[str] + :ivar 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 forward_address: Updates forward shipping address and contact details. + :vartype forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :ivar preferences: Customer preference. + :vartype preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences + :ivar notification_email_list: Additional notification email list. + :vartype notification_email_list: list[str] """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'forward_address': {'key': 'properties.forwardAddress', 'type': 'AddressProperties'}, - 'preferences': {'key': 'properties.preferences', 'type': 'Preferences'}, - 'notification_email_list': {'key': 'properties.notificationEmailList', 'type': '[str]'}, + "tags": {"key": "tags", "type": "{str}"}, + "forward_address": {"key": "properties.forwardAddress", "type": "AddressProperties"}, + "preferences": {"key": "properties.preferences", "type": "Preferences"}, + "notification_email_list": {"key": "properties.notificationEmailList", "type": "[str]"}, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, - forward_address: Optional["AddressProperties"] = None, - preferences: Optional["Preferences"] = None, + forward_address: Optional["_models.AddressProperties"] = None, + preferences: Optional["_models.Preferences"] = None, notification_email_list: Optional[List[str]] = None, - **kwargs - ): - super(OrderItemUpdateParameter, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword 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 forward_address: Updates forward shipping address and contact details. + :paramtype forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :keyword preferences: Customer preference. + :paramtype preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences + :keyword notification_email_list: Additional notification email list. + :paramtype notification_email_list: list[str] + """ + super().__init__(**kwargs) self.tags = tags self.forward_address = forward_address self.preferences = preferences @@ -1836,7 +1904,8 @@ def __init__( class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -1851,26 +1920,25 @@ class ProxyResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) class OrderResource(ProxyResource): - """Specifies the properties or parameters for an order. Order is a grouping of one or more order items. + """Specifies the properties or parameters for an order. Order is a grouping of one or more order + items. Variables are only populated by the server, and will be ignored when sending a request. @@ -1893,63 +1961,60 @@ class OrderResource(ProxyResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'order_item_ids': {'readonly': True}, - 'current_stage': {'readonly': True}, - 'order_stage_history': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "order_item_ids": {"readonly": True}, + "current_stage": {"readonly": True}, + "order_stage_history": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'order_item_ids': {'key': 'properties.orderItemIds', 'type': '[str]'}, - 'current_stage': {'key': 'properties.currentStage', 'type': 'StageDetails'}, - 'order_stage_history': {'key': 'properties.orderStageHistory', 'type': '[StageDetails]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "order_item_ids": {"key": "properties.orderItemIds", "type": "[str]"}, + "current_stage": {"key": "properties.currentStage", "type": "StageDetails"}, + "order_stage_history": {"key": "properties.orderStageHistory", "type": "[StageDetails]"}, } - def __init__( - self, - **kwargs - ): - super(OrderResource, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.system_data = None self.order_item_ids = None self.current_stage = None self.order_stage_history = None -class OrderResourceList(msrest.serialization.Model): +class OrderResourceList(_serialization.Model): """List of orders. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of order resources. :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] - :param next_link: Link for the next set of order resources. - :type next_link: str + :ivar next_link: Link for the next set of order resources. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[OrderResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[OrderResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(OrderResourceList, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of order resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link @@ -1961,79 +2026,92 @@ class Pav2MeterDetails(MeterDetails): All required parameters must be populated in order to send to Azure. - :param billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.BillingType + :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.BillingType :ivar multiplier: Billing unit applicable for Pav2 billing. :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". + :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". :vartype charging_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ChargingType :ivar meter_guid: Validation status of requested data center and transport. :vartype meter_guid: str """ _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - 'meter_guid': {'readonly': True}, + "billing_type": {"required": True}, + "multiplier": {"readonly": True}, + "charging_type": {"readonly": True}, + "meter_guid": {"readonly": True}, } _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - 'meter_guid': {'key': 'meterGuid', 'type': 'str'}, + "billing_type": {"key": "billingType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, + "charging_type": {"key": "chargingType", "type": "str"}, + "meter_guid": {"key": "meterGuid", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Pav2MeterDetails, self).__init__(**kwargs) - self.billing_type = 'Pav2' # type: str + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_type: str = "Pav2" self.meter_guid = None -class Preferences(msrest.serialization.Model): +class Preferences(_serialization.Model): """Preferences related to the order. - :param notification_preferences: Notification preferences. - :type notification_preferences: + :ivar notification_preferences: Notification preferences. + :vartype notification_preferences: list[~azure.mgmt.edgeorder.v2021_12_01.models.NotificationPreference] - :param transport_preferences: Preferences related to the shipment logistics of the order. - :type transport_preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.TransportPreferences - :param encryption_preferences: Preferences related to the Encryption. - :type encryption_preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.EncryptionPreferences - :param management_resource_preferences: Preferences related to the Management resource. - :type management_resource_preferences: + :ivar transport_preferences: Preferences related to the shipment logistics of the order. + :vartype transport_preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.TransportPreferences + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.EncryptionPreferences + :ivar management_resource_preferences: Preferences related to the Management resource. + :vartype management_resource_preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.ManagementResourcePreferences """ _attribute_map = { - 'notification_preferences': {'key': 'notificationPreferences', 'type': '[NotificationPreference]'}, - 'transport_preferences': {'key': 'transportPreferences', 'type': 'TransportPreferences'}, - 'encryption_preferences': {'key': 'encryptionPreferences', 'type': 'EncryptionPreferences'}, - 'management_resource_preferences': {'key': 'managementResourcePreferences', 'type': 'ManagementResourcePreferences'}, + "notification_preferences": {"key": "notificationPreferences", "type": "[NotificationPreference]"}, + "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, + "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, + "management_resource_preferences": { + "key": "managementResourcePreferences", + "type": "ManagementResourcePreferences", + }, } def __init__( self, *, - notification_preferences: Optional[List["NotificationPreference"]] = None, - transport_preferences: Optional["TransportPreferences"] = None, - encryption_preferences: Optional["EncryptionPreferences"] = None, - management_resource_preferences: Optional["ManagementResourcePreferences"] = None, - **kwargs - ): - super(Preferences, self).__init__(**kwargs) + notification_preferences: Optional[List["_models.NotificationPreference"]] = None, + transport_preferences: Optional["_models.TransportPreferences"] = None, + encryption_preferences: Optional["_models.EncryptionPreferences"] = None, + management_resource_preferences: Optional["_models.ManagementResourcePreferences"] = None, + **kwargs: Any + ) -> None: + """ + :keyword notification_preferences: Notification preferences. + :paramtype notification_preferences: + list[~azure.mgmt.edgeorder.v2021_12_01.models.NotificationPreference] + :keyword transport_preferences: Preferences related to the shipment logistics of the order. + :paramtype transport_preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.TransportPreferences + :keyword encryption_preferences: Preferences related to the Encryption. + :paramtype encryption_preferences: + ~azure.mgmt.edgeorder.v2021_12_01.models.EncryptionPreferences + :keyword management_resource_preferences: Preferences related to the Management resource. + :paramtype management_resource_preferences: + ~azure.mgmt.edgeorder.v2021_12_01.models.ManagementResourcePreferences + """ + super().__init__(**kwargs) self.notification_preferences = notification_preferences self.transport_preferences = transport_preferences self.encryption_preferences = encryption_preferences self.management_resource_preferences = management_resource_preferences -class Product(msrest.serialization.Model): +class Product(_serialization.Model): """List of Products. Variables are only populated by the server, and will be ignored when sending a request. @@ -2059,32 +2137,30 @@ class Product(msrest.serialization.Model): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'configurations': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'configurations': {'key': 'properties.configurations', 'type': '[Configuration]'}, - } - - def __init__( - self, - **kwargs - ): - super(Product, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "configurations": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "configurations": {"key": "properties.configurations", "type": "[Configuration]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -2095,22 +2171,22 @@ def __init__( self.configurations = None -class ProductDetails(msrest.serialization.Model): +class ProductDetails(_serialization.Model): """Represents product 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 display_info: Display details of the product. - :type display_info: ~azure.mgmt.edgeorder.v2021_12_01.models.DisplayInfo - :param hierarchy_information: Required. Hierarchy of the product which uniquely identifies the - product. - :type hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :ivar display_info: Display details of the product. + :vartype display_info: ~azure.mgmt.edgeorder.v2021_12_01.models.DisplayInfo + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the product. + Required. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation :ivar count: Quantity of the product. :vartype count: int :ivar product_double_encryption_status: Double encryption status of the configuration. - Read-only field. Possible values include: "Disabled", "Enabled". + Read-only field. Known values are: "Disabled" and "Enabled". :vartype product_double_encryption_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.DoubleEncryptionStatus :ivar device_details: list of device details. @@ -2118,28 +2194,35 @@ class ProductDetails(msrest.serialization.Model): """ _validation = { - 'hierarchy_information': {'required': True}, - 'count': {'readonly': True}, - 'product_double_encryption_status': {'readonly': True}, - 'device_details': {'readonly': True}, + "hierarchy_information": {"required": True}, + "count": {"readonly": True}, + "product_double_encryption_status": {"readonly": True}, + "device_details": {"readonly": True}, } _attribute_map = { - 'display_info': {'key': 'displayInfo', 'type': 'DisplayInfo'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'count': {'key': 'count', 'type': 'int'}, - 'product_double_encryption_status': {'key': 'productDoubleEncryptionStatus', 'type': 'str'}, - 'device_details': {'key': 'deviceDetails', 'type': '[DeviceDetails]'}, + "display_info": {"key": "displayInfo", "type": "DisplayInfo"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "count": {"key": "count", "type": "int"}, + "product_double_encryption_status": {"key": "productDoubleEncryptionStatus", "type": "str"}, + "device_details": {"key": "deviceDetails", "type": "[DeviceDetails]"}, } def __init__( self, *, - hierarchy_information: "HierarchyInformation", - display_info: Optional["DisplayInfo"] = None, - **kwargs - ): - super(ProductDetails, self).__init__(**kwargs) + hierarchy_information: "_models.HierarchyInformation", + display_info: Optional["_models.DisplayInfo"] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_info: Display details of the product. + :paramtype display_info: ~azure.mgmt.edgeorder.v2021_12_01.models.DisplayInfo + :keyword hierarchy_information: Hierarchy of the product which uniquely identifies the product. + Required. + :paramtype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + """ + super().__init__(**kwargs) self.display_info = display_info self.hierarchy_information = hierarchy_information self.count = None @@ -2147,38 +2230,37 @@ def __init__( self.device_details = None -class ProductFamilies(msrest.serialization.Model): +class ProductFamilies(_serialization.Model): """The list of product families. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of product families. :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] - :param next_link: Link for the next set of product families. - :type next_link: str + :ivar next_link: Link for the next set of product families. + :vartype next_link: str """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductFamily]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ProductFamily]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(ProductFamilies, self).__init__(**kwargs) + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of product families. + :paramtype next_link: str + """ + super().__init__(**kwargs) self.value = None self.next_link = next_link -class ProductFamiliesMetadata(msrest.serialization.Model): +class ProductFamiliesMetadata(_serialization.Model): """Holds details about product family metadata. Variables are only populated by the server, and will be ignored when sending a request. @@ -2190,25 +2272,23 @@ class ProductFamiliesMetadata(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductFamiliesMetadataDetails]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ProductFamiliesMetadataDetails]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ProductFamiliesMetadata, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.value = None self.next_link = None -class ProductFamiliesMetadataDetails(msrest.serialization.Model): +class ProductFamiliesMetadataDetails(_serialization.Model): """Product families metadata details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2231,41 +2311,43 @@ class ProductFamiliesMetadataDetails(msrest.serialization.Model): list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] :ivar product_lines: List of product lines supported in the product family. :vartype product_lines: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'properties.productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'properties.resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - *, - resource_provider_details: Optional[List["ResourceProviderDetails"]] = None, - **kwargs - ): - super(ProductFamiliesMetadataDetails, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "product_lines": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, + "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, + } + + def __init__( + self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_provider_details: Contains details related to resource provider. + :paramtype resource_provider_details: + list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] + """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -2277,42 +2359,52 @@ def __init__( self.resource_provider_details = resource_provider_details -class ProductFamiliesRequest(msrest.serialization.Model): +class ProductFamiliesRequest(_serialization.Model): """The filters for showing the product families. All required parameters must be populated in order to send to Azure. - :param filterable_properties: Required. Dictionary of filterable properties on product family. - :type filterable_properties: dict[str, + :ivar filterable_properties: Dictionary of filterable properties on product family. Required. + :vartype filterable_properties: dict[str, list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty]] - :param customer_subscription_details: Customer subscription properties. Clients can display + :ivar customer_subscription_details: Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details. - :type customer_subscription_details: + :vartype customer_subscription_details: ~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionDetails """ _validation = { - 'filterable_properties': {'required': True}, + "filterable_properties": {"required": True}, } _attribute_map = { - 'filterable_properties': {'key': 'filterableProperties', 'type': '{[FilterableProperty]}'}, - 'customer_subscription_details': {'key': 'customerSubscriptionDetails', 'type': 'CustomerSubscriptionDetails'}, + "filterable_properties": {"key": "filterableProperties", "type": "{[FilterableProperty]}"}, + "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, } def __init__( self, *, - filterable_properties: Dict[str, List["FilterableProperty"]], - customer_subscription_details: Optional["CustomerSubscriptionDetails"] = None, - **kwargs - ): - super(ProductFamiliesRequest, self).__init__(**kwargs) + filterable_properties: Dict[str, List["_models.FilterableProperty"]], + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, + **kwargs: Any + ) -> None: + """ + :keyword filterable_properties: Dictionary of filterable properties on product family. + Required. + :paramtype filterable_properties: dict[str, + list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty]] + :keyword customer_subscription_details: Customer subscription properties. Clients can display + available products to unregistered customers by explicitly passing subscription details. + :paramtype customer_subscription_details: + ~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionDetails + """ + super().__init__(**kwargs) self.filterable_properties = filterable_properties self.customer_subscription_details = customer_subscription_details -class ProductFamily(msrest.serialization.Model): +class ProductFamily(_serialization.Model): """Product Family. Variables are only populated by the server, and will be ignored when sending a request. @@ -2335,41 +2427,43 @@ class ProductFamily(msrest.serialization.Model): list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] :ivar product_lines: List of product lines supported in the product family. :vartype product_lines: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'properties.productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'properties.resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - *, - resource_provider_details: Optional[List["ResourceProviderDetails"]] = None, - **kwargs - ): - super(ProductFamily, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "product_lines": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, + "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, + } + + def __init__( + self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_provider_details: Contains details related to resource provider. + :paramtype resource_provider_details: + list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] + """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -2404,46 +2498,48 @@ class ProductFamilyProperties(CommonProperties): list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] :ivar product_lines: List of product lines supported in the product family. :vartype product_lines: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductLine] - :param resource_provider_details: Contains details related to resource provider. - :type resource_provider_details: + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'product_lines': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'product_lines': {'key': 'productLines', 'type': '[ProductLine]'}, - 'resource_provider_details': {'key': 'resourceProviderDetails', 'type': '[ResourceProviderDetails]'}, - } - - def __init__( - self, - *, - resource_provider_details: Optional[List["ResourceProviderDetails"]] = None, - **kwargs - ): - super(ProductFamilyProperties, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "product_lines": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "product_lines": {"key": "productLines", "type": "[ProductLine]"}, + "resource_provider_details": {"key": "resourceProviderDetails", "type": "[ResourceProviderDetails]"}, + } + + def __init__( + self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_provider_details: Contains details related to resource provider. + :paramtype resource_provider_details: + list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] + """ + super().__init__(**kwargs) self.product_lines = None self.resource_provider_details = resource_provider_details -class ProductLine(msrest.serialization.Model): +class ProductLine(_serialization.Model): """Product line. Variables are only populated by the server, and will be ignored when sending a request. @@ -2469,32 +2565,30 @@ class ProductLine(msrest.serialization.Model): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'products': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'Description'}, - 'image_information': {'key': 'properties.imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'properties.costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'properties.availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'properties.hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'properties.filterableProperties', 'type': '[FilterableProperty]'}, - 'products': {'key': 'properties.products', 'type': '[Product]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductLine, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "products": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "products": {"key": "properties.products", "type": "[Product]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.display_name = None self.description = None self.image_information = None @@ -2531,32 +2625,30 @@ class ProductLineProperties(CommonProperties): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'products': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'products': {'key': 'products', 'type': '[Product]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductLineProperties, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "products": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "products": {"key": "products", "type": "[Product]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.products = None @@ -2586,32 +2678,30 @@ class ProductProperties(CommonProperties): """ _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'image_information': {'readonly': True}, - 'cost_information': {'readonly': True}, - 'availability_information': {'readonly': True}, - 'hierarchy_information': {'readonly': True}, - 'filterable_properties': {'readonly': True}, - 'configurations': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'Description'}, - 'image_information': {'key': 'imageInformation', 'type': '[ImageInformation]'}, - 'cost_information': {'key': 'costInformation', 'type': 'CostInformation'}, - 'availability_information': {'key': 'availabilityInformation', 'type': 'AvailabilityInformation'}, - 'hierarchy_information': {'key': 'hierarchyInformation', 'type': 'HierarchyInformation'}, - 'filterable_properties': {'key': 'filterableProperties', 'type': '[FilterableProperty]'}, - 'configurations': {'key': 'configurations', 'type': '[Configuration]'}, - } - - def __init__( - self, - **kwargs - ): - super(ProductProperties, self).__init__(**kwargs) + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "configurations": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "configurations": {"key": "configurations", "type": "[Configuration]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.configurations = None @@ -2622,12 +2712,11 @@ class PurchaseMeterDetails(MeterDetails): All required parameters must be populated in order to send to Azure. - :param billing_type: Required. Represents billing type.Constant filled by server. Possible - values include: "Pav2", "Purchase". - :type billing_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.BillingType + :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.BillingType :ivar multiplier: Billing unit applicable for Pav2 billing. :vartype multiplier: float - :ivar charging_type: Charging type. Possible values include: "PerOrder", "PerDevice". + :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". :vartype charging_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ChargingType :ivar product_id: Product Id. :vartype product_id: str @@ -2638,41 +2727,39 @@ class PurchaseMeterDetails(MeterDetails): """ _validation = { - 'billing_type': {'required': True}, - 'multiplier': {'readonly': True}, - 'charging_type': {'readonly': True}, - 'product_id': {'readonly': True}, - 'sku_id': {'readonly': True}, - 'term_id': {'readonly': True}, + "billing_type": {"required": True}, + "multiplier": {"readonly": True}, + "charging_type": {"readonly": True}, + "product_id": {"readonly": True}, + "sku_id": {"readonly": True}, + "term_id": {"readonly": True}, } _attribute_map = { - 'billing_type': {'key': 'billingType', 'type': 'str'}, - 'multiplier': {'key': 'multiplier', 'type': 'float'}, - 'charging_type': {'key': 'chargingType', 'type': 'str'}, - 'product_id': {'key': 'productId', 'type': 'str'}, - 'sku_id': {'key': 'skuId', 'type': 'str'}, - 'term_id': {'key': 'termId', 'type': 'str'}, + "billing_type": {"key": "billingType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, + "charging_type": {"key": "chargingType", "type": "str"}, + "product_id": {"key": "productId", "type": "str"}, + "sku_id": {"key": "skuId", "type": "str"}, + "term_id": {"key": "termId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(PurchaseMeterDetails, self).__init__(**kwargs) - self.billing_type = 'Purchase' # type: str + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_type: str = "Purchase" self.product_id = None self.sku_id = None self.term_id = None -class ResourceIdentity(msrest.serialization.Model): +class ResourceIdentity(_serialization.Model): """Msi identity details of the resource. 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. @@ -2680,29 +2767,28 @@ class ResourceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + "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'}, + "type": {"key": "type", "type": "str"}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - *, - type: Optional[str] = None, - **kwargs - ): - super(ResourceIdentity, self).__init__(**kwargs) + def __init__(self, *, type: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword type: Identity type. + :paramtype type: str + """ + super().__init__(**kwargs) self.type = type self.principal_id = None self.tenant_id = None -class ResourceProviderDetails(msrest.serialization.Model): +class ResourceProviderDetails(_serialization.Model): """Management RP details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2712,64 +2798,72 @@ class ResourceProviderDetails(msrest.serialization.Model): """ _validation = { - 'resource_provider_namespace': {'readonly': True}, + "resource_provider_namespace": {"readonly": True}, } _attribute_map = { - 'resource_provider_namespace': {'key': 'resourceProviderNamespace', 'type': 'str'}, + "resource_provider_namespace": {"key": "resourceProviderNamespace", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ResourceProviderDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.resource_provider_namespace = None -class ReturnOrderItemDetails(msrest.serialization.Model): +class ReturnOrderItemDetails(_serialization.Model): """Return order item request body. All required parameters must be populated in order to send to Azure. - :param return_address: customer return address. - :type return_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties - :param return_reason: Required. Return Reason. - :type return_reason: str - :param service_tag: Service tag (located on the bottom-right corner of the device). - :type service_tag: str - :param shipping_box_required: Shipping Box required. - :type shipping_box_required: bool + :ivar return_address: customer return address. + :vartype return_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :ivar return_reason: Return Reason. Required. + :vartype return_reason: str + :ivar service_tag: Service tag (located on the bottom-right corner of the device). + :vartype service_tag: str + :ivar shipping_box_required: Shipping Box required. + :vartype shipping_box_required: bool """ _validation = { - 'return_reason': {'required': True}, + "return_reason": {"required": True}, } _attribute_map = { - 'return_address': {'key': 'returnAddress', 'type': 'AddressProperties'}, - 'return_reason': {'key': 'returnReason', 'type': 'str'}, - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'shipping_box_required': {'key': 'shippingBoxRequired', 'type': 'bool'}, + "return_address": {"key": "returnAddress", "type": "AddressProperties"}, + "return_reason": {"key": "returnReason", "type": "str"}, + "service_tag": {"key": "serviceTag", "type": "str"}, + "shipping_box_required": {"key": "shippingBoxRequired", "type": "bool"}, } def __init__( self, *, return_reason: str, - return_address: Optional["AddressProperties"] = None, + return_address: Optional["_models.AddressProperties"] = None, service_tag: Optional[str] = None, - shipping_box_required: Optional[bool] = False, - **kwargs - ): - super(ReturnOrderItemDetails, self).__init__(**kwargs) + shipping_box_required: bool = False, + **kwargs: Any + ) -> None: + """ + :keyword return_address: customer return address. + :paramtype return_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :keyword return_reason: Return Reason. Required. + :paramtype return_reason: str + :keyword service_tag: Service tag (located on the bottom-right corner of the device). + :paramtype service_tag: str + :keyword shipping_box_required: Shipping Box required. + :paramtype shipping_box_required: bool + """ + super().__init__(**kwargs) self.return_address = return_address self.return_reason = return_reason self.service_tag = service_tag self.shipping_box_required = shipping_box_required -class ReverseShippingDetails(msrest.serialization.Model): +class ReverseShippingDetails(_serialization.Model): """Reverse shipment details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2788,26 +2882,24 @@ class ReverseShippingDetails(msrest.serialization.Model): """ _validation = { - 'sas_key_for_label': {'readonly': True}, - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "sas_key_for_label": {"readonly": True}, + "carrier_name": {"readonly": True}, + "carrier_display_name": {"readonly": True}, + "tracking_id": {"readonly": True}, + "tracking_url": {"readonly": True}, } _attribute_map = { - 'sas_key_for_label': {'key': 'sasKeyForLabel', 'type': 'str'}, - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + "sas_key_for_label": {"key": "sasKeyForLabel", "type": "str"}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ReverseShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.sas_key_for_label = None self.carrier_name = None self.carrier_display_name = None @@ -2815,50 +2907,49 @@ def __init__( self.tracking_url = None -class ShippingAddress(msrest.serialization.Model): +class ShippingAddress(_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: 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.edgeorder.v2021_12_01.models.AddressType + :ivar street_address1: Street Address line 1. Required. + :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: Name of the Country. Required. + :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. Known values are: "None", "Residential", and "Commercial". + :vartype address_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.AddressType """ _validation = { - 'street_address1': {'required': True}, - 'country': {'required': True}, + "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'}, + "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__( @@ -2873,10 +2964,33 @@ 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, - **kwargs - ): - super(ShippingAddress, self).__init__(**kwargs) + address_type: Optional[Union[str, "_models.AddressType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword street_address1: Street Address line 1. Required. + :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: Name of the Country. Required. + :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. Known values are: "None", "Residential", and + "Commercial". + :paramtype address_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.AddressType + """ + super().__init__(**kwargs) self.street_address1 = street_address1 self.street_address2 = street_address2 self.street_address3 = street_address3 @@ -2889,7 +3003,7 @@ def __init__( self.address_type = address_type -class ShippingDetails(msrest.serialization.Model): +class ShippingDetails(_serialization.Model): """Package shipping details. Variables are only populated by the server, and will be ignored when sending a request. @@ -2906,31 +3020,29 @@ class ShippingDetails(msrest.serialization.Model): """ _validation = { - 'carrier_name': {'readonly': True}, - 'carrier_display_name': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'tracking_url': {'readonly': True}, + "carrier_name": {"readonly": True}, + "carrier_display_name": {"readonly": True}, + "tracking_id": {"readonly": True}, + "tracking_url": {"readonly": True}, } _attribute_map = { - 'carrier_name': {'key': 'carrierName', 'type': 'str'}, - 'carrier_display_name': {'key': 'carrierDisplayName', 'type': 'str'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'tracking_url': {'key': 'trackingUrl', 'type': 'str'}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(ShippingDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.carrier_name = None self.carrier_display_name = None self.tracking_id = None self.tracking_url = None -class Specification(msrest.serialization.Model): +class Specification(_serialization.Model): """Specifications of the configurations. Variables are only populated by the server, and will be ignored when sending a request. @@ -2942,35 +3054,33 @@ class Specification(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - super(Specification, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.name = None self.value = None -class StageDetails(msrest.serialization.Model): +class StageDetails(_serialization.Model): """Resource stage details. Variables are only populated by the server, and will be ignored when sending a request. - :ivar stage_status: Stage status. Possible values include: "None", "InProgress", "Succeeded", - "Failed", "Cancelled", "Cancelling". + :ivar stage_status: Stage status. Known values are: "None", "InProgress", "Succeeded", + "Failed", "Cancelled", and "Cancelling". :vartype stage_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.StageStatus - :ivar stage_name: Stage name. Possible values include: "Placed", "InReview", "Confirmed", + :ivar stage_name: Stage name. Known values are: "Placed", "InReview", "Confirmed", "ReadyToShip", "Shipped", "Delivered", "InUse", "ReturnInitiated", "ReturnPickedUp", - "ReturnedToMicrosoft", "ReturnCompleted", "Cancelled". + "ReturnedToMicrosoft", "ReturnCompleted", and "Cancelled". :vartype stage_name: str or ~azure.mgmt.edgeorder.v2021_12_01.models.StageName :ivar display_name: Display name of the resource stage. :vartype display_name: str @@ -2979,70 +3089,84 @@ class StageDetails(msrest.serialization.Model): """ _validation = { - 'stage_status': {'readonly': True}, - 'stage_name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'start_time': {'readonly': True}, + "stage_status": {"readonly": True}, + "stage_name": {"readonly": True}, + "display_name": {"readonly": True}, + "start_time": {"readonly": True}, } _attribute_map = { - 'stage_status': {'key': 'stageStatus', 'type': 'str'}, - 'stage_name': {'key': 'stageName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + "stage_status": {"key": "stageStatus", "type": "str"}, + "stage_name": {"key": "stageName", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): - super(StageDetails, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.stage_status = None self.stage_name = None self.display_name = None self.start_time = None -class SystemData(msrest.serialization.Model): +class SystemData(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: 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. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime """ _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'}, + "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, *, created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, created_at: Optional[datetime.datetime] = None, last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type self.created_at = created_at @@ -3051,30 +3175,31 @@ def __init__( self.last_modified_at = last_modified_at -class TransportPreferences(msrest.serialization.Model): +class TransportPreferences(_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 + :ivar preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. + Required. Known values are: "CustomerManaged" and "MicrosoftManaged". + :vartype preferred_shipment_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.TransportShipmentTypes """ _validation = { - 'preferred_shipment_type': {'required': True}, + "preferred_shipment_type": {"required": True}, } _attribute_map = { - 'preferred_shipment_type': {'key': 'preferredShipmentType', 'type': 'str'}, + "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, } - def __init__( - self, - *, - preferred_shipment_type: Union[str, "TransportShipmentTypes"], - **kwargs - ): - super(TransportPreferences, self).__init__(**kwargs) + def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], **kwargs: Any) -> None: + """ + :keyword preferred_shipment_type: Indicates Shipment Logistics type that the customer + preferred. Required. Known values are: "CustomerManaged" and "MicrosoftManaged". + :paramtype preferred_shipment_type: str or + ~azure.mgmt.edgeorder.v2021_12_01.models.TransportShipmentTypes + """ + super().__init__(**kwargs) self.preferred_shipment_type = preferred_shipment_type diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/__init__.py index 6003776a8eee..9e856f64458f 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/__init__.py @@ -8,6 +8,12 @@ from ._edge_order_management_client_operations import EdgeOrderManagementClientOperationsMixin +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'EdgeOrderManagementClientOperationsMixin', + "EdgeOrderManagementClientOperationsMixin", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_edge_order_management_client_operations.py index b3a3cdfc047c..0bbd3ea38795 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_edge_order_management_client_operations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_edge_order_management_client_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,1977 +6,3591 @@ # 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 warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import 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.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models +from ..._serialization import Serializer +from .._vendor import EdgeOrderManagementClientMixinABC, _convert_request, _format_url_section -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False -class EdgeOrderManagementClientOperationsMixin(object): - def list_operations( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] +def build_list_operations_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.EdgeOrder/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_addresses_at_subscription_level_request( + subscription_id: str, *, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_product_families_request( + subscription_id: str, *, expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_configurations_request( + subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_product_families_metadata_request( + subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_order_at_subscription_level_request( + subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_order_items_at_subscription_level_request( + subscription_id: str, + *, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_addresses_at_resource_group_level_request( + resource_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_address_by_name_request( + address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_address_request( + address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_address_by_name_request( + address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_address_request( + address_name: str, resource_group_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_order_at_resource_group_level_request( + resource_group_name: str, subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_order_by_name_request( + order_name: str, resource_group_name: str, location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderName": _SERIALIZER.url("order_name", order_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_order_items_at_resource_group_level_request( + resource_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_order_item_by_name_request( + order_item_name: str, resource_group_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_order_item_request( + order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_order_item_by_name_request( + order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_order_item_request( + order_item_name: str, + resource_group_name: str, + subscription_id: str, + *, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_cancel_order_item_request( + order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_return_order_item_request( + order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return", + ) # pylint: disable=line-too-long + path_format_arguments = { + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class EdgeOrderManagementClientOperationsMixin( + EdgeOrderManagementClientMixinABC +): # pylint: disable=too-many-public-methods + @distributed_trace + def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: """This method gets all the operations that are exposed for customer. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_operations.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 = self._client.get(url, query_parameters, header_parameters) + request = build_list_operations_request( + api_version=api_version, + template_url=self.list_operations.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_operations.metadata = {'url': '/providers/Microsoft.EdgeOrder/operations'} # type: ignore + return ItemPaged(get_next, extract_data) + list_operations.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} + + @distributed_trace def list_addresses_at_subscription_level( - self, - filter=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AddressResourceList"] + self, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.AddressResource"]: """Lists all the addresses available under the subscription. :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. + page in the list of addresses. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_addresses_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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_addresses_at_subscription_level_request( + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_addresses_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', pipeline_response) + deserialized = self._deserialize("AddressResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_addresses_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore + return ItemPaged(get_next, extract_data) + list_addresses_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses" + } + + @overload def list_product_families( self, - product_families_request, # type: "_models.ProductFamiliesRequest" - expand=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProductFamilies"] + product_families_request: _models.ProductFamiliesRequest, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: """This method provides the list of product families for the given subscription. - :param product_families_request: Filters for showing the product families. + :param product_families_request: Filters for showing the product families. Required. :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_product_families( + self, + product_families_request: IO, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: + """This method provides the list of product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: IO + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. :type expand: str :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. + page in the list of product families. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamilies or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamilies] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamilies"] + + @distributed_trace + def list_product_families( + self, + product_families_request: Union[_models.ProductFamiliesRequest, IO], + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: + """This method provides the list of product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO type. Required. + :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest + or IO + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = "application/json" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(product_families_request, (IO, bytes)): + _content = product_families_request + else: + _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") 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_product_families.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + request = build_list_product_families_request( + subscription_id=self._config.subscription_id, + expand=expand, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_product_families.metadata["url"], + headers=_headers, + params=_params, + ) + 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(product_families_request, 'ProductFamiliesRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamilies', pipeline_response) + deserialized = self._deserialize("ProductFamilies", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_product_families.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_product_families.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" + } + @overload def list_configurations( self, - configurations_request, # type: "_models.ConfigurationsRequest" - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.Configurations"] + configurations_request: _models.ConfigurationsRequest, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.Configuration"]: """This method provides the list of configurations for the given product family, product line and product under subscription. - :param configurations_request: Filters for showing the configurations. + :param configurations_request: Filters for showing the configurations. Required. :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. + page in the list of configurations. Default value is None. :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configurations or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configurations] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Configurations"] + + @overload + def list_configurations( + self, + configurations_request: IO, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.Configuration"]: + """This method provides the list of configurations for the given product family, product line and + product under subscription. + + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_configurations( + self, + configurations_request: Union[_models.ConfigurationsRequest, IO], + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.Configuration"]: + """This method provides the list of configurations for the given product family, product line and + product under subscription. + + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO type. Required. + :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or + IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = "application/json" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configurations_request, (IO, bytes)): + _content = configurations_request + else: + _json = self._serialize.body(configurations_request, "ConfigurationsRequest") 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_configurations.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + request = build_list_configurations_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_configurations.metadata["url"], + headers=_headers, + params=_params, + ) + 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(configurations_request, 'ConfigurationsRequest') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('Configurations', pipeline_response) + deserialized = self._deserialize("Configurations", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_configurations.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" + } + @distributed_trace def list_product_families_metadata( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProductFamiliesMetadata"] + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.ProductFamiliesMetadataDetails"]: """This method provides the list of product families metadata for the given subscription. :param skip_token: $skipToken is supported on list of product families metadata, which provides - the next page in the list of product families metadata. + the next page in the list of product families metadata. Default value is None. :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 ProductFamiliesMetadata or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadata] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductFamiliesMetadata"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_product_families_metadata.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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.post(url, query_parameters, header_parameters) + + request = build_list_product_families_metadata_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_product_families_metadata.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProductFamiliesMetadata', pipeline_response) + deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_product_families_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata'} # type: ignore + return ItemPaged(get_next, extract_data) + list_product_families_metadata.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" + } + + @distributed_trace def list_order_at_subscription_level( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OrderResourceList"] + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.OrderResource"]: """Lists order at subscription level. :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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_order_at_subscription_level_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', pipeline_response) + deserialized = self._deserialize("OrderResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_order_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders'} # type: ignore + return ItemPaged(get_next, extract_data) + list_order_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders" + } + + @distributed_trace def list_order_items_at_subscription_level( self, - filter=None, # type: Optional[str] - expand=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OrderItemResourceList"] + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.OrderItemResource"]: """Lists order item at subscription level. :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_items_at_subscription_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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_order_items_at_subscription_level_request( + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_items_at_subscription_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', pipeline_response) + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_order_items_at_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_order_items_at_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems" + } + @distributed_trace def list_addresses_at_resource_group_level( - self, - resource_group_name, # type: str - filter=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AddressResourceList"] + self, resource_group_name: str, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.AddressResource"]: """Lists all the addresses available under the given resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. + supports only equals operation. Default value is None. :type filter: str :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of address. + page in the list of address. Default value is None. :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 AddressResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_addresses_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, '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_addresses_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_addresses_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AddressResourceList', pipeline_response) + deserialized = self._deserialize("AddressResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_addresses_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_addresses_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" + } + @distributed_trace def get_address_by_name( - self, - address_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AddressResource" + self, address_name: str, resource_group_name: str, **kwargs: Any + ) -> _models.AddressResource: """Gets information about the specified address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource, or the result of cls(response) + :return: AddressResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self.get_address_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + + request = build_get_address_by_name_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_address_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + + get_address_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } def _create_address_initial( self, - address_name, # type: str - resource_group_name, # type: str - address_resource, # type: "_models.AddressResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AddressResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] + address_name: str, + resource_group_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> Optional[_models.AddressResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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['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(address_resource, 'AddressResource') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_resource, (IO, bytes)): + _content = address_resource + else: + _json = self._serialize.body(address_resource, "AddressResource") + + request = build_create_address_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_address_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _create_address_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload def begin_create_address( self, - address_name, # type: str - resource_group_name, # type: str - address_resource, # type: "_models.AddressResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AddressResource"] + address_name: str, + resource_group_name: str, + address_resource: _models.AddressResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: """Creates a new address with the specified parameters. Existing address can be updated with this API. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_resource: Address details from request body. + :param address_resource: Address details from request body. Required. :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) + :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 AddressResource or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @overload + def begin_create_address( + self, + address_name: str, + resource_group_name: str, + address_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Creates a new address with the specified parameters. Existing address can be updated with this + API. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_resource: Address details from request body. Required. + :type address_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_address( + self, + address_name: str, + resource_group_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Creates a new address with the specified parameters. Existing address can be updated with this + API. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_resource: Address details from request body. Is either a AddressResource type or + a IO type. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._create_address_initial( address_name=address_name, resource_group_name=resource_group_name, address_resource=address_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) - + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _delete_address_by_name_initial( - self, - address_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + begin_create_address.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements + self, address_name: str, resource_group_name: str, **kwargs: Any + ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self._delete_address_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_address_by_name_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_address_by_name_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_address_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _delete_address_by_name_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + @distributed_trace def begin_delete_address_by_name( - self, - address_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + self, address_name: str, resource_group_name: str, **kwargs: Any + ) -> LROPoller[None]: """Deletes an address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, 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] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_address_by_name_initial( + raw_result = self._delete_address_by_name_initial( # type: ignore address_name=address_name, resource_group_name=resource_group_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_address_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete_address_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } def _update_address_initial( self, - address_name, # type: str - resource_group_name, # type: str - address_update_parameter, # type: "_models.AddressUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.AddressResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AddressResource"]] + address_name: str, + resource_group_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.AddressResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_address_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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(address_update_parameter, 'AddressUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_update_parameter, (IO, bytes)): + _content = address_update_parameter + else: + _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") + + request = build_update_address_request( + address_name=address_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_address_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AddressResource', pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_address_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + _update_address_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload def begin_update_address( self, - address_name, # type: str - resource_group_name, # type: str - address_update_parameter, # type: "_models.AddressUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.AddressResource"] + address_name: str, + resource_group_name: str, + address_update_parameter: _models.AddressUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: """Updates the properties of an existing address. :param address_name: The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. + underscore only. Required. :type address_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. + :param address_update_parameter: Address update parameters from request body. Required. :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter :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. + of the job on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 AddressResource or the result of cls(response) + :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 AddressResource or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @overload + def begin_update_address( + self, + address_name: str, + resource_group_name: str, + address_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Updates the properties of an existing address. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_address( + self, + address_name: str, + resource_group_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Updates the properties of an existing address. + + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_update_parameter: Address update parameters from request body. Is either a + AddressUpdateParameter type or a IO type. Required. + :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter + or IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._update_address_initial( address_name=address_name, resource_group_name=resource_group_name, address_update_parameter=address_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AddressResource', pipeline_response) - + deserialized = self._deserialize("AddressResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'addressName': self._serialize.url("address_name", address_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update_address.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + @distributed_trace def list_order_at_resource_group_level( - self, - resource_group_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OrderResourceList"] + self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.OrderResource"]: """Lists order at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. + in the list of order. Default value is None. :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 OrderResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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_order_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OrderResourceList', pipeline_response) + deserialized = self._deserialize("OrderResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_order_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_order_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" + } + @distributed_trace def get_order_by_name( - self, - order_name, # type: str - resource_group_name, # type: str - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OrderResource" + self, order_name: str, resource_group_name: str, location: str, **kwargs: Any + ) -> _models.OrderResource: """Gets an order. - :param order_name: The name of the order. + :param order_name: The name of the order. Required. :type order_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param location: The name of Azure region. + :param location: The name of Azure region. Required. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource, or the result of cls(response) + :return: OrderResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self.get_order_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderName': self._serialize.url("order_name", order_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'location': self._serialize.url("location", location, 'str', min_length=1), - } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) + + request = build_get_order_by_name_request( + order_name=order_name, + resource_group_name=resource_group_name, + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_order_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('OrderResource', pipeline_response) + deserialized = self._deserialize("OrderResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_order_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}'} # type: ignore + get_order_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" + } + + @distributed_trace def list_order_items_at_resource_group_level( self, - resource_group_name, # type: str - filter=None, # type: Optional[str] - expand=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OrderItemResourceList"] + resource_group_name: str, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.OrderItemResource"]: """Lists order item at resource group level. :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. + operation. Default value is None. :type filter: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. + page in the list of order items. Default value is None. :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 OrderItemResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResourceList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResourceList"] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" + error_map.update(kwargs.pop("error_map", {}) or {}) 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_order_items_at_resource_group_level.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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 filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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_order_items_at_resource_group_level_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_order_items_at_resource_group_level.metadata["url"], + headers=_headers, + params=_params, + ) + 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) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OrderItemResourceList', pipeline_response) + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( - get_next, extract_data - ) - list_order_items_at_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems'} # type: ignore + return ItemPaged(get_next, extract_data) + + list_order_items_at_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" + } + @distributed_trace def get_order_item_by_name( - self, - order_item_name, # type: str - resource_group_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.OrderItemResource" + self, order_item_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> _models.OrderItemResource: """Gets an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str :param expand: $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. + Shipping details provide forward and reverse shipping details respectively. Default value is + None. :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource, or the result of cls(response) + :return: OrderItemResource or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self.get_order_item_by_name.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + + request = build_get_order_item_by_name_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + template_url=self.get_order_item_by_name.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + + get_order_item_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } def _create_order_item_initial( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_resource, # type: "_models.OrderItemResource" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OrderItemResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] + order_item_name: str, + resource_group_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> Optional[_models.OrderItemResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(order_item_resource, 'OrderItemResource') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_resource, (IO, bytes)): + _content = order_item_resource + else: + _json = self._serialize.body(order_item_resource, "OrderItemResource") + + request = build_create_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _create_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload def begin_create_order_item( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_resource, # type: "_models.OrderItemResource" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OrderItemResource"] + order_item_name: str, + resource_group_name: str, + order_item_resource: _models.OrderItemResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: """Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_resource: Order item details from request body. + :param order_item_resource: Order item details from request body. Required. :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @overload + def begin_create_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Creates an order item. Existing order item cannot be updated with this api and should instead + be updated with the Update order item API. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_resource: Order item details from request body. Required. + :type order_item_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Creates an order item. Existing order item cannot be updated with this api and should instead + be updated with the Update order item API. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_resource: Order item details from request body. Is either a OrderItemResource + type or a IO type. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._create_order_item_initial( order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_resource=order_item_resource, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _delete_order_item_by_name_initial( - self, - order_item_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + begin_create_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements + self, order_item_name: str, resource_group_name: str, **kwargs: Any + ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - accept = "application/json" - - # Construct URL - url = self._delete_order_item_by_name_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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') + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_order_item_by_name_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_order_item_by_name_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) - 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_order_item_by_name_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _delete_order_item_by_name_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + @distributed_trace def begin_delete_order_item_by_name( - self, - order_item_name, # type: str - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + self, order_item_name: str, resource_group_name: str, **kwargs: Any + ) -> LROPoller[None]: """Deletes an order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, 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] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_order_item_by_name_initial( + raw_result = self._delete_order_item_by_name_initial( # type: ignore order_item_name=order_item_name, resource_group_name=resource_group_name, - cls=lambda x,y,z: x, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete_order_item_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete_order_item_by_name.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } def _update_order_item_initial( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_update_parameter, # type: "_models.OrderItemUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OrderItemResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OrderItemResource"]] + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.OrderItemResource]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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(order_item_update_parameter, 'OrderItemUpdateParameter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_update_parameter, (IO, bytes)): + _content = order_item_update_parameter + else: + _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") + + request = build_update_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('OrderItemResource', pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + _update_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload def begin_update_order_item( self, - order_item_name, # type: str - resource_group_name, # type: str - order_item_update_parameter, # type: "_models.OrderItemUpdateParameter" - if_match=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OrderItemResource"] + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: _models.OrderItemUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: """Updates the properties of an existing order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. - :type order_item_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter + :param order_item_update_parameter: order item update parameters from request body. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. + of the order on the server matches this value. Default value is None. :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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 OrderItemResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OrderItemResource"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @overload + def begin_update_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Updates the properties of an existing order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_update_parameter: order item update parameters from request body. Required. + :type order_item_update_parameter: IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_order_item( + self, + order_item_name: str, + resource_group_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Updates the properties of an existing order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_update_parameter: order item update parameters from request body. Is either a + OrderItemUpdateParameter type or a IO type. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._update_order_item_initial( order_item_name=order_item_name, resource_group_name=resource_group_name, order_item_update_parameter=order_item_update_parameter, if_match=if_match, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OrderItemResource', pipeline_response) - + deserialized = self._deserialize("OrderItemResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def cancel_order_item( + begin_update_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + def cancel_order_item( # pylint: disable=inconsistent-return-statements self, - order_item_name, # type: str - resource_group_name, # type: str - cancellation_reason, # type: "_models.CancellationReason" - **kwargs # type: Any - ): - # type: (...) -> None + order_item_name: str, + resource_group_name: str, + cancellation_reason: _models.CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: """Cancel order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. + :param cancellation_reason: Reason for cancellation. Required. :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def cancel_order_item( # pylint: disable=inconsistent-return-statements + self, + order_item_name: str, + resource_group_name: str, + cancellation_reason: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Cancel order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def cancel_order_item( # pylint: disable=inconsistent-return-statements + self, + order_item_name: str, + resource_group_name: str, + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any + ) -> None: + """Cancel order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO type. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :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', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.cancel_order_item.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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['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(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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cancellation_reason, (IO, bytes)): + _content = cancellation_reason + else: + _json = self._serialize.body(cancellation_reason, "CancellationReason") + + request = build_cancel_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.cancel_order_item.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - cancel_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel'} # type: ignore + cancel_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" + } - def _return_order_item_initial( + def _return_order_item_initial( # pylint: disable=inconsistent-return-statements self, - order_item_name, # type: str - resource_group_name, # type: str - return_order_item_details, # type: "_models.ReturnOrderItemDetails" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + order_item_name: str, + resource_group_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-12-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._return_order_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - 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['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(return_order_item_details, 'ReturnOrderItemDetails') - 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) + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(return_order_item_details, (IO, bytes)): + _content = return_order_item_details + else: + _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") + + request = build_return_order_item_request( + order_item_name=order_item_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._return_order_item_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _return_order_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore + _return_order_item_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } + @overload def begin_return_order_item( self, - order_item_name, # type: str - resource_group_name, # type: str - return_order_item_details, # type: "_models.ReturnOrderItemDetails" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + order_item_name: str, + resource_group_name: str, + return_order_item_details: _models.ReturnOrderItemDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: """Return order item. - :param order_item_name: The name of the order item. + :param order_item_name: The name of the order item. Required. :type order_item_name: str :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. - :type return_order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails + :param return_order_item_details: Return order item CurrentStatus. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :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. + :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: """ - polling = kwargs.pop('polling', True) # type: Union[bool, 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] + + @overload + def begin_return_order_item( + self, + order_item_name: str, + resource_group_name: str, + return_order_item_details: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Return order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param return_order_item_details: Return order item CurrentStatus. Required. + :type return_order_item_details: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + + @distributed_trace + def begin_return_order_item( + self, + order_item_name: str, + resource_group_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> LROPoller[None]: + """Return order item. + + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param return_order_item_details: Return order item CurrentStatus. Is either a + ReturnOrderItemDetails type or a IO type. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._return_order_item_initial( + raw_result = self._return_order_item_initial( # type: ignore order_item_name=order_item_name, resource_group_name=resource_group_name, return_order_item_details=return_order_item_details, - cls=lambda x,y,z: x, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) + kwargs.pop("error_map", None) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'orderItemName': self._serialize.url("order_item_name", order_item_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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 + deserialization_callback=get_long_running_output, ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_return_order_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_return_order_item.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/__init__.py new file mode 100644 index 000000000000..cf345f5e5ed1 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/__init__.py @@ -0,0 +1,26 @@ +# 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 ._edge_order_management_client import EdgeOrderManagementClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EdgeOrderManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_configuration.py new file mode 100644 index 000000000000..fb966bb503c3 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_configuration.py @@ -0,0 +1,72 @@ +# 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 sys +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 sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for EdgeOrderManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-05-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) + api_version: Literal["2022-05-01-preview"] = kwargs.pop("api_version", "2022-05-01-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION)) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_edge_order_management_client.py new file mode 100644 index 000000000000..0eb6f9ac818c --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_edge_order_management_client.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient + +from . import models as _models +from .._serialization import Deserializer, Serializer +from ._configuration import EdgeOrderManagementClientConfiguration +from .operations import ( + AddressesOperations, + Operations, + OrderItemsOperations, + OrdersOperations, + ProductsAndConfigurationsOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class EdgeOrderManagementClient: # pylint: disable=client-accepts-api-version-keyword + """The EdgeOrder Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.edgeorder.v2022_05_01_preview.operations.Operations + :ivar addresses: AddressesOperations operations + :vartype addresses: azure.mgmt.edgeorder.v2022_05_01_preview.operations.AddressesOperations + :ivar products_and_configurations: ProductsAndConfigurationsOperations operations + :vartype products_and_configurations: + azure.mgmt.edgeorder.v2022_05_01_preview.operations.ProductsAndConfigurationsOperations + :ivar order_items: OrderItemsOperations operations + :vartype order_items: azure.mgmt.edgeorder.v2022_05_01_preview.operations.OrderItemsOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.edgeorder.v2022_05_01_preview.operations.OrdersOperations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-05-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = EdgeOrderManagementClientConfiguration( + 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.addresses = AddressesOperations(self._client, self._config, self._serialize, self._deserialize) + self.products_and_configurations = ProductsAndConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.order_items = OrderItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> "EdgeOrderManagementClient": + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_metadata.json b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_metadata.json new file mode 100644 index 000000000000..3e153268a377 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_metadata.json @@ -0,0 +1,114 @@ +{ + "chosen_version": "2022-05-01-preview", + "total_api_version_list": ["2022-05-01-preview"], + "client": { + "name": "EdgeOrderManagementClient", + "filename": "_edge_order_management_client", + "description": "The EdgeOrder Client.", + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true, + "method_location": "positional" + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. Required.", + "docstring_type": "str", + "required": true, + "method_location": "positional" + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. Required.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version: Optional[str]=None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles=KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "addresses": "AddressesOperations", + "products_and_configurations": "ProductsAndConfigurationsOperations", + "order_items": "OrderItemsOperations", + "orders": "OrdersOperations" + } +} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_vendor.py new file mode 100644 index 000000000000..bd0df84f5319 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_vendor.py @@ -0,0 +1,30 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import List, cast + +from azure.core.pipeline.transport import HttpRequest + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_version.py similarity index 74% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/__init__.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_version.py index 6003776a8eee..e5754a47ce68 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_version.py @@ -6,8 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._edge_order_management_client_operations import EdgeOrderManagementClientOperationsMixin - -__all__ = [ - 'EdgeOrderManagementClientOperationsMixin', -] +VERSION = "1.0.0b1" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/__init__.py new file mode 100644 index 000000000000..b9eec9b0ea44 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/__init__.py @@ -0,0 +1,23 @@ +# 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 ._edge_order_management_client import EdgeOrderManagementClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EdgeOrderManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_configuration.py new file mode 100644 index 000000000000..e0a9854f2545 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_configuration.py @@ -0,0 +1,72 @@ +# 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 sys +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 sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for EdgeOrderManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-05-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) + api_version: Literal["2022-05-01-preview"] = kwargs.pop("api_version", "2022-05-01-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".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/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_edge_order_management_client.py new file mode 100644 index 000000000000..ff9e58a74d43 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_edge_order_management_client.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient + +from .. import models as _models +from ..._serialization import Deserializer, Serializer +from ._configuration import EdgeOrderManagementClientConfiguration +from .operations import ( + AddressesOperations, + Operations, + OrderItemsOperations, + OrdersOperations, + ProductsAndConfigurationsOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class EdgeOrderManagementClient: # pylint: disable=client-accepts-api-version-keyword + """The EdgeOrder Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.Operations + :ivar addresses: AddressesOperations operations + :vartype addresses: azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.AddressesOperations + :ivar products_and_configurations: ProductsAndConfigurationsOperations operations + :vartype products_and_configurations: + azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.ProductsAndConfigurationsOperations + :ivar order_items: OrderItemsOperations operations + :vartype order_items: + azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.OrderItemsOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.OrdersOperations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-05-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = EdgeOrderManagementClientConfiguration( + 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.addresses = AddressesOperations(self._client, self._config, self._serialize, self._deserialize) + self.products_and_configurations = ProductsAndConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.order_items = OrderItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations(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/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "EdgeOrderManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..c3b25bc71af1 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/__init__.py @@ -0,0 +1,27 @@ +# 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 ._addresses_operations import AddressesOperations +from ._products_and_configurations_operations import ProductsAndConfigurationsOperations +from ._order_items_operations import OrderItemsOperations +from ._orders_operations import OrdersOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "AddressesOperations", + "ProductsAndConfigurationsOperations", + "OrderItemsOperations", + "OrdersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_addresses_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_addresses_operations.py new file mode 100644 index 000000000000..37f0c642648e --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_addresses_operations.py @@ -0,0 +1,951 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.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.core.utils import case_insensitive_dict +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._addresses_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_update_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class AddressesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s + :attr:`addresses` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription( + self, filter: Optional[str] = None, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.AddressResource"]: + """List all the addresses available under the subscription. + + :param filter: $filter is supported to filter based on shipping address properties. Filter + supports only equals operation. Default value is None. + :type filter: str + :param skip_token: $skipToken is supported on Get list of addresses, which provides the next + page in the list of addresses. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_subscription.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AddressResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses"} + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.AddressResource"]: + """List all the addresses available under the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param filter: $filter is supported to filter based on shipping address properties. Filter + supports only equals operation. Default value is None. + :type filter: str + :param skip_token: $skipToken is supported on Get list of addresses, which provides the next + page in the list of addresses. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AddressResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, 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.EdgeOrder/addresses" + } + + @distributed_trace_async + async def get(self, resource_group_name: str, address_name: str, **kwargs: Any) -> _models.AddressResource: + """Get information about the specified address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressResource or the result of cls(response) + :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AddressResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + async def _create_initial( + self, + resource_group_name: str, + address_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> Optional[_models.AddressResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_resource, (IO, bytes)): + _content = address_resource + else: + _json = self._serialize.body(address_resource, "AddressResource") + + request = build_create_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("AddressResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload + async def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: _models.AddressResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Create a new address with the specified parameters. Existing address cannot be updated with + this API and should + instead be updated with the Update address API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_resource: Address details from request body. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Create a new address with the specified parameters. Existing address cannot be updated with + this API and should + instead be updated with the Update address API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_resource: Address details from request body. Required. + :type address_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Create a new address with the specified parameters. Existing address cannot be updated with + this API and should + instead be updated with the Update address API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_resource: Address details from request body. Is either a AddressResource type or + a IO type. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + address_name=address_name, + address_resource=address_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AddressResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, address_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, address_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete an address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + address_name=address_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + async def _update_initial( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.AddressResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_update_parameter, (IO, bytes)): + _content = address_update_parameter + else: + _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") + + request = build_update_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("AddressResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: _models.AddressUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Update the properties of an existing address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressUpdateParameter + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Update the properties of an existing address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Update the properties of an existing address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_update_parameter: Address update parameters from request body. Is either a + AddressUpdateParameter type or a IO type. Required. + :type address_update_parameter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressUpdateParameter or IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + address_name=address_name, + address_update_parameter=address_update_parameter, + if_match=if_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AddressResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_operations.py new file mode 100644 index 000000000000..26d739c9c702 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_operations.py @@ -0,0 +1,140 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + """List all the supported operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, 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.EdgeOrder/operations"} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_order_items_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_order_items_operations.py new file mode 100644 index 000000000000..edbd8fcb11fb --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_order_items_operations.py @@ -0,0 +1,1329 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.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.core.utils import case_insensitive_dict +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._order_items_operations import ( + build_cancel_request, + build_create_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_return_method_request, + build_update_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class OrderItemsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s + :attr:`order_items` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription( + self, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.OrderItemResource"]: + """List order items at subscription level. + + :param filter: $filter is supported to filter based on order id. Filter supports only equals + operation. Default value is None. + :type filter: str + :param expand: $expand is supported on parent device details, device details, forward shipping + details and reverse shipping details parameters. Each of these can be provided as a comma + separated list. Parent Device Details for order item provides details on the devices of the + product, Device Details for order item provides details on the devices of the child + configurations of the product, Forward and Reverse Shipping details provide forward and reverse + shipping details respectively. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on Get list of order items, which provides the next + page in the list of order items. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_subscription.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems"} + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.OrderItemResource"]: + """List order items at resource group level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param filter: $filter is supported to filter based on order id. Filter supports only equals + operation. Default value is None. + :type filter: str + :param expand: $expand is supported on parent device details, device details, forward shipping + details and reverse shipping details parameters. Each of these can be provided as a comma + separated list. Parent Device Details for order item provides details on the devices of the + product, Device Details for order item provides details on the devices of the child + configurations of the product, Forward and Reverse Shipping details provide forward and reverse + shipping details respectively. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on Get list of order items, which provides the next + page in the list of order items. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, 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.EdgeOrder/orderItems" + } + + @distributed_trace_async + async def get( + self, resource_group_name: str, order_item_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> _models.OrderItemResource: + """Get an order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param expand: $expand is supported on parent device details, device details, forward shipping + details and reverse shipping details parameters. Each of these can be provided as a comma + separated list. Parent Device Details for order item provides details on the devices of the + product, Device Details for order item provides details on the devices of the child + configurations of the product, Forward and Reverse Shipping details provide forward and reverse + shipping details respectively. Default value is None. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrderItemResource or the result of cls(response) + :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OrderItemResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + async def _create_initial( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> Optional[_models.OrderItemResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_resource, (IO, bytes)): + _content = order_item_resource + else: + _json = self._serialize.body(order_item_resource, "OrderItemResource") + + request = build_create_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("OrderItemResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + async def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: _models.OrderItemResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Create an order item. Existing order item cannot be updated with this api and should instead be + updated with the Update order item + API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_resource: Order item details from request body. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Create an order item. Existing order item cannot be updated with this api and should instead be + updated with the Update order item + API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_resource: Order item details from request body. Required. + :type order_item_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Create an order item. Existing order item cannot be updated with this api and should instead be + updated with the Update order item + API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_resource: Order item details from request body. Is either a OrderItemResource + type or a IO type. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + order_item_resource=order_item_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OrderItemResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, order_item_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, order_item_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete an order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + order_item_name=order_item_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + async def _update_initial( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.OrderItemResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_update_parameter, (IO, bytes)): + _content = order_item_update_parameter + else: + _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") + + request = build_update_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("OrderItemResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + async def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: _models.OrderItemUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Update the properties of an existing order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_update_parameter: Order item update parameters from request body. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Update the properties of an existing order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_update_parameter: Order item update parameters from request body. Required. + :type order_item_update_parameter: IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Update the properties of an existing order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_update_parameter: Order item update parameters from request body. Is either a + OrderItemUpdateParameter type or a IO type. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemUpdateParameter or IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + order_item_update_parameter=order_item_update_parameter, + if_match=if_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OrderItemResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + async def cancel( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: _models.CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Cancel order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def cancel( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Cancel order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def cancel( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any + ) -> None: + """Cancel order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO type. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CancellationReason + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cancellation_reason, (IO, bytes)): + _content = cancellation_reason + else: + _json = self._serialize.body(cancellation_reason, "CancellationReason") + + request = build_cancel_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.cancel.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, 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.EdgeOrder/orderItems/{orderItemName}/cancel" + } + + async def _return_method_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(return_order_item_details, (IO, bytes)): + _content = return_order_item_details + else: + _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") + + request = build_return_method_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._return_method_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _return_method_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } + + @overload + async def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: _models.ReturnOrderItemDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Return order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param return_order_item_details: Return order item details. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReturnOrderItemDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + + @overload + async def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Return order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param return_order_item_details: Return order item details. Required. + :type return_order_item_details: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + + @distributed_trace_async + async def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Return order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param return_order_item_details: Return order item details. Is either a ReturnOrderItemDetails + type or a IO type. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReturnOrderItemDetails or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._return_method_initial( # type: ignore + resource_group_name=resource_group_name, + order_item_name=order_item_name, + return_order_item_details=return_order_item_details, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_return_method.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_orders_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_orders_operations.py new file mode 100644 index 000000000000..e05f7359e933 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_orders_operations.py @@ -0,0 +1,324 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._orders_operations import ( + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class OrdersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s + :attr:`orders` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription( + self, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.OrderResource"]: + """List orders at subscription level. + + :param skip_token: $skipToken is supported on Get list of orders, which provides the next page + in the list of orders. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_subscription.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OrderResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders"} + + @distributed_trace_async + async def get( + self, resource_group_name: str, location: str, order_name: str, **kwargs: Any + ) -> _models.OrderResource: + """Get an order. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of Azure region. Required. + :type location: str + :param order_name: The name of the order. Required. + :type order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrderResource or the result of cls(response) + :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + location=location, + order_name=order_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OrderResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" + } + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.OrderResource"]: + """List orders at resource group level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of orders, which provides the next page + in the list of orders. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OrderResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, 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.EdgeOrder/orders" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_products_and_configurations_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_products_and_configurations_operations.py new file mode 100644 index 000000000000..8725ecb54353 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_products_and_configurations_operations.py @@ -0,0 +1,500 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._products_and_configurations_operations import ( + build_list_configurations_request, + build_list_product_families_metadata_request, + build_list_product_families_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ProductsAndConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s + :attr:`products_and_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def list_configurations( + self, + configurations_request: _models.ConfigurationsRequest, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. + + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationsRequest + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_configurations( + self, + configurations_request: IO, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. + + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_configurations( + self, + configurations_request: Union[_models.ConfigurationsRequest, IO], + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. + + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO type. Required. + :type configurations_request: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationsRequest or IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configurations_request, (IO, bytes)): + _content = configurations_request + else: + _json = self._serialize.body(configurations_request, "ConfigurationsRequest") + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_configurations_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_configurations.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("Configurations", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_configurations.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" + } + + @overload + def list_product_families( + self, + product_families_request: _models.ProductFamiliesRequest, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.ProductFamily"]: + """List product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesRequest + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_product_families( + self, + product_families_request: IO, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.ProductFamily"]: + """List product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: IO + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_product_families( + self, + product_families_request: Union[_models.ProductFamiliesRequest, IO], + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ProductFamily"]: + """List product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO type. Required. + :type product_families_request: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesRequest or IO + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(product_families_request, (IO, bytes)): + _content = product_families_request + else: + _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_product_families_request( + subscription_id=self._config.subscription_id, + expand=expand, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_product_families.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ProductFamilies", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_product_families.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" + } + + @distributed_trace + def list_product_families_metadata( + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.ProductFamiliesMetadataDetails"]: + """List product families metadata for the given subscription. + + :param skip_token: $skipToken is supported on list of product families metadata, which provides + the next page in the list of product families metadata. Default value is None. + :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 ProductFamiliesMetadataDetails or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_product_families_metadata_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_product_families_metadata.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_product_families_metadata.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/__init__.py new file mode 100644 index 000000000000..a53a21a96a65 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/__init__.py @@ -0,0 +1,227 @@ +# 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 AdditionalConfiguration +from ._models_py3 import AddressDetails +from ._models_py3 import AddressProperties +from ._models_py3 import AddressResource +from ._models_py3 import AddressResourceList +from ._models_py3 import AddressUpdateParameter +from ._models_py3 import AvailabilityInformation +from ._models_py3 import BasicInformation +from ._models_py3 import BillingMeterDetails +from ._models_py3 import CancellationReason +from ._models_py3 import CategoryInformation +from ._models_py3 import ChildConfiguration +from ._models_py3 import ChildConfigurationFilter +from ._models_py3 import CommonProperties +from ._models_py3 import Configuration +from ._models_py3 import ConfigurationDeviceDetails +from ._models_py3 import ConfigurationFilter +from ._models_py3 import ConfigurationProperties +from ._models_py3 import Configurations +from ._models_py3 import ConfigurationsRequest +from ._models_py3 import ContactDetails +from ._models_py3 import CostInformation +from ._models_py3 import CustomerSubscriptionDetails +from ._models_py3 import CustomerSubscriptionRegisteredFeatures +from ._models_py3 import Description +from ._models_py3 import DeviceDetails +from ._models_py3 import Dimensions +from ._models_py3 import DisplayInfo +from ._models_py3 import EncryptionPreferences +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import FilterableProperty +from ._models_py3 import ForwardShippingDetails +from ._models_py3 import GroupedChildConfigurations +from ._models_py3 import HierarchyInformation +from ._models_py3 import ImageInformation +from ._models_py3 import Link +from ._models_py3 import ManagementResourcePreferences +from ._models_py3 import MeterDetails +from ._models_py3 import NotificationPreference +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import OrderItemDetails +from ._models_py3 import OrderItemResource +from ._models_py3 import OrderItemResourceList +from ._models_py3 import OrderItemUpdateParameter +from ._models_py3 import OrderResource +from ._models_py3 import OrderResourceList +from ._models_py3 import Pav2MeterDetails +from ._models_py3 import Preferences +from ._models_py3 import Product +from ._models_py3 import ProductDetails +from ._models_py3 import ProductFamilies +from ._models_py3 import ProductFamiliesMetadata +from ._models_py3 import ProductFamiliesMetadataDetails +from ._models_py3 import ProductFamiliesRequest +from ._models_py3 import ProductFamily +from ._models_py3 import ProductFamilyProperties +from ._models_py3 import ProductLine +from ._models_py3 import ProductLineProperties +from ._models_py3 import ProductProperties +from ._models_py3 import ProxyResource +from ._models_py3 import PurchaseMeterDetails +from ._models_py3 import Resource +from ._models_py3 import ResourceMoveRequest +from ._models_py3 import ResourceProviderDetails +from ._models_py3 import ReturnOrderItemDetails +from ._models_py3 import ReverseShippingDetails +from ._models_py3 import ShippingAddress +from ._models_py3 import Specification +from ._models_py3 import StageDetails +from ._models_py3 import SystemData +from ._models_py3 import TrackedResource +from ._models_py3 import TransportPreferences + +from ._edge_order_management_client_enums import ActionStatusEnum +from ._edge_order_management_client_enums import ActionType +from ._edge_order_management_client_enums import AddressType +from ._edge_order_management_client_enums import AddressValidationStatus +from ._edge_order_management_client_enums import AvailabilityStage +from ._edge_order_management_client_enums import BillingType +from ._edge_order_management_client_enums import ChargingType +from ._edge_order_management_client_enums import ChildConfigurationType +from ._edge_order_management_client_enums import CreatedByType +from ._edge_order_management_client_enums import DescriptionType +from ._edge_order_management_client_enums import DisabledReason +from ._edge_order_management_client_enums import DoubleEncryptionStatus +from ._edge_order_management_client_enums import FulfillmentType +from ._edge_order_management_client_enums import IdentificationType +from ._edge_order_management_client_enums import ImageType +from ._edge_order_management_client_enums import LengthHeightUnit +from ._edge_order_management_client_enums import LinkType +from ._edge_order_management_client_enums import MeteringType +from ._edge_order_management_client_enums import NotificationStageName +from ._edge_order_management_client_enums import OrderItemCancellationEnum +from ._edge_order_management_client_enums import OrderItemReturnEnum +from ._edge_order_management_client_enums import OrderItemType +from ._edge_order_management_client_enums import OrderMode +from ._edge_order_management_client_enums import Origin +from ._edge_order_management_client_enums import StageName +from ._edge_order_management_client_enums import StageStatus +from ._edge_order_management_client_enums import SupportedFilterTypes +from ._edge_order_management_client_enums import TransportShipmentTypes +from ._edge_order_management_client_enums import WeightMeasurementUnit +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AdditionalConfiguration", + "AddressDetails", + "AddressProperties", + "AddressResource", + "AddressResourceList", + "AddressUpdateParameter", + "AvailabilityInformation", + "BasicInformation", + "BillingMeterDetails", + "CancellationReason", + "CategoryInformation", + "ChildConfiguration", + "ChildConfigurationFilter", + "CommonProperties", + "Configuration", + "ConfigurationDeviceDetails", + "ConfigurationFilter", + "ConfigurationProperties", + "Configurations", + "ConfigurationsRequest", + "ContactDetails", + "CostInformation", + "CustomerSubscriptionDetails", + "CustomerSubscriptionRegisteredFeatures", + "Description", + "DeviceDetails", + "Dimensions", + "DisplayInfo", + "EncryptionPreferences", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "FilterableProperty", + "ForwardShippingDetails", + "GroupedChildConfigurations", + "HierarchyInformation", + "ImageInformation", + "Link", + "ManagementResourcePreferences", + "MeterDetails", + "NotificationPreference", + "Operation", + "OperationDisplay", + "OperationListResult", + "OrderItemDetails", + "OrderItemResource", + "OrderItemResourceList", + "OrderItemUpdateParameter", + "OrderResource", + "OrderResourceList", + "Pav2MeterDetails", + "Preferences", + "Product", + "ProductDetails", + "ProductFamilies", + "ProductFamiliesMetadata", + "ProductFamiliesMetadataDetails", + "ProductFamiliesRequest", + "ProductFamily", + "ProductFamilyProperties", + "ProductLine", + "ProductLineProperties", + "ProductProperties", + "ProxyResource", + "PurchaseMeterDetails", + "Resource", + "ResourceMoveRequest", + "ResourceProviderDetails", + "ReturnOrderItemDetails", + "ReverseShippingDetails", + "ShippingAddress", + "Specification", + "StageDetails", + "SystemData", + "TrackedResource", + "TransportPreferences", + "ActionStatusEnum", + "ActionType", + "AddressType", + "AddressValidationStatus", + "AvailabilityStage", + "BillingType", + "ChargingType", + "ChildConfigurationType", + "CreatedByType", + "DescriptionType", + "DisabledReason", + "DoubleEncryptionStatus", + "FulfillmentType", + "IdentificationType", + "ImageType", + "LengthHeightUnit", + "LinkType", + "MeteringType", + "NotificationStageName", + "OrderItemCancellationEnum", + "OrderItemReturnEnum", + "OrderItemType", + "OrderMode", + "Origin", + "StageName", + "StageStatus", + "SupportedFilterTypes", + "TransportShipmentTypes", + "WeightMeasurementUnit", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_edge_order_management_client_enums.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_edge_order_management_client_enums.py new file mode 100644 index 000000000000..4b162e190900 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_edge_order_management_client_enums.py @@ -0,0 +1,343 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class ActionStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes whether the order item is deletable or not.""" + + ALLOWED = "Allowed" + """Allowed flag.""" + NOT_ALLOWED = "NotAllowed" + """Not Allowed flag.""" + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" + + INTERNAL = "Internal" + + +class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address.""" + + NONE = "None" + """Address type not known.""" + RESIDENTIAL = "Residential" + """Residential Address.""" + COMMERCIAL = "Commercial" + """Commercial Address.""" + + +class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of address validation.""" + + VALID = "Valid" + """Address provided is valid.""" + INVALID = "Invalid" + """Address provided is invalid or not supported.""" + AMBIGUOUS = "Ambiguous" + """Address provided is ambiguous, please choose one of the alternate addresses returned.""" + + +class AvailabilityStage(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current availability stage of the product.""" + + AVAILABLE = "Available" + """Product is available.""" + PREVIEW = "Preview" + """Product is in preview.""" + SIGNUP = "Signup" + """Product is available only on signup.""" + DISCOVERABLE = "Discoverable" + """Product is not available in our service but can be discovered from other sources.""" + COMING_SOON = "ComingSoon" + """Product is coming soon.""" + UNAVAILABLE = "Unavailable" + """Product is not available.""" + DEPRECATED = "Deprecated" + """Product is deprecated.""" + + +class BillingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents billing type.""" + + PAV2 = "Pav2" + """PaV2 billing.""" + PURCHASE = "Purchase" + """Purchase billing.""" + + +class ChargingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Charging type.""" + + PER_ORDER = "PerOrder" + """Per order charging type.""" + PER_DEVICE = "PerDevice" + """Per device charging type.""" + + +class ChildConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """ChildConfigurationType.""" + + DEVICE_CONFIGURATION = "DeviceConfiguration" + """Child configuration is a device configuration.""" + ADDITIONAL_CONFIGURATION = "AdditionalConfiguration" + """Child configuration is an additional configuration.""" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class DescriptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of description.""" + + BASE = "Base" + """Base description.""" + + +class DisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Reason why the product is disabled.""" + + NONE = "None" + """Not disabled.""" + COUNTRY = "Country" + """Not available in the requested country.""" + REGION = "Region" + """Not available to push data to the requested Azure region.""" + FEATURE = "Feature" + """Required features are not enabled.""" + OFFER_TYPE = "OfferType" + """Subscription does not have required offer types.""" + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription + #: notification.""" + NOT_AVAILABLE = "NotAvailable" + """The product is not yet available.""" + OUT_OF_STOCK = "OutOfStock" + """The product is out of stock.""" + + +class DoubleEncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Double encryption status as entered by the customer. It is compulsory to give this parameter if + the 'Deny' or 'Disabled' policy is configured. + """ + + DISABLED = "Disabled" + """Double encryption is disabled.""" + ENABLED = "Enabled" + """Double encryption is enabled.""" + + +class FulfillmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The entity responsible for fulfillment of the item at the given hierarchy level.""" + + MICROSOFT = "Microsoft" + """The fulfillment (the whole journey of the product offering) is handled by microsoft.""" + EXTERNAL = "External" + """The fulfillment (the whole journey of the product offering) is handled by external third party + #: entities.""" + + +class IdentificationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identification type of the configuration.""" + + NOT_SUPPORTED = "NotSupported" + """Product does not have any explicit identifier.""" + SERIAL_NUMBER = "SerialNumber" + """Product is identifiable by serial number.""" + + +class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the image.""" + + MAIN_IMAGE = "MainImage" + """Main image.""" + BULLET_IMAGE = "BulletImage" + """Bullet image.""" + GENERIC_IMAGE = "GenericImage" + """Generic image.""" + + +class LengthHeightUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Unit for the dimensions of length, height and width.""" + + IN = "IN" + """Inch, applicable for West US.""" + CM = "CM" + """Centimeter.""" + + +class LinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of link.""" + + GENERIC = "Generic" + """Generic link.""" + TERMS_AND_CONDITIONS = "TermsAndConditions" + """Terms and conditions link.""" + SPECIFICATION = "Specification" + """Link to product specification.""" + DOCUMENTATION = "Documentation" + """Link to product documentation.""" + KNOW_MORE = "KnowMore" + """Link to know more.""" + SIGN_UP = "SignUp" + """Link to sign up for products.""" + DISCOVERABLE = "Discoverable" + """Link to order the product from another source and not from Azure Edge Hardware Center.""" + + +class MeteringType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents Metering type (eg one-time or recurrent).""" + + ONE_TIME = "OneTime" + """One time billing.""" + RECURRING = "Recurring" + """Recurring billing.""" + ADHOC = "Adhoc" + """Adhoc billing.""" + + +class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of the stage.""" + + SHIPPED = "Shipped" + """Notification at order item shipped from microsoft datacenter.""" + DELIVERED = "Delivered" + """Notification at order item delivered to customer.""" + + +class OrderItemCancellationEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes whether the order item is cancellable or not.""" + + CANCELLABLE = "Cancellable" + """Order item can be cancelled without fee.""" + CANCELLABLE_WITH_FEE = "CancellableWithFee" + """Order item can be cancelled with fee.""" + NOT_CANCELLABLE = "NotCancellable" + """Order item not cancellable.""" + + +class OrderItemReturnEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes whether the order item is returnable or not.""" + + RETURNABLE = "Returnable" + """Order item can be returned without fee.""" + RETURNABLE_WITH_FEE = "ReturnableWithFee" + """Order item can be returned with fee.""" + NOT_RETURNABLE = "NotReturnable" + """Order item not returnable.""" + + +class OrderItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Order item type.""" + + PURCHASE = "Purchase" + """Purchase OrderItem.""" + RENTAL = "Rental" + """Rental OrderItem.""" + + +class OrderMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the mode of the Order item.""" + + DEFAULT = "Default" + """Default Order mode.""" + DO_NOT_FULFILL = "DoNotFulfill" + """Mode in which the Order will not be fulfilled.""" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system". + """ + + USER = "user" + SYSTEM = "system" + USER_SYSTEM = "user,system" + + +class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Stage name.""" + + PLACED = "Placed" + """Currently in draft mode and can still be cancelled.""" + IN_REVIEW = "InReview" + """Order is currently in draft mode and can still be cancelled.""" + CONFIRMED = "Confirmed" + """Order is confirmed.""" + READY_TO_SHIP = "ReadyToShip" + """Order is ready to ship.""" + SHIPPED = "Shipped" + """Order is in transit to customer.""" + DELIVERED = "Delivered" + """Order is delivered to customer.""" + IN_USE = "InUse" + """Order is in use at customer site.""" + RETURN_INITIATED = "ReturnInitiated" + """Return has been initiated by customer.""" + RETURN_PICKED_UP = "ReturnPickedUp" + """Order is in transit from customer to Microsoft.""" + RETURNED_TO_MICROSOFT = "ReturnedToMicrosoft" + """Order has been received back to Microsoft.""" + RETURN_COMPLETED = "ReturnCompleted" + """Return has now completed.""" + CANCELLED = "Cancelled" + """Order has been cancelled.""" + + +class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Stage status.""" + + 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.""" + + +class SupportedFilterTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of product filter.""" + + SHIP_TO_COUNTRIES = "ShipToCountries" + """Ship to country.""" + DOUBLE_ENCRYPTION_STATUS = "DoubleEncryptionStatus" + """Double encryption status.""" + + +class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates Shipment Logistics type that the customer preferred.""" + + CUSTOMER_MANAGED = "CustomerManaged" + """Shipment Logistics is handled by the customer.""" + MICROSOFT_MANAGED = "MicrosoftManaged" + """Shipment Logistics is handled by Microsoft.""" + + +class WeightMeasurementUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Unit for the dimensions of weight.""" + + LBS = "LBS" + """Pounds.""" + KGS = "KGS" + """Kilograms.""" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_models_py3.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..e17f94798176 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_models_py3.py @@ -0,0 +1,3656 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# 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, TYPE_CHECKING, Union + +from ... import _serialization + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class AdditionalConfiguration(_serialization.Model): + """Additional Configuration details. + + All required parameters must be populated in order to send to Azure. + + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the + configuration. Required. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar quantity: Quantity of the product. Required. + :vartype quantity: int + """ + + _validation = { + "hierarchy_information": {"required": True}, + "quantity": {"required": True}, + } + + _attribute_map = { + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "quantity": {"key": "quantity", "type": "int"}, + } + + def __init__(self, *, hierarchy_information: "_models.HierarchyInformation", quantity: int, **kwargs: Any) -> None: + """ + :keyword hierarchy_information: Hierarchy of the product which uniquely identifies the + configuration. Required. + :paramtype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :keyword quantity: Quantity of the product. Required. + :paramtype quantity: int + """ + super().__init__(**kwargs) + self.hierarchy_information = hierarchy_information + self.quantity = quantity + + +class AddressDetails(_serialization.Model): + """Address details for an order item. + + 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 forward_address: Customer address and contact details. Required. + :vartype forward_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties + :ivar return_address: Return shipping address. + :vartype return_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties + """ + + _validation = { + "forward_address": {"required": True}, + "return_address": {"readonly": True}, + } + + _attribute_map = { + "forward_address": {"key": "forwardAddress", "type": "AddressProperties"}, + "return_address": {"key": "returnAddress", "type": "AddressProperties"}, + } + + def __init__(self, *, forward_address: "_models.AddressProperties", **kwargs: Any) -> None: + """ + :keyword forward_address: Customer address and contact details. Required. + :paramtype forward_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties + """ + super().__init__(**kwargs) + self.forward_address = forward_address + self.return_address = None + + +class AddressProperties(_serialization.Model): + """Address Properties. + + 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 shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress + :ivar contact_details: Contact details for the address. Required. + :vartype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails + :ivar address_validation_status: Status of address validation. Known values are: "Valid", + "Invalid", and "Ambiguous". + :vartype address_validation_status: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressValidationStatus + """ + + _validation = { + "contact_details": {"required": True}, + "address_validation_status": {"readonly": True}, + } + + _attribute_map = { + "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, + "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, + "address_validation_status": {"key": "addressValidationStatus", "type": "str"}, + } + + def __init__( + self, + *, + contact_details: "_models.ContactDetails", + shipping_address: Optional["_models.ShippingAddress"] = None, + **kwargs: Any + ) -> None: + """ + :keyword shipping_address: Shipping details for the address. + :paramtype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress + :keyword contact_details: Contact details for the address. Required. + :paramtype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails + """ + super().__init__(**kwargs) + self.shipping_address = shipping_address + self.contact_details = contact_details + self.address_validation_status = None + + +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a '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 id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + """ + super().__init__(**kwargs) + self.tags = tags + self.location = location + + +class AddressResource(TrackedResource): + """Address 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 id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar system_data: Represents resource creation and update time. + :vartype system_data: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SystemData + :ivar shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress + :ivar contact_details: Contact details for the address. Required. + :vartype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails + :ivar address_validation_status: Status of address validation. Known values are: "Valid", + "Invalid", and "Ambiguous". + :vartype address_validation_status: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressValidationStatus + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, + "system_data": {"readonly": True}, + "contact_details": {"required": True}, + "address_validation_status": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, + "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, + "address_validation_status": {"key": "properties.addressValidationStatus", "type": "str"}, + } + + def __init__( + self, + *, + location: str, + contact_details: "_models.ContactDetails", + tags: Optional[Dict[str, str]] = None, + shipping_address: Optional["_models.ShippingAddress"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword shipping_address: Shipping details for the address. + :paramtype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress + :keyword contact_details: Contact details for the address. Required. + :paramtype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails + """ + super().__init__(tags=tags, location=location, **kwargs) + self.system_data = None + self.shipping_address = shipping_address + self.contact_details = contact_details + self.address_validation_status = None + + +class AddressResourceList(_serialization.Model): + """Address Resource Collection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of address resources. + :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :ivar next_link: Link for the next set of job resources. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[AddressResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of job resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class AddressUpdateParameter(_serialization.Model): + """The Address update parameters. + + :ivar 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 shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress + :ivar contact_details: Contact details for the address. + :vartype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, + "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + shipping_address: Optional["_models.ShippingAddress"] = None, + contact_details: Optional["_models.ContactDetails"] = None, + **kwargs: Any + ) -> None: + """ + :keyword 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 shipping_address: Shipping details for the address. + :paramtype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress + :keyword contact_details: Contact details for the address. + :paramtype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails + """ + super().__init__(**kwargs) + self.tags = tags + self.shipping_address = shipping_address + self.contact_details = contact_details + + +class AvailabilityInformation(_serialization.Model): + """Availability information of a product system. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar availability_stage: Current availability stage of the product. Known values are: + "Available", "Preview", "Signup", "Discoverable", "ComingSoon", "Unavailable", and + "Deprecated". + :vartype availability_stage: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityStage + :ivar disabled_reason: Reason why the product is disabled. Known values are: "None", "Country", + "Region", "Feature", "OfferType", "NoSubscriptionInfo", "NotAvailable", and "OutOfStock". + :vartype disabled_reason: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisabledReason + :ivar disabled_reason_message: Message for why the product is disabled. + :vartype disabled_reason_message: str + """ + + _validation = { + "availability_stage": {"readonly": True}, + "disabled_reason": {"readonly": True}, + "disabled_reason_message": {"readonly": True}, + } + + _attribute_map = { + "availability_stage": {"key": "availabilityStage", "type": "str"}, + "disabled_reason": {"key": "disabledReason", "type": "str"}, + "disabled_reason_message": {"key": "disabledReasonMessage", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.availability_stage = None + self.disabled_reason = None + self.disabled_reason_message = None + + +class BasicInformation(_serialization.Model): + """Basic information for any product system. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.display_name = None + self.description = None + self.image_information = None + self.cost_information = None + self.availability_information = None + self.hierarchy_information = None + self.fulfilled_by = None + + +class BillingMeterDetails(_serialization.Model): + """Holds billing meter details for each type of billing. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Represents Billing type name. + :vartype name: str + :ivar meter_details: Represents MeterDetails. + :vartype meter_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.MeterDetails + :ivar metering_type: Represents Metering type (eg one-time or recurrent). Known values are: + "OneTime", "Recurring", and "Adhoc". + :vartype metering_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.MeteringType + :ivar frequency: Frequency of recurrence. + :vartype frequency: str + """ + + _validation = { + "name": {"readonly": True}, + "meter_details": {"readonly": True}, + "metering_type": {"readonly": True}, + "frequency": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "meter_details": {"key": "meterDetails", "type": "MeterDetails"}, + "metering_type": {"key": "meteringType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.meter_details = None + self.metering_type = None + self.frequency = None + + +class CancellationReason(_serialization.Model): + """Reason for cancellation. + + All required parameters must be populated in order to send to Azure. + + :ivar reason: Reason for cancellation. Required. + :vartype reason: str + """ + + _validation = { + "reason": {"required": True}, + } + + _attribute_map = { + "reason": {"key": "reason", "type": "str"}, + } + + def __init__(self, *, reason: str, **kwargs: Any) -> None: + """ + :keyword reason: Reason for cancellation. Required. + :paramtype reason: str + """ + super().__init__(**kwargs) + self.reason = reason + + +class CategoryInformation(_serialization.Model): + """Category related properties of a child configuration. + + :ivar category_name: Category name of the child configuration. + :vartype category_name: str + :ivar category_display_name: Category display name of the child configuration. + :vartype category_display_name: str + :ivar description: Description text for the category. + :vartype description: str + :ivar links: Links for the category. + :vartype links: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Link] + """ + + _attribute_map = { + "category_name": {"key": "categoryName", "type": "str"}, + "category_display_name": {"key": "categoryDisplayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "links": {"key": "links", "type": "[Link]"}, + } + + def __init__( + self, + *, + category_name: Optional[str] = None, + category_display_name: Optional[str] = None, + description: Optional[str] = None, + links: Optional[List["_models.Link"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword category_name: Category name of the child configuration. + :paramtype category_name: str + :keyword category_display_name: Category display name of the child configuration. + :paramtype category_display_name: str + :keyword description: Description text for the category. + :paramtype description: str + :keyword links: Links for the category. + :paramtype links: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Link] + """ + super().__init__(**kwargs) + self.category_name = category_name + self.category_display_name = category_display_name + self.description = description + self.links = links + + +class ChildConfiguration(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Child configuration object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar child_configuration_type: Child configuration type. Known values are: + "DeviceConfiguration" and "AdditionalConfiguration". + :vartype child_configuration_type: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType + :ivar is_part_of_base_configuration: Flag to indicate if the child configuration is part of the + base configuration, which means the customer need not pass this configuration in + OptInAdditionalConfigurations while placing an order, it will be shipped by default. + :vartype is_part_of_base_configuration: bool + :ivar minimum_quantity: Minimum quantity a customer can order while choosing this + configuration. + :vartype minimum_quantity: int + :ivar maximum_quantity: Maximum quantity a customer can order while choosing this + configuration. + :vartype maximum_quantity: int + :ivar specifications: Specifications of the configuration. + :vartype specifications: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Specification] + :ivar dimensions: Dimensions of the configuration. + :vartype dimensions: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Dimensions + :ivar child_configuration_types: Different types of child configurations which exist for this + configuration, these can be used to populate the child configuration filter. + :vartype child_configuration_types: list[str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] + :ivar grouped_child_configurations: Child configurations present for the configuration after + applying child configuration filter, grouped by the category name of the child configuration. + :vartype grouped_child_configurations: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.GroupedChildConfigurations] + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + """ + + _validation = { + "child_configuration_type": {"readonly": True}, + "is_part_of_base_configuration": {"readonly": True}, + "minimum_quantity": {"readonly": True}, + "maximum_quantity": {"readonly": True}, + "specifications": {"readonly": True}, + "dimensions": {"readonly": True}, + "child_configuration_types": {"readonly": True}, + "grouped_child_configurations": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + } + + _attribute_map = { + "child_configuration_type": {"key": "properties.childConfigurationType", "type": "str"}, + "is_part_of_base_configuration": {"key": "properties.isPartOfBaseConfiguration", "type": "bool"}, + "minimum_quantity": {"key": "properties.minimumQuantity", "type": "int"}, + "maximum_quantity": {"key": "properties.maximumQuantity", "type": "int"}, + "specifications": {"key": "properties.specifications", "type": "[Specification]"}, + "dimensions": {"key": "properties.dimensions", "type": "Dimensions"}, + "child_configuration_types": {"key": "properties.childConfigurationTypes", "type": "[str]"}, + "grouped_child_configurations": { + "key": "properties.groupedChildConfigurations", + "type": "[GroupedChildConfigurations]", + }, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.child_configuration_type = None + self.is_part_of_base_configuration = None + self.minimum_quantity = None + self.maximum_quantity = None + self.specifications = None + self.dimensions = None + self.child_configuration_types = None + self.grouped_child_configurations = None + self.filterable_properties = None + self.display_name = None + self.description = None + self.image_information = None + self.cost_information = None + self.availability_information = None + self.hierarchy_information = None + self.fulfilled_by = None + + +class ChildConfigurationFilter(_serialization.Model): + """Child configuration filter. + + :ivar hierarchy_informations: The list of child configuration hierarchy customer wants to + filter for the given configuration. + :vartype hierarchy_informations: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation] + :ivar child_configuration_types: Filter to fetch all child configurations belonging to the + given list of configuration types. + :vartype child_configuration_types: list[str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] + """ + + _attribute_map = { + "hierarchy_informations": {"key": "hierarchyInformations", "type": "[HierarchyInformation]"}, + "child_configuration_types": {"key": "childConfigurationTypes", "type": "[str]"}, + } + + def __init__( + self, + *, + hierarchy_informations: Optional[List["_models.HierarchyInformation"]] = None, + child_configuration_types: Optional[List[Union[str, "_models.ChildConfigurationType"]]] = None, + **kwargs: Any + ) -> None: + """ + :keyword hierarchy_informations: The list of child configuration hierarchy customer wants to + filter for the given configuration. + :paramtype hierarchy_informations: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation] + :keyword child_configuration_types: Filter to fetch all child configurations belonging to the + given list of configuration types. + :paramtype child_configuration_types: list[str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] + """ + super().__init__(**kwargs) + self.hierarchy_informations = hierarchy_informations + self.child_configuration_types = child_configuration_types + + +class CommonProperties(BasicInformation): + """Represents common properties across product hierarchy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.filterable_properties = None + + +class Configuration(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Configuration object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar specifications: Specifications of the configuration. + :vartype specifications: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Specification] + :ivar dimensions: Dimensions of the configuration. + :vartype dimensions: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Dimensions + :ivar child_configuration_types: Different types of child configurations which exist for this + configuration, these can be used to populate the child configuration filter. + :vartype child_configuration_types: list[str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] + :ivar grouped_child_configurations: Child configurations present for the configuration after + applying child configuration filter, grouped by the category name of the child configuration. + :vartype grouped_child_configurations: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.GroupedChildConfigurations] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "specifications": {"readonly": True}, + "dimensions": {"readonly": True}, + "child_configuration_types": {"readonly": True}, + "grouped_child_configurations": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "specifications": {"key": "properties.specifications", "type": "[Specification]"}, + "dimensions": {"key": "properties.dimensions", "type": "Dimensions"}, + "child_configuration_types": {"key": "properties.childConfigurationTypes", "type": "[str]"}, + "grouped_child_configurations": { + "key": "properties.groupedChildConfigurations", + "type": "[GroupedChildConfigurations]", + }, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.display_name = None + self.description = None + self.image_information = None + self.cost_information = None + self.availability_information = None + self.hierarchy_information = None + self.fulfilled_by = None + self.filterable_properties = None + self.specifications = None + self.dimensions = None + self.child_configuration_types = None + self.grouped_child_configurations = None + + +class ConfigurationDeviceDetails(_serialization.Model): + """Device details for configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_info: Display details of the product. + :vartype display_info: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisplayInfo + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the + configuration. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar quantity: Quantity of the product. + :vartype quantity: int + :ivar identification_type: Identification type of the configuration. Known values are: + "NotSupported" and "SerialNumber". + :vartype identification_type: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.IdentificationType + :ivar device_details: List of device details. + :vartype device_details: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.DeviceDetails] + """ + + _validation = { + "hierarchy_information": {"readonly": True}, + "quantity": {"readonly": True}, + "identification_type": {"readonly": True}, + "device_details": {"readonly": True}, + } + + _attribute_map = { + "display_info": {"key": "displayInfo", "type": "DisplayInfo"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "quantity": {"key": "quantity", "type": "int"}, + "identification_type": {"key": "identificationType", "type": "str"}, + "device_details": {"key": "deviceDetails", "type": "[DeviceDetails]"}, + } + + def __init__(self, *, display_info: Optional["_models.DisplayInfo"] = None, **kwargs: Any) -> None: + """ + :keyword display_info: Display details of the product. + :paramtype display_info: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisplayInfo + """ + super().__init__(**kwargs) + self.display_info = display_info + self.hierarchy_information = None + self.quantity = None + self.identification_type = None + self.device_details = None + + +class ConfigurationFilter(_serialization.Model): + """Configuration filters. + + All required parameters must be populated in order to send to Azure. + + :ivar hierarchy_information: Product hierarchy information. Required. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar filterable_property: Filters specific to product. + :vartype filterable_property: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar child_configuration_filter: Filter to fetch specific child configurations that exist in + the configuration. This must be passed to either fetch a list of specific child configurations, + or all child configurations of specific types of child configurations. + :vartype child_configuration_filter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationFilter + """ + + _validation = { + "hierarchy_information": {"required": True}, + } + + _attribute_map = { + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "filterable_property": {"key": "filterableProperty", "type": "[FilterableProperty]"}, + "child_configuration_filter": {"key": "childConfigurationFilter", "type": "ChildConfigurationFilter"}, + } + + def __init__( + self, + *, + hierarchy_information: "_models.HierarchyInformation", + filterable_property: Optional[List["_models.FilterableProperty"]] = None, + child_configuration_filter: Optional["_models.ChildConfigurationFilter"] = None, + **kwargs: Any + ) -> None: + """ + :keyword hierarchy_information: Product hierarchy information. Required. + :paramtype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :keyword filterable_property: Filters specific to product. + :paramtype filterable_property: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :keyword child_configuration_filter: Filter to fetch specific child configurations that exist + in the configuration. This must be passed to either fetch a list of specific child + configurations, or all child configurations of specific types of child configurations. + :paramtype child_configuration_filter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationFilter + """ + super().__init__(**kwargs) + self.hierarchy_information = hierarchy_information + self.filterable_property = filterable_property + self.child_configuration_filter = child_configuration_filter + + +class ConfigurationProperties(CommonProperties): # pylint: disable=too-many-instance-attributes + """Properties of configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar specifications: Specifications of the configuration. + :vartype specifications: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Specification] + :ivar dimensions: Dimensions of the configuration. + :vartype dimensions: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Dimensions + :ivar child_configuration_types: Different types of child configurations which exist for this + configuration, these can be used to populate the child configuration filter. + :vartype child_configuration_types: list[str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] + :ivar grouped_child_configurations: Child configurations present for the configuration after + applying child configuration filter, grouped by the category name of the child configuration. + :vartype grouped_child_configurations: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.GroupedChildConfigurations] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "specifications": {"readonly": True}, + "dimensions": {"readonly": True}, + "child_configuration_types": {"readonly": True}, + "grouped_child_configurations": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "specifications": {"key": "specifications", "type": "[Specification]"}, + "dimensions": {"key": "dimensions", "type": "Dimensions"}, + "child_configuration_types": {"key": "childConfigurationTypes", "type": "[str]"}, + "grouped_child_configurations": {"key": "groupedChildConfigurations", "type": "[GroupedChildConfigurations]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.specifications = None + self.dimensions = None + self.child_configuration_types = None + self.grouped_child_configurations = None + + +class Configurations(_serialization.Model): + """The list of configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of configurations. + :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] + :ivar next_link: Link for the next set of configurations. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Configuration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of configurations. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class ConfigurationsRequest(_serialization.Model): + """Configuration request object. + + :ivar configuration_filter: Holds details about product hierarchy information and filterable + property. + :vartype configuration_filter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationFilter + :ivar customer_subscription_details: Customer subscription properties. Clients can display + available products to unregistered customers by explicitly passing subscription details. + :vartype customer_subscription_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionDetails + """ + + _attribute_map = { + "configuration_filter": {"key": "configurationFilter", "type": "ConfigurationFilter"}, + "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, + } + + def __init__( + self, + *, + configuration_filter: Optional["_models.ConfigurationFilter"] = None, + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, + **kwargs: Any + ) -> None: + """ + :keyword configuration_filter: Holds details about product hierarchy information and filterable + property. + :paramtype configuration_filter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationFilter + :keyword customer_subscription_details: Customer subscription properties. Clients can display + available products to unregistered customers by explicitly passing subscription details. + :paramtype customer_subscription_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionDetails + """ + super().__init__(**kwargs) + self.configuration_filter = configuration_filter + self.customer_subscription_details = customer_subscription_details + + +class ContactDetails(_serialization.Model): + """Contact Details. + + All required parameters must be populated in order to send to Azure. + + :ivar contact_name: Contact name of the person. Required. + :vartype contact_name: str + :ivar phone: Phone number of the contact person. Required. + :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: List of Email-ids to be notified about job progress. Required. + :vartype email_list: list[str] + """ + + _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]"}, + } + + def __init__( + self, + *, + contact_name: str, + phone: str, + email_list: List[str], + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword contact_name: Contact name of the person. Required. + :paramtype contact_name: str + :keyword phone: Phone number of the contact person. Required. + :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: List of Email-ids to be notified about job progress. Required. + :paramtype email_list: list[str] + """ + super().__init__(**kwargs) + self.contact_name = contact_name + self.phone = phone + self.phone_extension = phone_extension + self.mobile = mobile + self.email_list = email_list + + +class CostInformation(_serialization.Model): + """Cost information for the product system. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar billing_meter_details: Details on the various billing aspects for the product system. + :vartype billing_meter_details: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.BillingMeterDetails] + :ivar billing_info_url: Default url to display billing information. + :vartype billing_info_url: str + """ + + _validation = { + "billing_meter_details": {"readonly": True}, + "billing_info_url": {"readonly": True}, + } + + _attribute_map = { + "billing_meter_details": {"key": "billingMeterDetails", "type": "[BillingMeterDetails]"}, + "billing_info_url": {"key": "billingInfoUrl", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_meter_details = None + self.billing_info_url = None + + +class CustomerSubscriptionDetails(_serialization.Model): + """Holds Customer subscription details. Clients can display available products to unregistered + customers by explicitly passing subscription details. + + All required parameters must be populated in order to send to Azure. + + :ivar registered_features: List of registered feature flags for subscription. + :vartype registered_features: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionRegisteredFeatures] + :ivar location_placement_id: Location placement Id of a subscription. + :vartype location_placement_id: str + :ivar quota_id: Quota ID of a subscription. Required. + :vartype quota_id: str + """ + + _validation = { + "quota_id": {"required": True}, + } + + _attribute_map = { + "registered_features": {"key": "registeredFeatures", "type": "[CustomerSubscriptionRegisteredFeatures]"}, + "location_placement_id": {"key": "locationPlacementId", "type": "str"}, + "quota_id": {"key": "quotaId", "type": "str"}, + } + + def __init__( + self, + *, + quota_id: str, + registered_features: Optional[List["_models.CustomerSubscriptionRegisteredFeatures"]] = None, + location_placement_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword registered_features: List of registered feature flags for subscription. + :paramtype registered_features: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionRegisteredFeatures] + :keyword location_placement_id: Location placement Id of a subscription. + :paramtype location_placement_id: str + :keyword quota_id: Quota ID of a subscription. Required. + :paramtype quota_id: str + """ + super().__init__(**kwargs) + self.registered_features = registered_features + self.location_placement_id = location_placement_id + self.quota_id = quota_id + + +class CustomerSubscriptionRegisteredFeatures(_serialization.Model): + """Represents subscription registered features. + + :ivar name: Name of subscription registered feature. + :vartype name: str + :ivar state: State of subscription registered feature. + :vartype state: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "state": {"key": "state", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, state: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of subscription registered feature. + :paramtype name: str + :keyword state: State of subscription registered feature. + :paramtype state: str + """ + super().__init__(**kwargs) + self.name = name + self.state = state + + +class Description(_serialization.Model): + """Description related properties of a product system. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar description_type: Type of description. "Base" + :vartype description_type: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DescriptionType + :ivar short_description: Short description of the product system. + :vartype short_description: str + :ivar long_description: Long description of the product system. + :vartype long_description: str + :ivar keywords: Keywords for the product system. + :vartype keywords: list[str] + :ivar attributes: Attributes for the product system. + :vartype attributes: list[str] + :ivar links: Links for the product system. + :vartype links: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Link] + """ + + _validation = { + "description_type": {"readonly": True}, + "short_description": {"readonly": True}, + "long_description": {"readonly": True}, + "keywords": {"readonly": True}, + "attributes": {"readonly": True}, + "links": {"readonly": True}, + } + + _attribute_map = { + "description_type": {"key": "descriptionType", "type": "str"}, + "short_description": {"key": "shortDescription", "type": "str"}, + "long_description": {"key": "longDescription", "type": "str"}, + "keywords": {"key": "keywords", "type": "[str]"}, + "attributes": {"key": "attributes", "type": "[str]"}, + "links": {"key": "links", "type": "[Link]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.description_type = None + self.short_description = None + self.long_description = None + self.keywords = None + self.attributes = None + self.links = None + + +class DeviceDetails(_serialization.Model): + """Device details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar serial_number: Device serial number. + :vartype serial_number: str + :ivar management_resource_id: Management Resource Id. + :vartype management_resource_id: str + :ivar management_resource_tenant_id: Management Resource Tenant ID. + :vartype management_resource_tenant_id: str + """ + + _validation = { + "serial_number": {"readonly": True}, + "management_resource_id": {"readonly": True}, + "management_resource_tenant_id": {"readonly": True}, + } + + _attribute_map = { + "serial_number": {"key": "serialNumber", "type": "str"}, + "management_resource_id": {"key": "managementResourceId", "type": "str"}, + "management_resource_tenant_id": {"key": "managementResourceTenantId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.serial_number = None + self.management_resource_id = None + self.management_resource_tenant_id = None + + +class Dimensions(_serialization.Model): + """Dimensions of a configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar length: Length of the device. + :vartype length: float + :ivar height: Height of the device. + :vartype height: float + :ivar width: Width of the device. + :vartype width: float + :ivar length_height_unit: Unit for the dimensions of length, height and width. Known values + are: "IN" and "CM". + :vartype length_height_unit: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.LengthHeightUnit + :ivar weight: Weight of the device. + :vartype weight: float + :ivar depth: Depth of the device. + :vartype depth: float + :ivar weight_unit: Unit for the dimensions of weight. Known values are: "LBS" and "KGS". + :vartype weight_unit: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.WeightMeasurementUnit + """ + + _validation = { + "length": {"readonly": True}, + "height": {"readonly": True}, + "width": {"readonly": True}, + "length_height_unit": {"readonly": True}, + "weight": {"readonly": True}, + "depth": {"readonly": True}, + "weight_unit": {"readonly": True}, + } + + _attribute_map = { + "length": {"key": "length", "type": "float"}, + "height": {"key": "height", "type": "float"}, + "width": {"key": "width", "type": "float"}, + "length_height_unit": {"key": "lengthHeightUnit", "type": "str"}, + "weight": {"key": "weight", "type": "float"}, + "depth": {"key": "depth", "type": "float"}, + "weight_unit": {"key": "weightUnit", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.length = None + self.height = None + self.width = None + self.length_height_unit = None + self.weight = None + self.depth = None + self.weight_unit = None + + +class DisplayInfo(_serialization.Model): + """Describes product display information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar product_family_display_name: Product family display name. + :vartype product_family_display_name: str + :ivar configuration_display_name: Configuration display name. + :vartype configuration_display_name: str + """ + + _validation = { + "product_family_display_name": {"readonly": True}, + "configuration_display_name": {"readonly": True}, + } + + _attribute_map = { + "product_family_display_name": {"key": "productFamilyDisplayName", "type": "str"}, + "configuration_display_name": {"key": "configurationDisplayName", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.product_family_display_name = None + self.configuration_display_name = None + + +class EncryptionPreferences(_serialization.Model): + """Preferences related to the double encryption. + + :ivar double_encryption_status: Double encryption status as entered by the customer. It is + compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known + values are: "Disabled" and "Enabled". + :vartype double_encryption_status: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DoubleEncryptionStatus + """ + + _attribute_map = { + "double_encryption_status": {"key": "doubleEncryptionStatus", "type": "str"}, + } + + def __init__( + self, *, double_encryption_status: Optional[Union[str, "_models.DoubleEncryptionStatus"]] = None, **kwargs: Any + ) -> None: + """ + :keyword double_encryption_status: Double encryption status as entered by the customer. It is + compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known + values are: "Disabled" and "Enabled". + :paramtype double_encryption_status: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DoubleEncryptionStatus + """ + super().__init__(**kwargs) + self.double_encryption_status = double_encryption_status + + +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: JSON + """ + + _validation = { + "type": {"readonly": True}, + "info": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "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": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class FilterableProperty(_serialization.Model): + """Different types of filters supported and its values. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Type of product filter. Required. Known values are: "ShipToCountries" and + "DoubleEncryptionStatus". + :vartype type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SupportedFilterTypes + :ivar supported_values: Values to be filtered. Required. + :vartype supported_values: list[str] + """ + + _validation = { + "type": {"required": True}, + "supported_values": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "supported_values": {"key": "supportedValues", "type": "[str]"}, + } + + def __init__( + self, *, type: Union[str, "_models.SupportedFilterTypes"], supported_values: List[str], **kwargs: Any + ) -> None: + """ + :keyword type: Type of product filter. Required. Known values are: "ShipToCountries" and + "DoubleEncryptionStatus". + :paramtype type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SupportedFilterTypes + :keyword supported_values: Values to be filtered. Required. + :paramtype supported_values: list[str] + """ + super().__init__(**kwargs) + self.type = type + self.supported_values = supported_values + + +class ForwardShippingDetails(_serialization.Model): + """Forward shipment 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 carrier_display_name: Carrier Name for display purpose. Not to be used for any + processing. + :vartype carrier_display_name: str + :ivar tracking_id: TrackingId of the package. + :vartype tracking_id: str + :ivar tracking_url: TrackingUrl of the package. + :vartype tracking_url: str + """ + + _validation = { + "carrier_name": {"readonly": True}, + "carrier_display_name": {"readonly": True}, + "tracking_id": {"readonly": True}, + "tracking_url": {"readonly": True}, + } + + _attribute_map = { + "carrier_name": {"key": "carrierName", "type": "str"}, + "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.carrier_name = None + self.carrier_display_name = None + self.tracking_id = None + self.tracking_url = None + + +class GroupedChildConfigurations(_serialization.Model): + """Grouped child configuration object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar category_information: Category information. + :vartype category_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CategoryInformation + :ivar child_configurations: List of child configurations. + :vartype child_configurations: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfiguration] + """ + + _validation = { + "category_information": {"readonly": True}, + "child_configurations": {"readonly": True}, + } + + _attribute_map = { + "category_information": {"key": "categoryInformation", "type": "CategoryInformation"}, + "child_configurations": {"key": "childConfigurations", "type": "[ChildConfiguration]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.category_information = None + self.child_configurations = None + + +class HierarchyInformation(_serialization.Model): + """Holds details about product hierarchy information. + + :ivar product_family_name: Represents product family name that uniquely identifies product + family. + :vartype product_family_name: str + :ivar product_line_name: Represents product line name that uniquely identifies product line. + :vartype product_line_name: str + :ivar product_name: Represents product name that uniquely identifies product. + :vartype product_name: str + :ivar configuration_name: Represents configuration name that uniquely identifies configuration. + :vartype configuration_name: str + """ + + _attribute_map = { + "product_family_name": {"key": "productFamilyName", "type": "str"}, + "product_line_name": {"key": "productLineName", "type": "str"}, + "product_name": {"key": "productName", "type": "str"}, + "configuration_name": {"key": "configurationName", "type": "str"}, + } + + def __init__( + self, + *, + product_family_name: Optional[str] = None, + product_line_name: Optional[str] = None, + product_name: Optional[str] = None, + configuration_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword product_family_name: Represents product family name that uniquely identifies product + family. + :paramtype product_family_name: str + :keyword product_line_name: Represents product line name that uniquely identifies product line. + :paramtype product_line_name: str + :keyword product_name: Represents product name that uniquely identifies product. + :paramtype product_name: str + :keyword configuration_name: Represents configuration name that uniquely identifies + configuration. + :paramtype configuration_name: str + """ + super().__init__(**kwargs) + self.product_family_name = product_family_name + self.product_line_name = product_line_name + self.product_name = product_name + self.configuration_name = configuration_name + + +class ImageInformation(_serialization.Model): + """Image for the product. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar image_type: Type of the image. Known values are: "MainImage", "BulletImage", and + "GenericImage". + :vartype image_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageType + :ivar image_url: Url of the image. + :vartype image_url: str + """ + + _validation = { + "image_type": {"readonly": True}, + "image_url": {"readonly": True}, + } + + _attribute_map = { + "image_type": {"key": "imageType", "type": "str"}, + "image_url": {"key": "imageUrl", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.image_type = None + self.image_url = None + + +class Link(_serialization.Model): + """Returns link related to the product. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar link_type: Type of link. Known values are: "Generic", "TermsAndConditions", + "Specification", "Documentation", "KnowMore", "SignUp", and "Discoverable". + :vartype link_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.LinkType + :ivar link_url: Url of the link. + :vartype link_url: str + """ + + _validation = { + "link_type": {"readonly": True}, + "link_url": {"readonly": True}, + } + + _attribute_map = { + "link_type": {"key": "linkType", "type": "str"}, + "link_url": {"key": "linkUrl", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.link_type = None + self.link_url = None + + +class ManagementResourcePreferences(_serialization.Model): + """Management resource preference to link device. + + :ivar preferred_management_resource_id: Customer preferred Management resource ARM ID. + :vartype preferred_management_resource_id: str + """ + + _attribute_map = { + "preferred_management_resource_id": {"key": "preferredManagementResourceId", "type": "str"}, + } + + def __init__(self, *, preferred_management_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword preferred_management_resource_id: Customer preferred Management resource ARM ID. + :paramtype preferred_management_resource_id: str + """ + super().__init__(**kwargs) + self.preferred_management_resource_id = preferred_management_resource_id + + +class MeterDetails(_serialization.Model): + """Holds details about billing type and its meter guids. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + Pav2MeterDetails, PurchaseMeterDetails + + 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 billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.BillingType + :ivar multiplier: Billing unit applicable for Pav2 billing. + :vartype multiplier: float + :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". + :vartype charging_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChargingType + """ + + _validation = { + "billing_type": {"required": True}, + "multiplier": {"readonly": True}, + "charging_type": {"readonly": True}, + } + + _attribute_map = { + "billing_type": {"key": "billingType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, + "charging_type": {"key": "chargingType", "type": "str"}, + } + + _subtype_map = {"billing_type": {"Pav2": "Pav2MeterDetails", "Purchase": "PurchaseMeterDetails"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_type: Optional[str] = None + self.multiplier = None + self.charging_type = None + + +class NotificationPreference(_serialization.Model): + """Notification preference for a job stage. + + All required parameters must be populated in order to send to Azure. + + :ivar stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". + :vartype stage_name: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.NotificationStageName + :ivar send_notification: Notification is required or not. Required. + :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, "_models.NotificationStageName"], send_notification: bool, **kwargs: Any + ) -> None: + """ + :keyword stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". + :paramtype stage_name: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.NotificationStageName + :keyword send_notification: Notification is required or not. Required. + :paramtype send_notification: bool + """ + super().__init__(**kwargs) + self.stage_name = stage_name + self.send_notification = send_notification + + +class Operation(_serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ActionType + """ + + _validation = { + "name": {"readonly": True}, + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + "action_type": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "origin": {"key": "origin", "type": "str"}, + "action_type": {"key": "actionType", "type": "str"}, + } + + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: + """ + :keyword display: Localized display information for this particular operation. + :paramtype display: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OperationDisplay + """ + super().__init__(**kwargs) + self.name = None + self.is_data_action = None + self.display = display + self.origin = None + self.action_type = None + + +class OperationDisplay(_serialization.Model): + """Localized display information for this particular operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + _validation = { + "provider": {"readonly": True}, + "resource": {"readonly": True}, + "operation": {"readonly": True}, + "description": {"readonly": True}, + } + + _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: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationListResult(_serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class OrderItemDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Order item 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 product_details: Unique identifier for configuration. Required. + :vartype product_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductDetails + :ivar order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". + :vartype order_item_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemType + :ivar order_item_mode: Defines the mode of the Order item. Known values are: "Default" and + "DoNotFulfill". + :vartype order_item_mode: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderMode + :ivar current_stage: Current Order item Status. + :vartype current_stage: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageDetails + :ivar order_item_stage_history: Order item status history. + :vartype order_item_stage_history: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageDetails] + :ivar preferences: Customer notification Preferences. + :vartype preferences: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Preferences + :ivar forward_shipping_details: Forward Package Shipping details. + :vartype forward_shipping_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ForwardShippingDetails + :ivar reverse_shipping_details: Reverse Package Shipping details. + :vartype reverse_shipping_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReverseShippingDetails + :ivar notification_email_list: Additional notification email list. + :vartype notification_email_list: list[str] + :ivar cancellation_reason: Cancellation reason. + :vartype cancellation_reason: str + :ivar cancellation_status: Describes whether the order item is cancellable or not. Known values + are: "Cancellable", "CancellableWithFee", and "NotCancellable". + :vartype cancellation_status: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemCancellationEnum + :ivar deletion_status: Describes whether the order item is deletable or not. Known values are: + "Allowed" and "NotAllowed". + :vartype deletion_status: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ActionStatusEnum + :ivar return_reason: Return reason. + :vartype return_reason: str + :ivar return_status: Describes whether the order item is returnable or not. Known values are: + "Returnable", "ReturnableWithFee", and "NotReturnable". + :vartype return_status: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemReturnEnum + :ivar management_rp_details_list: List of parent RP details supported for configuration. + :vartype management_rp_details_list: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] + :ivar error: Top level error for the job. + :vartype error: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorDetail + """ + + _validation = { + "product_details": {"required": True}, + "order_item_type": {"required": True}, + "current_stage": {"readonly": True}, + "order_item_stage_history": {"readonly": True}, + "forward_shipping_details": {"readonly": True}, + "reverse_shipping_details": {"readonly": True}, + "cancellation_reason": {"readonly": True}, + "cancellation_status": {"readonly": True}, + "deletion_status": {"readonly": True}, + "return_reason": {"readonly": True}, + "return_status": {"readonly": True}, + "management_rp_details_list": {"readonly": True}, + "error": {"readonly": True}, + } + + _attribute_map = { + "product_details": {"key": "productDetails", "type": "ProductDetails"}, + "order_item_type": {"key": "orderItemType", "type": "str"}, + "order_item_mode": {"key": "orderItemMode", "type": "str"}, + "current_stage": {"key": "currentStage", "type": "StageDetails"}, + "order_item_stage_history": {"key": "orderItemStageHistory", "type": "[StageDetails]"}, + "preferences": {"key": "preferences", "type": "Preferences"}, + "forward_shipping_details": {"key": "forwardShippingDetails", "type": "ForwardShippingDetails"}, + "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, + "notification_email_list": {"key": "notificationEmailList", "type": "[str]"}, + "cancellation_reason": {"key": "cancellationReason", "type": "str"}, + "cancellation_status": {"key": "cancellationStatus", "type": "str"}, + "deletion_status": {"key": "deletionStatus", "type": "str"}, + "return_reason": {"key": "returnReason", "type": "str"}, + "return_status": {"key": "returnStatus", "type": "str"}, + "management_rp_details_list": {"key": "managementRpDetailsList", "type": "[ResourceProviderDetails]"}, + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__( + self, + *, + product_details: "_models.ProductDetails", + order_item_type: Union[str, "_models.OrderItemType"], + order_item_mode: Optional[Union[str, "_models.OrderMode"]] = None, + preferences: Optional["_models.Preferences"] = None, + notification_email_list: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword product_details: Unique identifier for configuration. Required. + :paramtype product_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductDetails + :keyword order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". + :paramtype order_item_type: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemType + :keyword order_item_mode: Defines the mode of the Order item. Known values are: "Default" and + "DoNotFulfill". + :paramtype order_item_mode: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderMode + :keyword preferences: Customer notification Preferences. + :paramtype preferences: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Preferences + :keyword notification_email_list: Additional notification email list. + :paramtype notification_email_list: list[str] + """ + super().__init__(**kwargs) + self.product_details = product_details + self.order_item_type = order_item_type + self.order_item_mode = order_item_mode + self.current_stage = None + self.order_item_stage_history = None + self.preferences = preferences + self.forward_shipping_details = None + self.reverse_shipping_details = None + self.notification_email_list = notification_email_list + self.cancellation_reason = None + self.cancellation_status = None + self.deletion_status = None + self.return_reason = None + self.return_status = None + self.management_rp_details_list = None + self.error = None + + +class OrderItemResource(TrackedResource): + """Represents order item 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 id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar system_data: Represents resource creation and update time. + :vartype system_data: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SystemData + :ivar order_item_details: Represents order item details. Required. + :vartype order_item_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemDetails + :ivar address_details: Represents shipping and return address for order item. Required. + :vartype address_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressDetails + :ivar start_time: Start time of order item. + :vartype start_time: ~datetime.datetime + :ivar order_id: Id of the order to which order item belongs to. Required. + :vartype order_id: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "location": {"required": True}, + "system_data": {"readonly": True}, + "order_item_details": {"required": True}, + "address_details": {"required": True}, + "start_time": {"readonly": True}, + "order_id": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "order_item_details": {"key": "properties.orderItemDetails", "type": "OrderItemDetails"}, + "address_details": {"key": "properties.addressDetails", "type": "AddressDetails"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "order_id": {"key": "properties.orderId", "type": "str"}, + } + + def __init__( + self, + *, + location: str, + order_item_details: "_models.OrderItemDetails", + address_details: "_models.AddressDetails", + order_id: str, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword order_item_details: Represents order item details. Required. + :paramtype order_item_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemDetails + :keyword address_details: Represents shipping and return address for order item. Required. + :paramtype address_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressDetails + :keyword order_id: Id of the order to which order item belongs to. Required. + :paramtype order_id: str + """ + super().__init__(tags=tags, location=location, **kwargs) + self.system_data = None + self.order_item_details = order_item_details + self.address_details = address_details + self.start_time = None + self.order_id = order_id + + +class OrderItemResourceList(_serialization.Model): + """List of order items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of order item resources. + :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :ivar next_link: Link for the next set of order item resources. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OrderItemResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of order item resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class OrderItemUpdateParameter(_serialization.Model): + """Updates order item parameters. + + :ivar 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 forward_address: Updates forward shipping address and contact details. + :vartype forward_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties + :ivar preferences: Customer preference. + :vartype preferences: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Preferences + :ivar notification_email_list: Additional notification email list. + :vartype notification_email_list: list[str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + "forward_address": {"key": "properties.forwardAddress", "type": "AddressProperties"}, + "preferences": {"key": "properties.preferences", "type": "Preferences"}, + "notification_email_list": {"key": "properties.notificationEmailList", "type": "[str]"}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + forward_address: Optional["_models.AddressProperties"] = None, + preferences: Optional["_models.Preferences"] = None, + notification_email_list: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword 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 forward_address: Updates forward shipping address and contact details. + :paramtype forward_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties + :keyword preferences: Customer preference. + :paramtype preferences: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Preferences + :keyword notification_email_list: Additional notification email list. + :paramtype notification_email_list: list[str] + """ + super().__init__(**kwargs) + self.tags = tags + self.forward_address = forward_address + self.preferences = preferences + self.notification_email_list = notification_email_list + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + + +class OrderResource(ProxyResource): + """Specifies the properties or parameters for an order. Order is a grouping of one or more order + items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Represents resource creation and update time. + :vartype system_data: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SystemData + :ivar order_item_ids: List of order item ARM Ids which are part of an order. + :vartype order_item_ids: list[str] + :ivar current_stage: Order current status. + :vartype current_stage: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageDetails + :ivar order_stage_history: Order status history. + :vartype order_stage_history: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageDetails] + :ivar order_mode: Order mode. Known values are: "Default" and "DoNotFulfill". + :vartype order_mode: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderMode + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "order_item_ids": {"readonly": True}, + "current_stage": {"readonly": True}, + "order_stage_history": {"readonly": True}, + "order_mode": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "order_item_ids": {"key": "properties.orderItemIds", "type": "[str]"}, + "current_stage": {"key": "properties.currentStage", "type": "StageDetails"}, + "order_stage_history": {"key": "properties.orderStageHistory", "type": "[StageDetails]"}, + "order_mode": {"key": "properties.orderMode", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.system_data = None + self.order_item_ids = None + self.current_stage = None + self.order_stage_history = None + self.order_mode = None + + +class OrderResourceList(_serialization.Model): + """List of orders. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of order resources. + :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] + :ivar next_link: Link for the next set of order resources. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OrderResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of order resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class Pav2MeterDetails(MeterDetails): + """Billing type PAV2 meter 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 billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.BillingType + :ivar multiplier: Billing unit applicable for Pav2 billing. + :vartype multiplier: float + :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". + :vartype charging_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChargingType + :ivar meter_guid: Validation status of requested data center and transport. + :vartype meter_guid: str + """ + + _validation = { + "billing_type": {"required": True}, + "multiplier": {"readonly": True}, + "charging_type": {"readonly": True}, + "meter_guid": {"readonly": True}, + } + + _attribute_map = { + "billing_type": {"key": "billingType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, + "charging_type": {"key": "chargingType", "type": "str"}, + "meter_guid": {"key": "meterGuid", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_type: str = "Pav2" + self.meter_guid = None + + +class Preferences(_serialization.Model): + """Preferences related to the order. + + :ivar notification_preferences: Notification preferences. + :vartype notification_preferences: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.NotificationPreference] + :ivar transport_preferences: Preferences related to the shipment logistics of the order. + :vartype transport_preferences: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.TransportPreferences + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.EncryptionPreferences + :ivar management_resource_preferences: Preferences related to the Management resource. + :vartype management_resource_preferences: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ManagementResourcePreferences + """ + + _attribute_map = { + "notification_preferences": {"key": "notificationPreferences", "type": "[NotificationPreference]"}, + "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, + "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, + "management_resource_preferences": { + "key": "managementResourcePreferences", + "type": "ManagementResourcePreferences", + }, + } + + def __init__( + self, + *, + notification_preferences: Optional[List["_models.NotificationPreference"]] = None, + transport_preferences: Optional["_models.TransportPreferences"] = None, + encryption_preferences: Optional["_models.EncryptionPreferences"] = None, + management_resource_preferences: Optional["_models.ManagementResourcePreferences"] = None, + **kwargs: Any + ) -> None: + """ + :keyword notification_preferences: Notification preferences. + :paramtype notification_preferences: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.NotificationPreference] + :keyword transport_preferences: Preferences related to the shipment logistics of the order. + :paramtype transport_preferences: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.TransportPreferences + :keyword encryption_preferences: Preferences related to the Encryption. + :paramtype encryption_preferences: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.EncryptionPreferences + :keyword management_resource_preferences: Preferences related to the Management resource. + :paramtype management_resource_preferences: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ManagementResourcePreferences + """ + super().__init__(**kwargs) + self.notification_preferences = notification_preferences + self.transport_preferences = transport_preferences + self.encryption_preferences = encryption_preferences + self.management_resource_preferences = management_resource_preferences + + +class Product(_serialization.Model): + """Represents a product. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar configurations: List of configurations for the product. + :vartype configurations: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "configurations": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "configurations": {"key": "properties.configurations", "type": "[Configuration]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.display_name = None + self.description = None + self.image_information = None + self.cost_information = None + self.availability_information = None + self.hierarchy_information = None + self.fulfilled_by = None + self.filterable_properties = None + self.configurations = None + + +class ProductDetails(_serialization.Model): + """Represents product 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 display_info: Display details of the product. + :vartype display_info: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisplayInfo + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the product. + Required. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar product_double_encryption_status: Double encryption status of the configuration. + Read-only field. Known values are: "Disabled" and "Enabled". + :vartype product_double_encryption_status: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DoubleEncryptionStatus + :ivar identification_type: Identification type of the configuration. Known values are: + "NotSupported" and "SerialNumber". + :vartype identification_type: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.IdentificationType + :ivar parent_device_details: Device details of the parent configuration. + :vartype parent_device_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DeviceDetails + :ivar opt_in_additional_configurations: List of additional configurations customer wants in the + order item apart from the ones included in the base configuration. + :vartype opt_in_additional_configurations: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AdditionalConfiguration] + :ivar child_configuration_device_details: Details of all child configurations that are part of + the order item. + :vartype child_configuration_device_details: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationDeviceDetails] + """ + + _validation = { + "hierarchy_information": {"required": True}, + "product_double_encryption_status": {"readonly": True}, + "identification_type": {"readonly": True}, + "parent_device_details": {"readonly": True}, + "child_configuration_device_details": {"readonly": True}, + } + + _attribute_map = { + "display_info": {"key": "displayInfo", "type": "DisplayInfo"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "product_double_encryption_status": {"key": "productDoubleEncryptionStatus", "type": "str"}, + "identification_type": {"key": "identificationType", "type": "str"}, + "parent_device_details": {"key": "parentDeviceDetails", "type": "DeviceDetails"}, + "opt_in_additional_configurations": { + "key": "optInAdditionalConfigurations", + "type": "[AdditionalConfiguration]", + }, + "child_configuration_device_details": { + "key": "childConfigurationDeviceDetails", + "type": "[ConfigurationDeviceDetails]", + }, + } + + def __init__( + self, + *, + hierarchy_information: "_models.HierarchyInformation", + display_info: Optional["_models.DisplayInfo"] = None, + opt_in_additional_configurations: Optional[List["_models.AdditionalConfiguration"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword display_info: Display details of the product. + :paramtype display_info: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisplayInfo + :keyword hierarchy_information: Hierarchy of the product which uniquely identifies the product. + Required. + :paramtype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :keyword opt_in_additional_configurations: List of additional configurations customer wants in + the order item apart from the ones included in the base configuration. + :paramtype opt_in_additional_configurations: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AdditionalConfiguration] + """ + super().__init__(**kwargs) + self.display_info = display_info + self.hierarchy_information = hierarchy_information + self.product_double_encryption_status = None + self.identification_type = None + self.parent_device_details = None + self.opt_in_additional_configurations = opt_in_additional_configurations + self.child_configuration_device_details = None + + +class ProductFamilies(_serialization.Model): + """The list of product families. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of product families. + :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] + :ivar next_link: Link for the next set of product families. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ProductFamily]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Link for the next set of product families. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class ProductFamiliesMetadata(_serialization.Model): + """Holds details about product family metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of product family metadata details. + :vartype value: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesMetadataDetails] + :ivar next_link: Link for the next set of product families. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ProductFamiliesMetadataDetails]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class ProductFamiliesMetadataDetails(_serialization.Model): + """Product families metadata details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar product_lines: List of product lines supported in the product family. + :vartype product_lines: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductLine] + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "product_lines": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, + "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, + } + + def __init__( + self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_provider_details: Contains details related to resource provider. + :paramtype resource_provider_details: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] + """ + super().__init__(**kwargs) + self.display_name = None + self.description = None + self.image_information = None + self.cost_information = None + self.availability_information = None + self.hierarchy_information = None + self.fulfilled_by = None + self.filterable_properties = None + self.product_lines = None + self.resource_provider_details = resource_provider_details + + +class ProductFamiliesRequest(_serialization.Model): + """The filters for showing the product families. + + All required parameters must be populated in order to send to Azure. + + :ivar filterable_properties: Dictionary of filterable properties on product family. Required. + :vartype filterable_properties: dict[str, + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty]] + :ivar customer_subscription_details: Customer subscription properties. Clients can display + available products to unregistered customers by explicitly passing subscription details. + :vartype customer_subscription_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionDetails + """ + + _validation = { + "filterable_properties": {"required": True}, + } + + _attribute_map = { + "filterable_properties": {"key": "filterableProperties", "type": "{[FilterableProperty]}"}, + "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, + } + + def __init__( + self, + *, + filterable_properties: Dict[str, List["_models.FilterableProperty"]], + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, + **kwargs: Any + ) -> None: + """ + :keyword filterable_properties: Dictionary of filterable properties on product family. + Required. + :paramtype filterable_properties: dict[str, + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty]] + :keyword customer_subscription_details: Customer subscription properties. Clients can display + available products to unregistered customers by explicitly passing subscription details. + :paramtype customer_subscription_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionDetails + """ + super().__init__(**kwargs) + self.filterable_properties = filterable_properties + self.customer_subscription_details = customer_subscription_details + + +class ProductFamily(_serialization.Model): + """Product Family. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar product_lines: List of product lines supported in the product family. + :vartype product_lines: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductLine] + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "product_lines": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, + "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, + } + + def __init__( + self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_provider_details: Contains details related to resource provider. + :paramtype resource_provider_details: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] + """ + super().__init__(**kwargs) + self.display_name = None + self.description = None + self.image_information = None + self.cost_information = None + self.availability_information = None + self.hierarchy_information = None + self.fulfilled_by = None + self.filterable_properties = None + self.product_lines = None + self.resource_provider_details = resource_provider_details + + +class ProductFamilyProperties(CommonProperties): + """Properties of product family. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar product_lines: List of product lines supported in the product family. + :vartype product_lines: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductLine] + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "product_lines": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "product_lines": {"key": "productLines", "type": "[ProductLine]"}, + "resource_provider_details": {"key": "resourceProviderDetails", "type": "[ResourceProviderDetails]"}, + } + + def __init__( + self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any + ) -> None: + """ + :keyword resource_provider_details: Contains details related to resource provider. + :paramtype resource_provider_details: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] + """ + super().__init__(**kwargs) + self.product_lines = None + self.resource_provider_details = resource_provider_details + + +class ProductLine(_serialization.Model): + """Product line. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar products: List of products in the product line. + :vartype products: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Product] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "products": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "properties.displayName", "type": "str"}, + "description": {"key": "properties.description", "type": "Description"}, + "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, + "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, + "products": {"key": "properties.products", "type": "[Product]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.display_name = None + self.description = None + self.image_information = None + self.cost_information = None + self.availability_information = None + self.hierarchy_information = None + self.fulfilled_by = None + self.filterable_properties = None + self.products = None + + +class ProductLineProperties(CommonProperties): + """Properties of product line. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar products: List of products in the product line. + :vartype products: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Product] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "products": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "products": {"key": "products", "type": "[Product]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.products = None + + +class ProductProperties(CommonProperties): + """Properties of product. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation + :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy + level. Known values are: "Microsoft" and "External". + :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: + list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] + :ivar configurations: List of configurations for the product. + :vartype configurations: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] + """ + + _validation = { + "display_name": {"readonly": True}, + "description": {"readonly": True}, + "image_information": {"readonly": True}, + "cost_information": {"readonly": True}, + "availability_information": {"readonly": True}, + "hierarchy_information": {"readonly": True}, + "fulfilled_by": {"readonly": True}, + "filterable_properties": {"readonly": True}, + "configurations": {"readonly": True}, + } + + _attribute_map = { + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "Description"}, + "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, + "cost_information": {"key": "costInformation", "type": "CostInformation"}, + "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, + "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, + "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, + "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, + "configurations": {"key": "configurations", "type": "[Configuration]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.configurations = None + + +class PurchaseMeterDetails(MeterDetails): + """Billing type Purchase meter 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 billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.BillingType + :ivar multiplier: Billing unit applicable for Pav2 billing. + :vartype multiplier: float + :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". + :vartype charging_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChargingType + :ivar product_id: Product Id. + :vartype product_id: str + :ivar sku_id: Sku Id. + :vartype sku_id: str + :ivar term_id: Term Id. + :vartype term_id: str + """ + + _validation = { + "billing_type": {"required": True}, + "multiplier": {"readonly": True}, + "charging_type": {"readonly": True}, + "product_id": {"readonly": True}, + "sku_id": {"readonly": True}, + "term_id": {"readonly": True}, + } + + _attribute_map = { + "billing_type": {"key": "billingType", "type": "str"}, + "multiplier": {"key": "multiplier", "type": "float"}, + "charging_type": {"key": "chargingType", "type": "str"}, + "product_id": {"key": "productId", "type": "str"}, + "sku_id": {"key": "skuId", "type": "str"}, + "term_id": {"key": "termId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.billing_type: str = "Purchase" + self.product_id = None + self.sku_id = None + self.term_id = None + + +class ResourceMoveRequest(_serialization.Model): + """ResourceMoveRequest. + + :ivar target_resource_group: + :vartype target_resource_group: str + :ivar resources: + :vartype resources: list[str] + """ + + _attribute_map = { + "target_resource_group": {"key": "targetResourceGroup", "type": "str"}, + "resources": {"key": "resources", "type": "[str]"}, + } + + def __init__( + self, *, target_resource_group: Optional[str] = None, resources: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword target_resource_group: + :paramtype target_resource_group: str + :keyword resources: + :paramtype resources: list[str] + """ + super().__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class ResourceProviderDetails(_serialization.Model): + """Management RP details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_provider_namespace: Resource provider namespace. + :vartype resource_provider_namespace: str + """ + + _validation = { + "resource_provider_namespace": {"readonly": True}, + } + + _attribute_map = { + "resource_provider_namespace": {"key": "resourceProviderNamespace", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.resource_provider_namespace = None + + +class ReturnOrderItemDetails(_serialization.Model): + """Return order item request body. + + All required parameters must be populated in order to send to Azure. + + :ivar return_address: Customer return address. + :vartype return_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties + :ivar return_reason: Return Reason. Required. + :vartype return_reason: str + :ivar service_tag: Service tag (located on the bottom-right corner of the device). + :vartype service_tag: str + :ivar shipping_box_required: Shipping Box required. + :vartype shipping_box_required: bool + """ + + _validation = { + "return_reason": {"required": True}, + } + + _attribute_map = { + "return_address": {"key": "returnAddress", "type": "AddressProperties"}, + "return_reason": {"key": "returnReason", "type": "str"}, + "service_tag": {"key": "serviceTag", "type": "str"}, + "shipping_box_required": {"key": "shippingBoxRequired", "type": "bool"}, + } + + def __init__( + self, + *, + return_reason: str, + return_address: Optional["_models.AddressProperties"] = None, + service_tag: Optional[str] = None, + shipping_box_required: bool = False, + **kwargs: Any + ) -> None: + """ + :keyword return_address: Customer return address. + :paramtype return_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties + :keyword return_reason: Return Reason. Required. + :paramtype return_reason: str + :keyword service_tag: Service tag (located on the bottom-right corner of the device). + :paramtype service_tag: str + :keyword shipping_box_required: Shipping Box required. + :paramtype shipping_box_required: bool + """ + super().__init__(**kwargs) + self.return_address = return_address + self.return_reason = return_reason + self.service_tag = service_tag + self.shipping_box_required = shipping_box_required + + +class ReverseShippingDetails(_serialization.Model): + """Reverse shipment details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar sas_key_for_label: SAS key to download the reverse shipment label of the package. + :vartype sas_key_for_label: str + :ivar carrier_name: Name of the carrier. + :vartype carrier_name: str + :ivar carrier_display_name: Carrier Name for display purpose. Not to be used for any + processing. + :vartype carrier_display_name: str + :ivar tracking_id: TrackingId of the package. + :vartype tracking_id: str + :ivar tracking_url: TrackingUrl of the package. + :vartype tracking_url: str + """ + + _validation = { + "sas_key_for_label": {"readonly": True}, + "carrier_name": {"readonly": True}, + "carrier_display_name": {"readonly": True}, + "tracking_id": {"readonly": True}, + "tracking_url": {"readonly": True}, + } + + _attribute_map = { + "sas_key_for_label": {"key": "sasKeyForLabel", "type": "str"}, + "carrier_name": {"key": "carrierName", "type": "str"}, + "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "tracking_url": {"key": "trackingUrl", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.sas_key_for_label = None + self.carrier_name = None + self.carrier_display_name = None + self.tracking_id = None + self.tracking_url = None + + +class ShippingAddress(_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: Street Address line 1. Required. + :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: Name of the Country. Required. + :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. Known values are: "None", "Residential", and "Commercial". + :vartype address_type: str or ~azure.mgmt.edgeorder.v2022_05_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, "_models.AddressType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword street_address1: Street Address line 1. Required. + :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: Name of the Country. Required. + :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. Known values are: "None", "Residential", and + "Commercial". + :paramtype address_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressType + """ + super().__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 Specification(_serialization.Model): + """Specification of the configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the specification. + :vartype name: str + :ivar value: Value of the specification. + :vartype value: str + """ + + _validation = { + "name": {"readonly": True}, + "value": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.value = None + + +class StageDetails(_serialization.Model): + """Resource stage details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar stage_status: Stage status. Known values are: "None", "InProgress", "Succeeded", + "Failed", "Cancelled", and "Cancelling". + :vartype stage_status: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageStatus + :ivar stage_name: Stage name. Known values are: "Placed", "InReview", "Confirmed", + "ReadyToShip", "Shipped", "Delivered", "InUse", "ReturnInitiated", "ReturnPickedUp", + "ReturnedToMicrosoft", "ReturnCompleted", and "Cancelled". + :vartype stage_name: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageName + :ivar display_name: Display name of the resource stage. + :vartype display_name: str + :ivar start_time: Stage start time. + :vartype start_time: ~datetime.datetime + """ + + _validation = { + "stage_status": {"readonly": True}, + "stage_name": {"readonly": True}, + "display_name": {"readonly": True}, + "start_time": {"readonly": True}, + } + + _attribute_map = { + "stage_status": {"key": "stageStatus", "type": "str"}, + "stage_name": {"key": "stageName", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.stage_status = None + self.stage_name = None + self.display_name = None + self.start_time = None + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: 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. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _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, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TransportPreferences(_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: Indicates Shipment Logistics type that the customer preferred. + Required. Known values are: "CustomerManaged" and "MicrosoftManaged". + :vartype preferred_shipment_type: str or + ~azure.mgmt.edgeorder.v2022_05_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, "_models.TransportShipmentTypes"], **kwargs: Any) -> None: + """ + :keyword preferred_shipment_type: Indicates Shipment Logistics type that the customer + preferred. Required. Known values are: "CustomerManaged" and "MicrosoftManaged". + :paramtype preferred_shipment_type: str or + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.TransportShipmentTypes + """ + super().__init__(**kwargs) + self.preferred_shipment_type = preferred_shipment_type diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/__init__.py new file mode 100644 index 000000000000..c3b25bc71af1 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/__init__.py @@ -0,0 +1,27 @@ +# 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 ._addresses_operations import AddressesOperations +from ._products_and_configurations_operations import ProductsAndConfigurationsOperations +from ._order_items_operations import OrderItemsOperations +from ._orders_operations import OrdersOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "AddressesOperations", + "ProductsAndConfigurationsOperations", + "OrderItemsOperations", + "OrdersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_addresses_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_addresses_operations.py new file mode 100644 index 000000000000..a5915d7e38e6 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_addresses_operations.py @@ -0,0 +1,1185 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_subscription_request( + subscription_id: str, + *, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request( + resource_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request(resource_group_name: str, address_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_request( + resource_group_name: str, address_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, address_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, address_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "addressName": _SERIALIZER.url( + "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +class AddressesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s + :attr:`addresses` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription( + self, filter: Optional[str] = None, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> Iterable["_models.AddressResource"]: + """List all the addresses available under the subscription. + + :param filter: $filter is supported to filter based on shipping address properties. Filter + supports only equals operation. Default value is None. + :type filter: str + :param skip_token: $skipToken is supported on Get list of addresses, which provides the next + page in the list of addresses. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_subscription.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AddressResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses"} + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> Iterable["_models.AddressResource"]: + """List all the addresses available under the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param filter: $filter is supported to filter based on shipping address properties. Filter + supports only equals operation. Default value is None. + :type filter: str + :param skip_token: $skipToken is supported on Get list of addresses, which provides the next + page in the list of addresses. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AddressResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AddressResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, 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.EdgeOrder/addresses" + } + + @distributed_trace + def get(self, resource_group_name: str, address_name: str, **kwargs: Any) -> _models.AddressResource: + """Get information about the specified address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressResource or the result of cls(response) + :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AddressResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + def _create_initial( + self, + resource_group_name: str, + address_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> Optional[_models.AddressResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_resource, (IO, bytes)): + _content = address_resource + else: + _json = self._serialize.body(address_resource, "AddressResource") + + request = build_create_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("AddressResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload + def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: _models.AddressResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Create a new address with the specified parameters. Existing address cannot be updated with + this API and should + instead be updated with the Update address API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_resource: Address details from request body. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Create a new address with the specified parameters. Existing address cannot be updated with + this API and should + instead be updated with the Update address API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_resource: Address details from request body. Required. + :type address_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: Union[_models.AddressResource, IO], + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Create a new address with the specified parameters. Existing address cannot be updated with + this API and should + instead be updated with the Update address API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_resource: Address details from request body. Is either a AddressResource type or + a IO type. Required. + :type address_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + address_name=address_name, + address_resource=address_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AddressResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, address_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @distributed_trace + def begin_delete(self, resource_group_name: str, address_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete an address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + address_name=address_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + def _update_initial( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.AddressResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(address_update_parameter, (IO, bytes)): + _content = address_update_parameter + else: + _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") + + request = build_update_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("AddressResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } + + @overload + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: _models.AddressUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Update the properties of an existing address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressUpdateParameter + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Update the properties of an existing address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_update_parameter: Address update parameters from request body. Required. + :type address_update_parameter: IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.AddressResource]: + """Update the properties of an existing address. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param address_name: The name of the address Resource within the specified resource group. + address names must be between 3 and 24 characters in length and use any alphanumeric and + underscore only. Required. + :type address_name: str + :param address_update_parameter: Address update parameters from request body. Is either a + AddressUpdateParameter type or a IO type. Required. + :type address_update_parameter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressUpdateParameter or IO + :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. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 AddressResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + address_name=address_name, + address_update_parameter=address_update_parameter, + if_match=if_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AddressResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_operations.py new file mode 100644 index 000000000000..ec18ed55f986 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_operations.py @@ -0,0 +1,164 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.EdgeOrder/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + """List all the supported operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, 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.EdgeOrder/operations"} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_order_items_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_order_items_operations.py new file mode 100644 index 000000000000..497c8487e662 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_order_items_operations.py @@ -0,0 +1,1644 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_subscription_request( + subscription_id: str, + *, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request( + resource_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, order_item_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_request( + resource_group_name: str, order_item_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, order_item_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + order_item_name: str, + subscription_id: str, + *, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_cancel_request( + resource_group_name: str, order_item_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_return_method_request( + resource_group_name: str, order_item_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class OrderItemsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s + :attr:`order_items` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription( + self, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> Iterable["_models.OrderItemResource"]: + """List order items at subscription level. + + :param filter: $filter is supported to filter based on order id. Filter supports only equals + operation. Default value is None. + :type filter: str + :param expand: $expand is supported on parent device details, device details, forward shipping + details and reverse shipping details parameters. Each of these can be provided as a comma + separated list. Parent Device Details for order item provides details on the devices of the + product, Device Details for order item provides details on the devices of the child + configurations of the product, Forward and Reverse Shipping details provide forward and reverse + shipping details respectively. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on Get list of order items, which provides the next + page in the list of order items. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_subscription.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems"} + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + filter: Optional[str] = None, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> Iterable["_models.OrderItemResource"]: + """List order items at resource group level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param filter: $filter is supported to filter based on order id. Filter supports only equals + operation. Default value is None. + :type filter: str + :param expand: $expand is supported on parent device details, device details, forward shipping + details and reverse shipping details parameters. Each of these can be provided as a comma + separated list. Parent Device Details for order item provides details on the devices of the + product, Device Details for order item provides details on the devices of the child + configurations of the product, Forward and Reverse Shipping details provide forward and reverse + shipping details respectively. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on Get list of order items, which provides the next + page in the list of order items. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + expand=expand, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OrderItemResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, 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.EdgeOrder/orderItems" + } + + @distributed_trace + def get( + self, resource_group_name: str, order_item_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> _models.OrderItemResource: + """Get an order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param expand: $expand is supported on parent device details, device details, forward shipping + details and reverse shipping details parameters. Each of these can be provided as a comma + separated list. Parent Device Details for order item provides details on the devices of the + product, Device Details for order item provides details on the devices of the child + configurations of the product, Forward and Reverse Shipping details provide forward and reverse + shipping details respectively. Default value is None. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrderItemResource or the result of cls(response) + :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OrderItemResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + def _create_initial( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> Optional[_models.OrderItemResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_resource, (IO, bytes)): + _content = order_item_resource + else: + _json = self._serialize.body(order_item_resource, "OrderItemResource") + + request = build_create_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("OrderItemResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: _models.OrderItemResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Create an order item. Existing order item cannot be updated with this api and should instead be + updated with the Update order item + API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_resource: Order item details from request body. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Create an order item. Existing order item cannot be updated with this api and should instead be + updated with the Update order item + API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_resource: Order item details from request body. Required. + :type order_item_resource: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: Union[_models.OrderItemResource, IO], + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Create an order item. Existing order item cannot be updated with this api and should instead be + updated with the Update order item + API. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_resource: Order item details from request body. Is either a OrderItemResource + type or a IO type. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + order_item_resource=order_item_resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OrderItemResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, order_item_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @distributed_trace + def begin_delete(self, resource_group_name: str, order_item_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete an order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + order_item_name=order_item_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + def _update_initial( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> Optional[_models.OrderItemResource]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(order_item_update_parameter, (IO, bytes)): + _content = order_item_update_parameter + else: + _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") + + request = build_update_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("OrderItemResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: _models.OrderItemUpdateParameter, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Update the properties of an existing order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_update_parameter: Order item update parameters from request body. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemUpdateParameter + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: IO, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Update the properties of an existing order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_update_parameter: Order item update parameters from request body. Required. + :type order_item_update_parameter: IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Update the properties of an existing order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param order_item_update_parameter: Order item update parameters from request body. Is either a + OrderItemUpdateParameter type or a IO type. Required. + :type order_item_update_parameter: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemUpdateParameter or IO + :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag + of the order on the server matches this value. Default value is None. + :type if_match: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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 OrderItemResource or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + order_item_update_parameter=order_item_update_parameter, + if_match=if_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OrderItemResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" + } + + @overload + def cancel( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: _models.CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Cancel order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def cancel( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Cancel order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param cancellation_reason: Reason for cancellation. Required. + :type cancellation_reason: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def cancel( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: Union[_models.CancellationReason, IO], + **kwargs: Any + ) -> None: + """Cancel order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a + IO type. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CancellationReason + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(cancellation_reason, (IO, bytes)): + _content = cancellation_reason + else: + _json = self._serialize.body(cancellation_reason, "CancellationReason") + + request = build_cancel_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.cancel.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, 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.EdgeOrder/orderItems/{orderItemName}/cancel" + } + + def _return_method_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(return_order_item_details, (IO, bytes)): + _content = return_order_item_details + else: + _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") + + request = build_return_method_request( + resource_group_name=resource_group_name, + order_item_name=order_item_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._return_method_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _return_method_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } + + @overload + def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: _models.ReturnOrderItemDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Return order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param return_order_item_details: Return order item details. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReturnOrderItemDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + + @overload + def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Return order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param return_order_item_details: Return order item details. Required. + :type return_order_item_details: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + + @distributed_trace + def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + **kwargs: Any + ) -> LROPoller[None]: + """Return order item. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :param return_order_item_details: Return order item details. Is either a ReturnOrderItemDetails + type or a IO type. Required. + :type return_order_item_details: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReturnOrderItemDetails or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :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: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._return_method_initial( # type: ignore + resource_group_name=resource_group_name, + order_item_name=order_item_name, + return_order_item_details=return_order_item_details, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_return_method.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_orders_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_orders_operations.py new file mode 100644 index 000000000000..e83600d3f071 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_orders_operations.py @@ -0,0 +1,431 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_subscription_request( + subscription_id: str, *, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, location: str, order_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "orderName": _SERIALIZER.url("order_name", order_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request( + resource_group_name: str, + subscription_id: str, + *, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class OrdersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s + :attr:`orders` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription( + self, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> Iterable["_models.OrderResource"]: + """List orders at subscription level. + + :param skip_token: $skipToken is supported on Get list of orders, which provides the next page + in the list of orders. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_subscription.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OrderResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders"} + + @distributed_trace + def get(self, resource_group_name: str, location: str, order_name: str, **kwargs: Any) -> _models.OrderResource: + """Get an order. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of Azure region. Required. + :type location: str + :param order_name: The name of the order. Required. + :type order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrderResource or the result of cls(response) + :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + location=location, + order_name=order_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OrderResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" + } + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> Iterable["_models.OrderResource"]: + """List orders at resource group level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param skip_token: $skipToken is supported on Get list of orders, which provides the next page + in the list of orders. Default value is None. + :type skip_token: str + :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 + items in the list will be returned to the API caller. Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrderResource or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + top=top, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OrderResourceList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, 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.EdgeOrder/orders" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_products_and_configurations_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_products_and_configurations_operations.py new file mode 100644 index 000000000000..af5a3a6ed1ae --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_products_and_configurations_operations.py @@ -0,0 +1,603 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_configurations_request( + subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_product_families_request( + subscription_id: str, *, expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_product_families_metadata_request( + subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ProductsAndConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s + :attr:`products_and_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def list_configurations( + self, + configurations_request: _models.ConfigurationsRequest, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. + + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationsRequest + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_configurations( + self, + configurations_request: IO, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. + + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_configurations( + self, + configurations_request: Union[_models.ConfigurationsRequest, IO], + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. + + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO type. Required. + :type configurations_request: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationsRequest or IO + :param skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Configuration or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(configurations_request, (IO, bytes)): + _content = configurations_request + else: + _json = self._serialize.body(configurations_request, "ConfigurationsRequest") + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_configurations_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_configurations.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("Configurations", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_configurations.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" + } + + @overload + def list_product_families( + self, + product_families_request: _models.ProductFamiliesRequest, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: + """List product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesRequest + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_product_families( + self, + product_families_request: IO, + expand: Optional[str] = None, + skip_token: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: + """List product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: IO + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_product_families( + self, + product_families_request: Union[_models.ProductFamiliesRequest, IO], + expand: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ProductFamily"]: + """List product families for the given subscription. + + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO type. Required. + :type product_families_request: + ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesRequest or IO + :param expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :type expand: str + :param skip_token: $skipToken is supported on list of product families, which provides the next + page in the list of product families. Default value is None. + :type skip_token: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductFamily or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(product_families_request, (IO, bytes)): + _content = product_families_request + else: + _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_product_families_request( + subscription_id=self._config.subscription_id, + expand=expand, + skip_token=skip_token, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_product_families.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ProductFamilies", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_product_families.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" + } + + @distributed_trace + def list_product_families_metadata( + self, skip_token: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.ProductFamiliesMetadataDetails"]: + """List product families metadata for the given subscription. + + :param skip_token: $skipToken is supported on list of product families metadata, which provides + the next page in the list of product families metadata. Default value is None. + :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 ProductFamiliesMetadataDetails or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_product_families_metadata_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=api_version, + template_url=self.list_product_families_metadata.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_product_families_metadata.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" + } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/py.typed b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/cancel_order_item.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/cancel_order_item.py new file mode 100644 index 000000000000..cf8b1b5f3484 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/cancel_order_item.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python cancel_order_item.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.cancel_order_item( + order_item_name="TestOrderItemName3", + resource_group_name="YourResourceGroupName", + cancellation_reason={"reason": "Order cancelled"}, + ) + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CancelOrderItem.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_address.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_address.py new file mode 100644 index 000000000000..19523c7cb4e7 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_address.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python create_address.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.begin_create_address( + address_name="TestAddressName2", + resource_group_name="YourResourceGroupName", + address_resource={ + "location": "eastus", + "properties": { + "contactDetails": { + "contactName": "XXXX XXXX", + "emailList": ["xxxx@xxxx.xxx"], + "phone": "0000000000", + "phoneExtension": "", + }, + "shippingAddress": { + "addressType": "None", + "city": "San Francisco", + "companyName": "Microsoft", + "country": "US", + "postalCode": "94107", + "stateOrProvince": "CA", + "streetAddress1": "16 TOWNSEND ST", + "streetAddress2": "UNIT 1", + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CreateAddress.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_order_item.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_order_item.py new file mode 100644 index 000000000000..354dd0bda36c --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_order_item.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python create_order_item.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.begin_create_order_item( + order_item_name="TestOrderItemName2", + resource_group_name="YourResourceGroupName", + order_item_resource={ + "location": "eastus", + "properties": { + "addressDetails": { + "forwardAddress": { + "contactDetails": { + "contactName": "XXXX XXXX", + "emailList": ["xxxx@xxxx.xxx"], + "phone": "0000000000", + "phoneExtension": "", + }, + "shippingAddress": { + "addressType": "None", + "city": "San Francisco", + "companyName": "Microsoft", + "country": "US", + "postalCode": "94107", + "stateOrProvince": "CA", + "streetAddress1": "16 TOWNSEND ST", + "streetAddress2": "UNIT 1", + }, + } + }, + "orderId": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2", + "orderItemDetails": { + "orderItemType": "Purchase", + "preferences": {"transportPreferences": {"preferredShipmentType": "MicrosoftManaged"}}, + "productDetails": { + "hierarchyInformation": { + "configurationName": "edgep_base", + "productFamilyName": "azurestackedge", + "productLineName": "azurestackedge", + "productName": "azurestackedgegpu", + } + }, + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CreateOrderItem.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/delete_address_by_name.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/delete_address_by_name.py new file mode 100644 index 000000000000..15cd02b0371d --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/delete_address_by_name.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python delete_address_by_name.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.begin_delete_address_by_name( + address_name="TestAddressName1", + resource_group_name="YourResourceGroupName", + ).result() + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteAddressByName.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/delete_order_item_by_name.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/delete_order_item_by_name.py new file mode 100644 index 000000000000..9b29405633fa --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/delete_order_item_by_name.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python delete_order_item_by_name.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.begin_delete_order_item_by_name( + order_item_name="TestOrderItemName3", + resource_group_name="YourResourceGroupName", + ).result() + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteOrderItemByName.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/get_address_by_name.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/get_address_by_name.py new file mode 100644 index 000000000000..4ffa5b695fb2 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/get_address_by_name.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python get_address_by_name.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.get_address_by_name( + address_name="TestAddressName1", + resource_group_name="YourResourceGroupName", + ) + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetAddressByName.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/get_order_by_name.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/get_order_by_name.py new file mode 100644 index 000000000000..558d98d8967e --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/get_order_by_name.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python get_order_by_name.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.get_order_by_name( + order_name="TestOrderName3", + resource_group_name="YourResourceGroupName", + location="eastus", + ) + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetOrderByName.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/get_order_item_by_name.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/get_order_item_by_name.py new file mode 100644 index 000000000000..b91576e83884 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/get_order_item_by_name.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python get_order_item_by_name.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.get_order_item_by_name( + order_item_name="TestOrderItemName1", + resource_group_name="YourResourceGroupName", + ) + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetOrderItemByName.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_addresses_at_resource_group_level.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_addresses_at_resource_group_level.py new file mode 100644 index 000000000000..1d0a54fe99a1 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_addresses_at_resource_group_level.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_addresses_at_resource_group_level.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.list_addresses_at_resource_group_level( + resource_group_name="YourResourceGroupName", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListAddressesAtResourceGroupLevel.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_addresses_at_subscription_level.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_addresses_at_subscription_level.py new file mode 100644 index 000000000000..0f6865c4e1a5 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_addresses_at_subscription_level.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_addresses_at_subscription_level.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.list_addresses_at_subscription_level() + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListAddressesAtSubscriptionLevel.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_configurations.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_configurations.py new file mode 100644 index 000000000000..558a3084dda4 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_configurations.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_configurations.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.list_configurations( + configurations_request={ + "configurationFilters": [ + { + "filterableProperty": [{"supportedValues": ["US"], "type": "ShipToCountries"}], + "hierarchyInformation": { + "productFamilyName": "azurestackedge", + "productLineName": "azurestackedge", + "productName": "azurestackedgegpu", + }, + } + ] + }, + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListConfigurations.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_operations.py new file mode 100644 index 000000000000..19c8c2ac0f4c --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_operations.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_operations.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.list_operations() + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOperations.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_at_resource_group_level.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_at_resource_group_level.py new file mode 100644 index 000000000000..a0386d1fd0fe --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_at_resource_group_level.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_order_at_resource_group_level.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.list_order_at_resource_group_level( + resource_group_name="YourResourceGroupName", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOrderAtResourceGroupLevel.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_at_subscription_level.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_at_subscription_level.py new file mode 100644 index 000000000000..253845f86393 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_at_subscription_level.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_order_at_subscription_level.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.list_order_at_subscription_level() + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOrderAtSubscriptionLevel.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_items_at_resource_group_level.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_items_at_resource_group_level.py new file mode 100644 index 000000000000..b2b69ae84dd4 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_items_at_resource_group_level.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_order_items_at_resource_group_level.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.list_order_items_at_resource_group_level( + resource_group_name="YourResourceGroupName", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOrderItemsAtResourceGroupLevel.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_items_at_subscription_level.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_items_at_subscription_level.py new file mode 100644 index 000000000000..fb2692c03362 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_order_items_at_subscription_level.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_order_items_at_subscription_level.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.list_order_items_at_subscription_level() + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOrderItemsAtSubscriptionLevel.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_product_families.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_product_families.py new file mode 100644 index 000000000000..8a70b264279b --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_product_families.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_product_families.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.list_product_families( + product_families_request={ + "filterableProperties": {"azurestackedge": [{"supportedValues": ["US"], "type": "ShipToCountries"}]} + }, + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListProductFamilies.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_product_families_metadata.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_product_families_metadata.py new file mode 100644 index 000000000000..39a70da96e7a --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_product_families_metadata.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python list_product_families_metadata.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.list_product_families_metadata() + for item in response: + print(item) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListProductFamiliesMetadata.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/return_order_item.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/return_order_item.py new file mode 100644 index 000000000000..b22feffabc4b --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/return_order_item.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python return_order_item.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.begin_return_order_item( + order_item_name="TestOrderName4", + resource_group_name="YourResourceGroupName", + return_order_item_details={"returnReason": "Order returned"}, + ).result() + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ReturnOrderItem.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_address.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_address.py new file mode 100644 index 000000000000..0983f644776d --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_address.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python update_address.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.begin_update_address( + address_name="TestAddressName2", + resource_group_name="YourResourceGroupName", + address_update_parameter={ + "properties": { + "contactDetails": { + "contactName": "YYYY YYYY", + "emailList": ["xxxx@xxxx.xxx"], + "phone": "0000000000", + "phoneExtension": "", + }, + "shippingAddress": { + "addressType": "None", + "city": "San Francisco", + "companyName": "Microsoft", + "country": "US", + "postalCode": "94107", + "stateOrProvince": "CA", + "streetAddress1": "16 TOWNSEND ST", + "streetAddress2": "UNIT 1", + }, + }, + "tags": {"tag1": "value1", "tag2": "value2"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/UpdateAddress.json +if __name__ == "__main__": + main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_order_item.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_order_item.py new file mode 100644 index 000000000000..1cc1d10861d2 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_order_item.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-edgeorder +# USAGE + python update_order_item.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = EdgeOrderManagementClient( + credential=DefaultAzureCredential(), + subscription_id="YourSubscriptionId", + ) + + response = client.begin_update_order_item( + order_item_name="TestOrderItemName3", + resource_group_name="YourResourceGroupName", + order_item_update_parameter={ + "properties": {"preferences": {"transportPreferences": {"preferredShipmentType": "CustomerManaged"}}} + }, + ).result() + print(response) + + +# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/UpdateOrderItem.json +if __name__ == "__main__": + main()