From e360561832dcb43120df82d28348391adfb93d0a Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Mon, 6 Jul 2026 08:27:20 +0000 Subject: [PATCH 1/3] Configurations: 'specification/edgeorder/resource-manager/Microsoft.EdgeOrder/EdgeOrder/tspconfig.yaml', API Version: 2024-02-01, SDK Release Type: beta, and CommitSHA: '3d1de464b5576fa149aed429795f6030313e31bb' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6522456 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-mgmt-edgeorder/CHANGELOG.md | 181 + .../azure-mgmt-edgeorder/MANIFEST.in | 9 +- sdk/edgeorder/azure-mgmt-edgeorder/README.md | 6 +- sdk/edgeorder/azure-mgmt-edgeorder/_meta.json | 11 - .../azure-mgmt-edgeorder/_metadata.json | 11 + sdk/edgeorder/azure-mgmt-edgeorder/api.md | 3284 +++++++++++++ .../azure-mgmt-edgeorder/api.metadata.yml | 3 + .../apiview-properties.json | 166 + .../azure-mgmt-edgeorder/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure/mgmt/edgeorder/__init__.py | 14 +- .../azure/mgmt/edgeorder/_client.py | 160 + .../azure/mgmt/edgeorder/_configuration.py | 35 +- .../_edge_order_management_client.py | 111 - .../azure/mgmt/edgeorder/_patch.py | 13 +- .../azure/mgmt/edgeorder/_utils/__init__.py | 6 + .../azure/mgmt/edgeorder/_utils/model_base.py | 1770 +++++++ .../serialization.py} | 737 +-- .../azure/mgmt/edgeorder/_utils/utils.py | 40 + .../azure/mgmt/edgeorder/_vendor.py | 26 - .../azure/mgmt/edgeorder/_version.py | 4 +- .../azure/mgmt/edgeorder/aio/__init__.py | 14 +- .../azure/mgmt/edgeorder/aio/_client.py | 164 + .../mgmt/edgeorder/aio/_configuration.py | 35 +- .../aio/_edge_order_management_client.py | 113 - .../azure/mgmt/edgeorder/aio/_patch.py | 13 +- .../azure/mgmt/edgeorder/aio/_vendor.py | 26 - .../mgmt/edgeorder/aio/operations/__init__.py | 24 +- ...nt_client_operations.py => _operations.py} | 3782 +++++++++------ .../mgmt/edgeorder/aio/operations/_patch.py | 13 +- .../azure/mgmt/edgeorder/models/__init__.py | 271 +- ...r_management_client_enums.py => _enums.py} | 168 +- .../azure/mgmt/edgeorder/models/_models.py | 3414 +++++++++++++ .../mgmt/edgeorder/models/_models_py3.py | 3147 ------------ .../azure/mgmt/edgeorder/models/_patch.py | 13 +- .../mgmt/edgeorder/operations/__init__.py | 24 +- ...nt_client_operations.py => _operations.py} | 4238 ++++++++++------- .../azure/mgmt/edgeorder/operations/_patch.py | 13 +- .../azure/mgmt/edgeorder/types.py | 2040 ++++++++ .../generated_samples/cancel_order_item.py | 10 +- .../generated_samples/create_address.py | 11 +- .../generated_samples/create_order_item.py | 13 +- .../delete_address_by_name.py | 10 +- .../delete_order_item_by_name.py | 10 +- .../generated_samples/get_address_by_name.py | 10 +- .../generated_samples/get_order_by_name.py | 10 +- .../get_order_item_by_name.py | 10 +- .../list_addresses_at_resource_group_level.py | 8 +- .../list_addresses_at_subscription_level.py | 8 +- .../generated_samples/list_configurations.py | 26 +- .../generated_samples/list_operations.py | 6 +- .../list_order_at_resource_group_level.py | 8 +- .../list_order_at_subscription_level.py | 8 +- ...ist_order_items_at_resource_group_level.py | 8 +- .../list_order_items_at_subscription_level.py | 8 +- .../list_product_families.py | 8 +- .../list_product_families_metadata.py | 8 +- .../generated_samples/return_order_item.py | 10 +- .../generated_samples/update_address.py | 10 +- .../generated_samples/update_order_item.py | 10 +- .../generated_tests/conftest.py | 4 +- .../test_edge_order_management.py | 526 -- ...e_order_management_addresses_operations.py | 144 + ...r_management_addresses_operations_async.py | 151 + .../test_edge_order_management_async.py | 545 --- .../test_edge_order_management_operations.py | 27 + ..._edge_order_management_operations_async.py | 28 + ...order_management_order_items_operations.py | 445 ++ ...management_order_items_operations_async.py | 454 ++ ...edge_order_management_orders_operations.py | 49 + ...rder_management_orders_operations_async.py | 50 + ..._products_and_configurations_operations.py | 82 + ...cts_and_configurations_operations_async.py | 83 + .../azure-mgmt-edgeorder/pyproject.toml | 82 + .../azure-mgmt-edgeorder/sdk_packaging.toml | 8 - sdk/edgeorder/azure-mgmt-edgeorder/setup.py | 85 - .../azure-mgmt-edgeorder/tsp-location.yaml | 4 + 77 files changed, 18559 insertions(+), 8521 deletions(-) delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/_meta.json create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/_metadata.json create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/api.md create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/api.metadata.yml create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/apiview-properties.json create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_client.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/__init__.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/model_base.py rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{_serialization.py => _utils/serialization.py} (76%) create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/utils.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_vendor.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_client.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_vendor.py rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/{_edge_order_management_client_operations.py => _operations.py} (53%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/{_edge_order_management_client_enums.py => _enums.py} (62%) create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models_py3.py rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/{_edge_order_management_client_operations.py => _operations.py} (57%) create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/types.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_addresses_operations.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_addresses_operations_async.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_async.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_operations.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_operations_async.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_order_items_operations.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_order_items_operations_async.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_orders_operations.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_orders_operations_async.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_products_and_configurations_operations.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_products_and_configurations_operations_async.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/sdk_packaging.toml delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/setup.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/tsp-location.yaml diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md index ff4bf76d39d3..0d17194753a7 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md +++ b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md @@ -1,5 +1,186 @@ # Release History +## 3.0.0b1 (2026-07-06) + +### Features Added + + - Client `EdgeOrderManagementClient` added parameter `cloud_setting` in method `__init__` + - Client `EdgeOrderManagementClient` added method `send_request` + - Client `EdgeOrderManagementClient` added operation group `operations` + - Client `EdgeOrderManagementClient` added operation group `addresses` + - Client `EdgeOrderManagementClient` added operation group `order_items` + - Client `EdgeOrderManagementClient` added operation group `orders` + - Client `EdgeOrderManagementClient` added operation group `products_and_configurations` + - Model `AddressProperties` added property `address_classification` + - Model `AddressProperties` added property `provisioning_state` + - Model `AddressResource` added property `properties` + - Model `AddressUpdateParameter` added property `properties` + - Enum `AvailabilityStage` added member `DISCOVERABLE` + - Model `BasicInformation` added property `fulfilled_by` + - Model `BillingMeterDetails` added property `term_type_details` + - Model `CommonProperties` added property `fulfilled_by` + - Model `ConfigurationProperties` added property `provisioning_support` + - Model `ConfigurationProperties` added property `child_configuration_types` + - Model `ConfigurationProperties` added property `grouped_child_configurations` + - Model `ConfigurationProperties` added property `supported_term_commitment_durations` + - Model `ConfigurationProperties` added property `fulfilled_by` + - Model `ConfigurationsRequest` added property `configuration_filter` + - Model `DeviceDetails` added property `display_serial_number` + - Model `DeviceDetails` added property `provisioning_support` + - Model `DeviceDetails` added property `provisioning_details` + - Model `HierarchyInformation` added property `configuration_id_display_name` + - Enum `LinkType` added member `DISCOVERABLE` + - Model `OrderItemDetails` added property `order_item_mode` + - Model `OrderItemDetails` added property `site_details` + - Model `OrderItemResource` added property `properties` + - Model `OrderItemResource` added property `identity` + - Enum `OrderItemType` added member `EXTERNAL` + - Model `OrderItemUpdateParameter` added property `properties` + - Model `OrderItemUpdateParameter` added property `identity` + - Model `OrderResource` added property `properties` + - Model `Preferences` added property `term_commitment_preferences` + - Model `ProductDetails` added property `identification_type` + - Model `ProductDetails` added property `parent_device_details` + - Model `ProductDetails` added property `parent_provisioning_details` + - Model `ProductDetails` added property `opt_in_additional_configurations` + - Model `ProductDetails` added property `child_configuration_device_details` + - Model `ProductDetails` added property `term_commitment_information` + - Model `ProductFamilyProperties` added property `fulfilled_by` + - Model `ProductLineProperties` added property `fulfilled_by` + - Model `ProductProperties` added property `fulfilled_by` + - Model `ProxyResource` added property `system_data` + - Model `Resource` added property `system_data` + - Model `ResourceIdentity` added property `user_assigned_identities` + - Enum `StageName` added member `READY_TO_SETUP` + - Model `TrackedResource` added property `system_data` + - Added model `AdditionalConfiguration` + - Added enum `AddressClassification` + - Added model `AddressUpdateProperties` + - Added enum `AutoProvisioningStatus` + - Added model `CategoryInformation` + - Added model `ChildConfiguration` + - Added model `ChildConfigurationFilter` + - Added model `ChildConfigurationProperties` + - Added enum `ChildConfigurationType` + - Added model `ConfigurationDeviceDetails` + - Added model `ConfigurationFilter` + - Added model `DevicePresenceVerificationDetails` + - Added enum `DevicePresenceVerificationStatus` + - Added enum `FulfillmentType` + - Added model `GroupedChildConfigurations` + - Added enum `IdentificationType` + - Added model `OrderItemDetailsUpdateParameter` + - Added model `OrderItemProperties` + - Added model `OrderItemUpdateProperties` + - Added enum `OrderMode` + - Added model `OrderProperties` + - Added model `ProductDetailsUpdateParameter` + - Added model `ProvisioningDetails` + - Added enum `ProvisioningState` + - Added enum `ProvisioningSupport` + - Added model `SiteDetails` + - Added model `TermCommitmentInformation` + - Added model `TermCommitmentPreferences` + - Added enum `TermCommitmentType` + - Added model `TermTypeDetails` + - Added model `UserAssignedIdentity` + +### Breaking Changes + + - Deleted or renamed client method `EdgeOrderManagementClient.begin_create_address` + - Deleted or renamed client method `EdgeOrderManagementClient.begin_create_order_item` + - Deleted or renamed client method `EdgeOrderManagementClient.begin_delete_address_by_name` + - Deleted or renamed client method `EdgeOrderManagementClient.begin_delete_order_item_by_name` + - Deleted or renamed client method `EdgeOrderManagementClient.begin_return_order_item` + - Deleted or renamed client method `EdgeOrderManagementClient.begin_update_address` + - Deleted or renamed client method `EdgeOrderManagementClient.begin_update_order_item` + - Deleted or renamed client method `EdgeOrderManagementClient.cancel_order_item` + - Deleted or renamed client method `EdgeOrderManagementClient.get_address_by_name` + - Deleted or renamed client method `EdgeOrderManagementClient.get_order_by_name` + - Deleted or renamed client method `EdgeOrderManagementClient.get_order_item_by_name` + - Deleted or renamed client method `EdgeOrderManagementClient.list_addresses_at_resource_group_level` + - Deleted or renamed client method `EdgeOrderManagementClient.list_addresses_at_subscription_level` + - Deleted or renamed client method `EdgeOrderManagementClient.list_configurations` + - Deleted or renamed client method `EdgeOrderManagementClient.list_operations` + - Deleted or renamed client method `EdgeOrderManagementClient.list_order_at_resource_group_level` + - Deleted or renamed client method `EdgeOrderManagementClient.list_order_at_subscription_level` + - Deleted or renamed client method `EdgeOrderManagementClient.list_order_items_at_resource_group_level` + - Deleted or renamed client method `EdgeOrderManagementClient.list_order_items_at_subscription_level` + - Deleted or renamed client method `EdgeOrderManagementClient.list_product_families` + - Deleted or renamed client method `EdgeOrderManagementClient.list_product_families_metadata` + - Model `AddressResource` deleted or renamed its instance variable `shipping_address` + - Model `AddressResource` deleted or renamed its instance variable `contact_details` + - Model `AddressResource` deleted or renamed its instance variable `address_validation_status` + - Model `AddressUpdateParameter` deleted or renamed its instance variable `shipping_address` + - Model `AddressUpdateParameter` deleted or renamed its instance variable `contact_details` + - Model `Configuration` deleted or renamed its instance variable `display_name` + - Model `Configuration` deleted or renamed its instance variable `description` + - Model `Configuration` deleted or renamed its instance variable `image_information` + - Model `Configuration` deleted or renamed its instance variable `cost_information` + - Model `Configuration` deleted or renamed its instance variable `availability_information` + - Model `Configuration` deleted or renamed its instance variable `hierarchy_information` + - Model `Configuration` deleted or renamed its instance variable `filterable_properties` + - Model `Configuration` deleted or renamed its instance variable `specifications` + - Model `Configuration` deleted or renamed its instance variable `dimensions` + - Model `ConfigurationsRequest` deleted or renamed its instance variable `configuration_filters` + - Model `OrderItemDetails` deleted or renamed its instance variable `management_rp_details` + - Model `OrderItemResource` deleted or renamed its instance variable `order_item_details` + - Model `OrderItemResource` deleted or renamed its instance variable `address_details` + - Model `OrderItemResource` deleted or renamed its instance variable `start_time` + - Model `OrderItemResource` deleted or renamed its instance variable `order_id` + - Model `OrderItemUpdateParameter` deleted or renamed its instance variable `forward_address` + - Model `OrderItemUpdateParameter` deleted or renamed its instance variable `preferences` + - Model `OrderItemUpdateParameter` deleted or renamed its instance variable `notification_email_list` + - Model `OrderResource` deleted or renamed its instance variable `order_item_ids` + - Model `OrderResource` deleted or renamed its instance variable `current_stage` + - Model `OrderResource` deleted or renamed its instance variable `order_stage_history` + - Model `Product` deleted or renamed its instance variable `display_name` + - Model `Product` deleted or renamed its instance variable `description` + - Model `Product` deleted or renamed its instance variable `image_information` + - Model `Product` deleted or renamed its instance variable `cost_information` + - Model `Product` deleted or renamed its instance variable `availability_information` + - Model `Product` deleted or renamed its instance variable `hierarchy_information` + - Model `Product` deleted or renamed its instance variable `filterable_properties` + - Model `Product` deleted or renamed its instance variable `configurations` + - Model `ProductDetails` deleted or renamed its instance variable `count` + - Model `ProductDetails` deleted or renamed its instance variable `device_details` + - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `display_name` + - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `description` + - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `image_information` + - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `cost_information` + - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `availability_information` + - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `hierarchy_information` + - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `filterable_properties` + - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `product_lines` + - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `resource_provider_details` + - Model `ProductFamily` deleted or renamed its instance variable `display_name` + - Model `ProductFamily` deleted or renamed its instance variable `description` + - Model `ProductFamily` deleted or renamed its instance variable `image_information` + - Model `ProductFamily` deleted or renamed its instance variable `cost_information` + - Model `ProductFamily` deleted or renamed its instance variable `availability_information` + - Model `ProductFamily` deleted or renamed its instance variable `hierarchy_information` + - Model `ProductFamily` deleted or renamed its instance variable `filterable_properties` + - Model `ProductFamily` deleted or renamed its instance variable `product_lines` + - Model `ProductFamily` deleted or renamed its instance variable `resource_provider_details` + - Model `ProductLine` deleted or renamed its instance variable `display_name` + - Model `ProductLine` deleted or renamed its instance variable `description` + - Model `ProductLine` deleted or renamed its instance variable `image_information` + - Model `ProductLine` deleted or renamed its instance variable `cost_information` + - Model `ProductLine` deleted or renamed its instance variable `availability_information` + - Model `ProductLine` deleted or renamed its instance variable `hierarchy_information` + - Model `ProductLine` deleted or renamed its instance variable `filterable_properties` + - Model `ProductLine` deleted or renamed its instance variable `products` + - Deleted or renamed model `AddressResourceList` + - Deleted or renamed model `ConfigurationFilters` + - Deleted or renamed model `Configurations` + - Deleted or renamed model `OperationListResult` + - Deleted or renamed model `OrderItemResourceList` + - Deleted or renamed model `OrderResourceList` + - Deleted or renamed model `ProductFamilies` + - Deleted or renamed model `ProductFamiliesMetadata` + - Deleted or renamed model `ShippingDetails` + - Deleted or renamed model `EdgeOrderManagementClientOperationsMixin` + ## 2.0.0 (2024-10-30) ### Breaking Changes diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/MANIFEST.in b/sdk/edgeorder/azure-mgmt-edgeorder/MANIFEST.in index 315de62d5a6e..bc732b1dadd8 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/MANIFEST.in +++ b/sdk/edgeorder/azure-mgmt-edgeorder/MANIFEST.in @@ -1,8 +1,7 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/edgeorder/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/README.md b/sdk/edgeorder/azure-mgmt-edgeorder/README.md index e82b1e4d3eda..455cdeb2398e 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/README.md +++ b/sdk/edgeorder/azure-mgmt-edgeorder/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Edge Order Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json b/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json deleted file mode 100644 index 6164984b1858..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "2776cb32cd6ca9ea953a13ae26c954b989e83367", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.19.0", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/edgeorder/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2021-12 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.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/_metadata.json b/sdk/edgeorder/azure-mgmt-edgeorder/_metadata.json new file mode 100644 index 000000000000..052cf5758cde --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/_metadata.json @@ -0,0 +1,11 @@ +{ + "apiVersion": "2024-02-01", + "apiVersions": { + "Microsoft.EdgeOrder": "2024-02-01" + }, + "commit": "3d1de464b5576fa149aed429795f6030313e31bb", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/edgeorder/resource-manager/Microsoft.EdgeOrder/EdgeOrder", + "emitterVersion": "0.63.2", + "httpClientPythonVersion": "^0.34.0" +} \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/api.md b/sdk/edgeorder/azure-mgmt-edgeorder/api.md new file mode 100644 index 000000000000..96ac1b27c840 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/api.md @@ -0,0 +1,3284 @@ +```py +namespace azure.mgmt.edgeorder + + class azure.mgmt.edgeorder.EdgeOrderManagementClient: implements ContextManager + addresses: AddressesOperations + operations: Operations + order_items: OrderItemsOperations + orders: OrdersOperations + products_and_configurations: ProductsAndConfigurationsOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.edgeorder.aio + + class azure.mgmt.edgeorder.aio.EdgeOrderManagementClient: implements AsyncContextManager + addresses: AddressesOperations + operations: Operations + order_items: OrderItemsOperations + orders: OrdersOperations + products_and_configurations: ProductsAndConfigurationsOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.edgeorder.aio.operations + + class azure.mgmt.edgeorder.aio.operations.AddressesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: AddressResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AddressResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: AddressResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AddressResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AddressResource]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + address_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: AddressUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> AsyncLROPoller[AddressResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: AddressUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> AsyncLROPoller[AddressResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> AsyncLROPoller[AddressResource]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + address_name: str, + **kwargs: Any + ) -> AddressResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + *, + filter: Optional[str] = ..., + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncItemPaged[AddressResource]: ... + + @distributed_trace + def list_by_subscription( + self, + *, + filter: Optional[str] = ..., + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncItemPaged[AddressResource]: ... + + + class azure.mgmt.edgeorder.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.edgeorder.aio.operations.OrderItemsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: OrderItemResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[OrderItemResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: OrderItemResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[OrderItemResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[OrderItemResource]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + order_item_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: ReturnOrderItemDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: ReturnOrderItemDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: OrderItemUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> AsyncLROPoller[OrderItemResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: OrderItemUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> AsyncLROPoller[OrderItemResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> AsyncLROPoller[OrderItemResource]: ... + + @overload + async def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + async def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + async def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + order_item_name: str, + *, + expand: Optional[str] = ..., + **kwargs: Any + ) -> OrderItemResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + *, + expand: Optional[str] = ..., + filter: Optional[str] = ..., + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncItemPaged[OrderItemResource]: ... + + @distributed_trace + def list_by_subscription( + self, + *, + expand: Optional[str] = ..., + filter: Optional[str] = ..., + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncItemPaged[OrderItemResource]: ... + + + class azure.mgmt.edgeorder.aio.operations.OrdersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + location: str, + order_name: str, + **kwargs: Any + ) -> OrderResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + *, + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncItemPaged[OrderResource]: ... + + @distributed_trace + def list_by_subscription( + self, + *, + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncItemPaged[OrderResource]: ... + + + class azure.mgmt.edgeorder.aio.operations.ProductsAndConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def list_configurations( + self, + configurations_request: ConfigurationsRequest, + *, + content_type: str = "application/json", + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Configuration]: ... + + @overload + def list_configurations( + self, + configurations_request: ConfigurationsRequest, + *, + content_type: str = "application/json", + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Configuration]: ... + + @overload + def list_configurations( + self, + configurations_request: IO[bytes], + *, + content_type: str = "application/json", + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Configuration]: ... + + @overload + def list_product_families( + self, + product_families_request: ProductFamiliesRequest, + *, + content_type: str = "application/json", + expand: Optional[str] = ..., + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ProductFamily]: ... + + @overload + def list_product_families( + self, + product_families_request: ProductFamiliesRequest, + *, + content_type: str = "application/json", + expand: Optional[str] = ..., + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ProductFamily]: ... + + @overload + def list_product_families( + self, + product_families_request: IO[bytes], + *, + content_type: str = "application/json", + expand: Optional[str] = ..., + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ProductFamily]: ... + + @distributed_trace + def list_product_families_metadata( + self, + *, + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ProductFamiliesMetadataDetails]: ... + + +namespace azure.mgmt.edgeorder.models + + class azure.mgmt.edgeorder.models.ActionStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWED = "Allowed" + NOT_ALLOWED = "NotAllowed" + + + class azure.mgmt.edgeorder.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.edgeorder.models.AdditionalConfiguration(_Model): + hierarchy_information: HierarchyInformation + provisioning_details: Optional[list[ProvisioningDetails]] + quantity: int + + @overload + def __init__( + self, + *, + hierarchy_information: HierarchyInformation, + provisioning_details: Optional[list[ProvisioningDetails]] = ..., + quantity: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.AddressClassification(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SHIPPING = "Shipping" + SITE = "Site" + + + class azure.mgmt.edgeorder.models.AddressDetails(_Model): + forward_address: AddressProperties + return_address: Optional[AddressProperties] + + @overload + def __init__( + self, + *, + forward_address: AddressProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.AddressProperties(_Model): + address_classification: Optional[Union[str, AddressClassification]] + address_validation_status: Optional[Union[str, AddressValidationStatus]] + contact_details: Optional[ContactDetails] + provisioning_state: Optional[Union[str, ProvisioningState]] + shipping_address: Optional[ShippingAddress] + + @overload + def __init__( + self, + *, + address_classification: Optional[Union[str, AddressClassification]] = ..., + contact_details: Optional[ContactDetails] = ..., + shipping_address: Optional[ShippingAddress] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.AddressResource(TrackedResource): + id: str + location: str + name: str + properties: AddressProperties + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + location: str, + properties: AddressProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.edgeorder.models.AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMMERCIAL = "Commercial" + NONE = "None" + RESIDENTIAL = "Residential" + + + class azure.mgmt.edgeorder.models.AddressUpdateParameter(_Model): + properties: Optional[AddressUpdateProperties] + tags: Optional[dict[str, str]] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[AddressUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.edgeorder.models.AddressUpdateProperties(_Model): + contact_details: Optional[ContactDetails] + shipping_address: Optional[ShippingAddress] + + @overload + def __init__( + self, + *, + contact_details: Optional[ContactDetails] = ..., + shipping_address: Optional[ShippingAddress] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AMBIGUOUS = "Ambiguous" + INVALID = "Invalid" + VALID = "Valid" + + + class azure.mgmt.edgeorder.models.AutoProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.edgeorder.models.AvailabilityInformation(_Model): + availability_stage: Optional[Union[str, AvailabilityStage]] + disabled_reason: Optional[Union[str, DisabledReason]] + disabled_reason_message: Optional[str] + + + class azure.mgmt.edgeorder.models.AvailabilityStage(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVAILABLE = "Available" + COMING_SOON = "ComingSoon" + DEPRECATED = "Deprecated" + DISCOVERABLE = "Discoverable" + PREVIEW = "Preview" + SIGNUP = "Signup" + UNAVAILABLE = "Unavailable" + + + class azure.mgmt.edgeorder.models.BasicInformation(_Model): + availability_information: Optional[AvailabilityInformation] + cost_information: Optional[CostInformation] + description: Optional[Description] + display_name: Optional[str] + fulfilled_by: Optional[Union[str, FulfillmentType]] + hierarchy_information: Optional[HierarchyInformation] + image_information: Optional[list[ImageInformation]] + + + class azure.mgmt.edgeorder.models.BillingMeterDetails(_Model): + frequency: Optional[str] + meter_details: Optional[MeterDetails] + metering_type: Optional[Union[str, MeteringType]] + name: Optional[str] + term_type_details: Optional[TermTypeDetails] + + + class azure.mgmt.edgeorder.models.BillingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PAV2 = "Pav2" + PURCHASE = "Purchase" + + + class azure.mgmt.edgeorder.models.CancellationReason(_Model): + reason: str + + @overload + def __init__( + self, + *, + reason: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.CategoryInformation(_Model): + category_display_name: Optional[str] + category_name: Optional[str] + description: Optional[str] + links: Optional[list[Link]] + + @overload + def __init__( + self, + *, + category_display_name: Optional[str] = ..., + category_name: Optional[str] = ..., + description: Optional[str] = ..., + links: Optional[list[Link]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ChargingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PER_DEVICE = "PerDevice" + PER_ORDER = "PerOrder" + + + class azure.mgmt.edgeorder.models.ChildConfiguration(_Model): + properties: Optional[ChildConfigurationProperties] + + + class azure.mgmt.edgeorder.models.ChildConfigurationFilter(_Model): + child_configuration_types: Optional[list[Union[str, ChildConfigurationType]]] + hierarchy_informations: Optional[list[HierarchyInformation]] + + @overload + def __init__( + self, + *, + child_configuration_types: Optional[list[Union[str, ChildConfigurationType]]] = ..., + hierarchy_informations: Optional[list[HierarchyInformation]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ChildConfigurationProperties(_Model): + availability_information: Optional[AvailabilityInformation] + child_configuration_type: Optional[Union[str, ChildConfigurationType]] + child_configuration_types: Optional[list[Union[str, ChildConfigurationType]]] + cost_information: Optional[CostInformation] + description: Optional[Description] + dimensions: Optional[Dimensions] + display_name: Optional[str] + filterable_properties: Optional[list[FilterableProperty]] + fulfilled_by: Optional[Union[str, FulfillmentType]] + grouped_child_configurations: Optional[list[GroupedChildConfigurations]] + hierarchy_information: Optional[HierarchyInformation] + image_information: Optional[list[ImageInformation]] + is_part_of_base_configuration: Optional[bool] + maximum_quantity: Optional[int] + minimum_quantity: Optional[int] + provisioning_support: Optional[Union[str, ProvisioningSupport]] + specifications: Optional[list[Specification]] + supported_term_commitment_durations: Optional[list[timedelta]] + + + class azure.mgmt.edgeorder.models.ChildConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ADDITIONAL_CONFIGURATION = "AdditionalConfiguration" + DEVICE_CONFIGURATION = "DeviceConfiguration" + + + class azure.mgmt.edgeorder.models.CommonProperties(BasicInformation): + availability_information: AvailabilityInformation + cost_information: CostInformation + description: Description + display_name: str + filterable_properties: Optional[list[FilterableProperty]] + fulfilled_by: Union[str, FulfillmentType] + hierarchy_information: HierarchyInformation + image_information: list[ImageInformation] + + + class azure.mgmt.edgeorder.models.Configuration(_Model): + properties: Optional[ConfigurationProperties] + + + class azure.mgmt.edgeorder.models.ConfigurationDeviceDetails(_Model): + device_details: Optional[list[DeviceDetails]] + display_info: Optional[DisplayInfo] + hierarchy_information: Optional[HierarchyInformation] + identification_type: Optional[Union[str, IdentificationType]] + quantity: Optional[int] + term_commitment_information: Optional[TermCommitmentInformation] + + @overload + def __init__( + self, + *, + display_info: Optional[DisplayInfo] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ConfigurationFilter(_Model): + child_configuration_filter: Optional[ChildConfigurationFilter] + filterable_property: Optional[list[FilterableProperty]] + hierarchy_information: HierarchyInformation + + @overload + def __init__( + self, + *, + child_configuration_filter: Optional[ChildConfigurationFilter] = ..., + filterable_property: Optional[list[FilterableProperty]] = ..., + hierarchy_information: HierarchyInformation + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ConfigurationProperties(CommonProperties): + availability_information: AvailabilityInformation + child_configuration_types: Optional[list[Union[str, ChildConfigurationType]]] + cost_information: CostInformation + description: Description + dimensions: Optional[Dimensions] + display_name: str + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + grouped_child_configurations: Optional[list[GroupedChildConfigurations]] + hierarchy_information: HierarchyInformation + image_information: list[ImageInformation] + provisioning_support: Optional[Union[str, ProvisioningSupport]] + specifications: Optional[list[Specification]] + supported_term_commitment_durations: Optional[list[timedelta]] + + + class azure.mgmt.edgeorder.models.ConfigurationsRequest(_Model): + configuration_filter: Optional[ConfigurationFilter] + customer_subscription_details: Optional[CustomerSubscriptionDetails] + + @overload + def __init__( + self, + *, + configuration_filter: Optional[ConfigurationFilter] = ..., + customer_subscription_details: Optional[CustomerSubscriptionDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ContactDetails(_Model): + contact_name: Optional[str] + email_list: Optional[list[str]] + mobile: Optional[str] + phone: Optional[str] + phone_extension: Optional[str] + + @overload + def __init__( + self, + *, + contact_name: Optional[str] = ..., + email_list: Optional[list[str]] = ..., + mobile: Optional[str] = ..., + phone: Optional[str] = ..., + phone_extension: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.CostInformation(_Model): + billing_info_url: Optional[str] + billing_meter_details: Optional[list[BillingMeterDetails]] + + + class azure.mgmt.edgeorder.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.edgeorder.models.CustomerSubscriptionDetails(_Model): + location_placement_id: Optional[str] + quota_id: str + registered_features: Optional[list[CustomerSubscriptionRegisteredFeatures]] + + @overload + def __init__( + self, + *, + location_placement_id: Optional[str] = ..., + quota_id: str, + registered_features: Optional[list[CustomerSubscriptionRegisteredFeatures]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.CustomerSubscriptionRegisteredFeatures(_Model): + name: Optional[str] + state: Optional[str] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + state: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.Description(_Model): + attributes: Optional[list[str]] + description_type: Optional[Union[str, DescriptionType]] + keywords: Optional[list[str]] + links: Optional[list[Link]] + long_description: Optional[str] + short_description: Optional[str] + + + class azure.mgmt.edgeorder.models.DescriptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BASE = "Base" + + + class azure.mgmt.edgeorder.models.DeviceDetails(_Model): + display_serial_number: Optional[str] + management_resource_id: Optional[str] + management_resource_tenant_id: Optional[str] + provisioning_details: Optional[ProvisioningDetails] + provisioning_support: Optional[Union[str, ProvisioningSupport]] + serial_number: Optional[str] + + + class azure.mgmt.edgeorder.models.DevicePresenceVerificationDetails(_Model): + message: Optional[str] + status: Optional[Union[str, DevicePresenceVerificationStatus]] + + + class azure.mgmt.edgeorder.models.DevicePresenceVerificationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "Completed" + NOT_INITIATED = "NotInitiated" + + + class azure.mgmt.edgeorder.models.Dimensions(_Model): + depth: Optional[float] + height: Optional[float] + length: Optional[float] + length_height_unit: Optional[Union[str, LengthHeightUnit]] + weight: Optional[float] + weight_unit: Optional[Union[str, WeightMeasurementUnit]] + width: Optional[float] + + + class azure.mgmt.edgeorder.models.DisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COUNTRY = "Country" + FEATURE = "Feature" + NONE = "None" + NOT_AVAILABLE = "NotAvailable" + NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" + OFFER_TYPE = "OfferType" + OUT_OF_STOCK = "OutOfStock" + REGION = "Region" + + + class azure.mgmt.edgeorder.models.DisplayInfo(_Model): + configuration_display_name: Optional[str] + product_family_display_name: Optional[str] + + + class azure.mgmt.edgeorder.models.DoubleEncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.edgeorder.models.EncryptionPreferences(_Model): + double_encryption_status: Optional[Union[str, DoubleEncryptionStatus]] + + @overload + def __init__( + self, + *, + double_encryption_status: Optional[Union[str, DoubleEncryptionStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.edgeorder.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.edgeorder.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.FilterableProperty(_Model): + supported_values: list[str] + type: Union[str, SupportedFilterTypes] + + @overload + def __init__( + self, + *, + supported_values: list[str], + type: Union[str, SupportedFilterTypes] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ForwardShippingDetails(_Model): + carrier_display_name: Optional[str] + carrier_name: Optional[str] + tracking_id: Optional[str] + tracking_url: Optional[str] + + + class azure.mgmt.edgeorder.models.FulfillmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXTERNAL = "External" + MICROSOFT = "Microsoft" + + + class azure.mgmt.edgeorder.models.GroupedChildConfigurations(_Model): + category_information: Optional[CategoryInformation] + child_configurations: Optional[list[ChildConfiguration]] + + + class azure.mgmt.edgeorder.models.HierarchyInformation(_Model): + configuration_id_display_name: Optional[str] + configuration_name: Optional[str] + product_family_name: Optional[str] + product_line_name: Optional[str] + product_name: Optional[str] + + @overload + def __init__( + self, + *, + configuration_id_display_name: Optional[str] = ..., + configuration_name: Optional[str] = ..., + product_family_name: Optional[str] = ..., + product_line_name: Optional[str] = ..., + product_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.IdentificationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NOT_SUPPORTED = "NotSupported" + SERIAL_NUMBER = "SerialNumber" + + + class azure.mgmt.edgeorder.models.ImageInformation(_Model): + image_type: Optional[Union[str, ImageType]] + image_url: Optional[str] + + + class azure.mgmt.edgeorder.models.ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BULLET_IMAGE = "BulletImage" + GENERIC_IMAGE = "GenericImage" + MAIN_IMAGE = "MainImage" + + + class azure.mgmt.edgeorder.models.LengthHeightUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CM = "CM" + IN = "IN" + + + class azure.mgmt.edgeorder.models.Link(_Model): + link_type: Optional[Union[str, LinkType]] + link_url: Optional[str] + + + class azure.mgmt.edgeorder.models.LinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISCOVERABLE = "Discoverable" + DOCUMENTATION = "Documentation" + GENERIC = "Generic" + KNOW_MORE = "KnowMore" + SIGN_UP = "SignUp" + SPECIFICATION = "Specification" + TERMS_AND_CONDITIONS = "TermsAndConditions" + + + class azure.mgmt.edgeorder.models.ManagementResourcePreferences(_Model): + preferred_management_resource_id: Optional[str] + + @overload + def __init__( + self, + *, + preferred_management_resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.MeterDetails(_Model): + billing_type: str + charging_type: Optional[Union[str, ChargingType]] + multiplier: Optional[float] + + @overload + def __init__( + self, + *, + billing_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.MeteringType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ADHOC = "Adhoc" + ONE_TIME = "OneTime" + RECURRING = "Recurring" + + + class azure.mgmt.edgeorder.models.NotificationPreference(_Model): + send_notification: bool + stage_name: Union[str, NotificationStageName] + + @overload + def __init__( + self, + *, + send_notification: bool, + stage_name: Union[str, NotificationStageName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DELIVERED = "Delivered" + SHIPPED = "Shipped" + + + class azure.mgmt.edgeorder.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.edgeorder.models.OrderItemCancellationEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLABLE = "Cancellable" + CANCELLABLE_WITH_FEE = "CancellableWithFee" + NOT_CANCELLABLE = "NotCancellable" + + + class azure.mgmt.edgeorder.models.OrderItemDetails(_Model): + cancellation_reason: Optional[str] + cancellation_status: Optional[Union[str, OrderItemCancellationEnum]] + current_stage: Optional[StageDetails] + deletion_status: Optional[Union[str, ActionStatusEnum]] + error: Optional[ErrorDetail] + forward_shipping_details: Optional[ForwardShippingDetails] + management_rp_details_list: Optional[list[ResourceProviderDetails]] + notification_email_list: Optional[list[str]] + order_item_mode: Optional[Union[str, OrderMode]] + order_item_stage_history: Optional[list[StageDetails]] + order_item_type: Union[str, OrderItemType] + preferences: Optional[Preferences] + product_details: ProductDetails + return_reason: Optional[str] + return_status: Optional[Union[str, OrderItemReturnEnum]] + reverse_shipping_details: Optional[ReverseShippingDetails] + site_details: Optional[SiteDetails] + + @overload + def __init__( + self, + *, + notification_email_list: Optional[list[str]] = ..., + order_item_mode: Optional[Union[str, OrderMode]] = ..., + order_item_type: Union[str, OrderItemType], + preferences: Optional[Preferences] = ..., + product_details: ProductDetails, + site_details: Optional[SiteDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.OrderItemDetailsUpdateParameter(_Model): + product_details: Optional[ProductDetailsUpdateParameter] + site_details: Optional[SiteDetails] + + @overload + def __init__( + self, + *, + product_details: Optional[ProductDetailsUpdateParameter] = ..., + site_details: Optional[SiteDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.OrderItemProperties(_Model): + address_details: Optional[AddressDetails] + order_id: str + order_item_details: OrderItemDetails + provisioning_state: Optional[Union[str, ProvisioningState]] + start_time: Optional[datetime] + + @overload + def __init__( + self, + *, + address_details: Optional[AddressDetails] = ..., + order_id: str, + order_item_details: OrderItemDetails + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.OrderItemResource(TrackedResource): + id: str + identity: Optional[ResourceIdentity] + location: str + name: str + properties: OrderItemProperties + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + identity: Optional[ResourceIdentity] = ..., + location: str, + properties: OrderItemProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.edgeorder.models.OrderItemReturnEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NOT_RETURNABLE = "NotReturnable" + RETURNABLE = "Returnable" + RETURNABLE_WITH_FEE = "ReturnableWithFee" + + + class azure.mgmt.edgeorder.models.OrderItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXTERNAL = "External" + PURCHASE = "Purchase" + RENTAL = "Rental" + + + class azure.mgmt.edgeorder.models.OrderItemUpdateParameter(_Model): + identity: Optional[ResourceIdentity] + properties: Optional[OrderItemUpdateProperties] + tags: Optional[dict[str, str]] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + identity: Optional[ResourceIdentity] = ..., + properties: Optional[OrderItemUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.edgeorder.models.OrderItemUpdateProperties(_Model): + forward_address: Optional[AddressProperties] + notification_email_list: Optional[list[str]] + order_item_details: Optional[OrderItemDetailsUpdateParameter] + preferences: Optional[Preferences] + + @overload + def __init__( + self, + *, + forward_address: Optional[AddressProperties] = ..., + notification_email_list: Optional[list[str]] = ..., + order_item_details: Optional[OrderItemDetailsUpdateParameter] = ..., + preferences: Optional[Preferences] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.OrderMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "Default" + DO_NOT_FULFILL = "DoNotFulfill" + + + class azure.mgmt.edgeorder.models.OrderProperties(_Model): + current_stage: Optional[StageDetails] + order_item_ids: Optional[list[str]] + order_mode: Optional[Union[str, OrderMode]] + order_stage_history: Optional[list[StageDetails]] + + + class azure.mgmt.edgeorder.models.OrderResource(ProxyResource): + id: str + name: str + properties: OrderProperties + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: OrderProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.edgeorder.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.edgeorder.models.Pav2MeterDetails(MeterDetails, discriminator='Pav2'): + billing_type: Literal[BillingType.PAV2] + charging_type: Union[str, ChargingType] + meter_guid: Optional[str] + multiplier: float + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.Preferences(_Model): + encryption_preferences: Optional[EncryptionPreferences] + management_resource_preferences: Optional[ManagementResourcePreferences] + notification_preferences: Optional[list[NotificationPreference]] + term_commitment_preferences: Optional[TermCommitmentPreferences] + transport_preferences: Optional[TransportPreferences] + + @overload + def __init__( + self, + *, + encryption_preferences: Optional[EncryptionPreferences] = ..., + management_resource_preferences: Optional[ManagementResourcePreferences] = ..., + notification_preferences: Optional[list[NotificationPreference]] = ..., + term_commitment_preferences: Optional[TermCommitmentPreferences] = ..., + transport_preferences: Optional[TransportPreferences] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.Product(_Model): + properties: Optional[ProductProperties] + + + class azure.mgmt.edgeorder.models.ProductDetails(_Model): + child_configuration_device_details: Optional[list[ConfigurationDeviceDetails]] + display_info: Optional[DisplayInfo] + hierarchy_information: HierarchyInformation + identification_type: Optional[Union[str, IdentificationType]] + opt_in_additional_configurations: Optional[list[AdditionalConfiguration]] + parent_device_details: Optional[DeviceDetails] + parent_provisioning_details: Optional[ProvisioningDetails] + product_double_encryption_status: Optional[Union[str, DoubleEncryptionStatus]] + term_commitment_information: Optional[TermCommitmentInformation] + + @overload + def __init__( + self, + *, + display_info: Optional[DisplayInfo] = ..., + hierarchy_information: HierarchyInformation, + opt_in_additional_configurations: Optional[list[AdditionalConfiguration]] = ..., + parent_provisioning_details: Optional[ProvisioningDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ProductDetailsUpdateParameter(_Model): + parent_provisioning_details: Optional[ProvisioningDetails] + + @overload + def __init__( + self, + *, + parent_provisioning_details: Optional[ProvisioningDetails] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ProductFamiliesMetadataDetails(_Model): + properties: Optional[ProductFamilyProperties] + + + class azure.mgmt.edgeorder.models.ProductFamiliesRequest(_Model): + customer_subscription_details: Optional[CustomerSubscriptionDetails] + filterable_properties: dict[str, list[FilterableProperty]] + + @overload + def __init__( + self, + *, + customer_subscription_details: Optional[CustomerSubscriptionDetails] = ..., + filterable_properties: dict[str, list[FilterableProperty]] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ProductFamily(_Model): + properties: Optional[ProductFamilyProperties] + + + class azure.mgmt.edgeorder.models.ProductFamilyProperties(CommonProperties): + availability_information: AvailabilityInformation + cost_information: CostInformation + description: Description + display_name: str + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + hierarchy_information: HierarchyInformation + image_information: list[ImageInformation] + product_lines: Optional[list[ProductLine]] + resource_provider_details: Optional[list[ResourceProviderDetails]] + + @overload + def __init__( + self, + *, + resource_provider_details: Optional[list[ResourceProviderDetails]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ProductLine(_Model): + properties: Optional[ProductLineProperties] + + + class azure.mgmt.edgeorder.models.ProductLineProperties(CommonProperties): + availability_information: AvailabilityInformation + cost_information: CostInformation + description: Description + display_name: str + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + hierarchy_information: HierarchyInformation + image_information: list[ImageInformation] + products: Optional[list[Product]] + + + class azure.mgmt.edgeorder.models.ProductProperties(CommonProperties): + availability_information: AvailabilityInformation + configurations: Optional[list[Configuration]] + cost_information: CostInformation + description: Description + display_name: str + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + hierarchy_information: HierarchyInformation + image_information: list[ImageInformation] + + + class azure.mgmt.edgeorder.models.ProvisioningDetails(_Model): + auto_provisioning_status: Optional[Union[str, AutoProvisioningStatus]] + device_presence_verification: Optional[DevicePresenceVerificationDetails] + management_resource_arm_id: Optional[str] + provisioning_arm_id: Optional[str] + provisioning_end_point: Optional[str] + quantity: Optional[int] + ready_to_connect_arm_id: Optional[str] + serial_number: Optional[str] + unique_device_identifier: Optional[str] + vendor_name: Optional[str] + + @overload + def __init__( + self, + *, + auto_provisioning_status: Optional[Union[str, AutoProvisioningStatus]] = ..., + device_presence_verification: Optional[DevicePresenceVerificationDetails] = ..., + management_resource_arm_id: Optional[str] = ..., + provisioning_arm_id: Optional[str] = ..., + provisioning_end_point: Optional[str] = ..., + quantity: Optional[int] = ..., + ready_to_connect_arm_id: Optional[str] = ..., + serial_number: Optional[str] = ..., + vendor_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + CREATING = "Creating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.edgeorder.models.ProvisioningSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLOUD_BASED = "CloudBased" + MANUAL = "Manual" + + + class azure.mgmt.edgeorder.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.edgeorder.models.PurchaseMeterDetails(MeterDetails, discriminator='Purchase'): + billing_type: Literal[BillingType.PURCHASE] + charging_type: Union[str, ChargingType] + multiplier: float + product_id: Optional[str] + sku_id: Optional[str] + term_id: Optional[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.edgeorder.models.ResourceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Optional[str] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Optional[str] = ..., + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ResourceProviderDetails(_Model): + resource_provider_namespace: Optional[str] + + + class azure.mgmt.edgeorder.models.ReturnOrderItemDetails(_Model): + return_address: Optional[AddressProperties] + return_reason: str + service_tag: Optional[str] + shipping_box_required: Optional[bool] + + @overload + def __init__( + self, + *, + return_address: Optional[AddressProperties] = ..., + return_reason: str, + service_tag: Optional[str] = ..., + shipping_box_required: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.ReverseShippingDetails(_Model): + carrier_display_name: Optional[str] + carrier_name: Optional[str] + sas_key_for_label: Optional[str] + tracking_id: Optional[str] + tracking_url: Optional[str] + + + class azure.mgmt.edgeorder.models.ShippingAddress(_Model): + address_type: Optional[Union[str, AddressType]] + city: Optional[str] + company_name: Optional[str] + country: str + postal_code: Optional[str] + state_or_province: Optional[str] + street_address1: Optional[str] + street_address2: Optional[str] + street_address3: Optional[str] + zip_extended_code: Optional[str] + + @overload + def __init__( + self, + *, + address_type: Optional[Union[str, AddressType]] = ..., + city: Optional[str] = ..., + company_name: Optional[str] = ..., + country: str, + postal_code: Optional[str] = ..., + state_or_province: Optional[str] = ..., + street_address1: Optional[str] = ..., + street_address2: Optional[str] = ..., + street_address3: Optional[str] = ..., + zip_extended_code: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.SiteDetails(_Model): + site_id: str + + @overload + def __init__( + self, + *, + site_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.Specification(_Model): + name: Optional[str] + value: Optional[str] + + + class azure.mgmt.edgeorder.models.StageDetails(_Model): + display_name: Optional[str] + stage_name: Optional[Union[str, StageName]] + stage_status: Optional[Union[str, StageStatus]] + start_time: Optional[datetime] + + + class azure.mgmt.edgeorder.models.StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "Cancelled" + CONFIRMED = "Confirmed" + DELIVERED = "Delivered" + IN_REVIEW = "InReview" + IN_USE = "InUse" + PLACED = "Placed" + READY_TO_SETUP = "ReadyToSetup" + READY_TO_SHIP = "ReadyToShip" + RETURNED_TO_MICROSOFT = "ReturnedToMicrosoft" + RETURN_COMPLETED = "ReturnCompleted" + RETURN_INITIATED = "ReturnInitiated" + RETURN_PICKED_UP = "ReturnPickedUp" + SHIPPED = "Shipped" + + + class azure.mgmt.edgeorder.models.StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "Cancelled" + CANCELLING = "Cancelling" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + NONE = "None" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.edgeorder.models.SupportedFilterTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DOUBLE_ENCRYPTION_STATUS = "DoubleEncryptionStatus" + SHIP_TO_COUNTRIES = "ShipToCountries" + + + class azure.mgmt.edgeorder.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.TermCommitmentInformation(_Model): + pending_days_for_term: Optional[int] + term_commitment_type: Union[str, TermCommitmentType] + term_commitment_type_duration: Optional[timedelta] + + @overload + def __init__( + self, + *, + term_commitment_type: Union[str, TermCommitmentType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.TermCommitmentPreferences(_Model): + preferred_term_commitment_duration: Optional[timedelta] + preferred_term_commitment_type: Union[str, TermCommitmentType] + + @overload + def __init__( + self, + *, + preferred_term_commitment_duration: Optional[timedelta] = ..., + preferred_term_commitment_type: Union[str, TermCommitmentType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.TermCommitmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + TIMED = "Timed" + TRIAL = "Trial" + + + class azure.mgmt.edgeorder.models.TermTypeDetails(_Model): + term_type: Union[str, TermCommitmentType] + term_type_duration: timedelta + + @overload + def __init__( + self, + *, + term_type: Union[str, TermCommitmentType], + term_type_duration: timedelta + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.TransportPreferences(_Model): + preferred_shipment_type: Union[str, TransportShipmentTypes] + + @overload + def __init__( + self, + *, + preferred_shipment_type: Union[str, TransportShipmentTypes] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.edgeorder.models.TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOMER_MANAGED = "CustomerManaged" + MICROSOFT_MANAGED = "MicrosoftManaged" + + + class azure.mgmt.edgeorder.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + + class azure.mgmt.edgeorder.models.WeightMeasurementUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + KGS = "KGS" + LBS = "LBS" + + +namespace azure.mgmt.edgeorder.operations + + class azure.mgmt.edgeorder.operations.AddressesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: AddressResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AddressResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: AddressResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AddressResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + address_name: str, + address_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AddressResource]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + address_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: AddressUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> LROPoller[AddressResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: AddressUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> LROPoller[AddressResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> LROPoller[AddressResource]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + address_name: str, + **kwargs: Any + ) -> AddressResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + *, + filter: Optional[str] = ..., + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> ItemPaged[AddressResource]: ... + + @distributed_trace + def list_by_subscription( + self, + *, + filter: Optional[str] = ..., + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> ItemPaged[AddressResource]: ... + + + class azure.mgmt.edgeorder.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.edgeorder.operations.OrderItemsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: OrderItemResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[OrderItemResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: OrderItemResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[OrderItemResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[OrderItemResource]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + order_item_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: ReturnOrderItemDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: ReturnOrderItemDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_return_method( + self, + resource_group_name: str, + order_item_name: str, + return_order_item_details: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: OrderItemUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> LROPoller[OrderItemResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: OrderItemUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> LROPoller[OrderItemResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any + ) -> LROPoller[OrderItemResource]: ... + + @overload + def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: CancellationReason, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @overload + def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + order_item_name: str, + *, + expand: Optional[str] = ..., + **kwargs: Any + ) -> OrderItemResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + *, + expand: Optional[str] = ..., + filter: Optional[str] = ..., + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> ItemPaged[OrderItemResource]: ... + + @distributed_trace + def list_by_subscription( + self, + *, + expand: Optional[str] = ..., + filter: Optional[str] = ..., + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> ItemPaged[OrderItemResource]: ... + + + class azure.mgmt.edgeorder.operations.OrdersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + location: str, + order_name: str, + **kwargs: Any + ) -> OrderResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + *, + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> ItemPaged[OrderResource]: ... + + @distributed_trace + def list_by_subscription( + self, + *, + skip_token: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> ItemPaged[OrderResource]: ... + + + class azure.mgmt.edgeorder.operations.ProductsAndConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def list_configurations( + self, + configurations_request: ConfigurationsRequest, + *, + content_type: str = "application/json", + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Configuration]: ... + + @overload + def list_configurations( + self, + configurations_request: ConfigurationsRequest, + *, + content_type: str = "application/json", + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Configuration]: ... + + @overload + def list_configurations( + self, + configurations_request: IO[bytes], + *, + content_type: str = "application/json", + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Configuration]: ... + + @overload + def list_product_families( + self, + product_families_request: ProductFamiliesRequest, + *, + content_type: str = "application/json", + expand: Optional[str] = ..., + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[ProductFamily]: ... + + @overload + def list_product_families( + self, + product_families_request: ProductFamiliesRequest, + *, + content_type: str = "application/json", + expand: Optional[str] = ..., + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[ProductFamily]: ... + + @overload + def list_product_families( + self, + product_families_request: IO[bytes], + *, + content_type: str = "application/json", + expand: Optional[str] = ..., + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[ProductFamily]: ... + + @distributed_trace + def list_product_families_metadata( + self, + *, + skip_token: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[ProductFamiliesMetadataDetails]: ... + + +namespace azure.mgmt.edgeorder.types + + class azure.mgmt.edgeorder.types.AdditionalConfiguration(TypedDict, total=False): + key "hierarchyInformation": Required[HierarchyInformation] + key "quantity": Required[int] + hierarchy_information: HierarchyInformation + provisioningDetails: list[ProvisioningDetails] + provisioning_details: list[ProvisioningDetails] + quantity: int + + + class azure.mgmt.edgeorder.types.AddressDetails(TypedDict, total=False): + key "forwardAddress": Required[AddressProperties] + key "returnAddress": ForwardRef('AddressProperties', module='types') + forward_address: AddressProperties + return_address: AddressProperties + + + class azure.mgmt.edgeorder.types.AddressProperties(TypedDict, total=False): + key "addressClassification": Union[str, AddressClassification] + key "addressValidationStatus": Union[str, AddressValidationStatus] + key "contactDetails": ForwardRef('ContactDetails', module='types') + key "provisioningState": Union[str, ProvisioningState] + key "shippingAddress": ForwardRef('ShippingAddress', module='types') + address_classification: Union[str, AddressClassification] + address_validation_status: Union[str, AddressValidationStatus] + contact_details: ContactDetails + provisioning_state: Union[str, ProvisioningState] + shipping_address: ShippingAddress + + + class azure.mgmt.edgeorder.types.AddressResource(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": Required[AddressProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: AddressProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.edgeorder.types.AddressUpdateParameter(TypedDict, total=False): + key "properties": ForwardRef('AddressUpdateProperties', module='types') + properties: AddressUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.edgeorder.types.AddressUpdateProperties(TypedDict, total=False): + key "contactDetails": ForwardRef('ContactDetails', module='types') + key "shippingAddress": ForwardRef('ShippingAddress', module='types') + contact_details: ContactDetails + shipping_address: ShippingAddress + + + class azure.mgmt.edgeorder.types.AvailabilityInformation(TypedDict, total=False): + key "availabilityStage": Union[str, AvailabilityStage] + key "disabledReason": Union[str, DisabledReason] + key "disabledReasonMessage": str + availability_stage: Union[str, AvailabilityStage] + disabled_reason: Union[str, DisabledReason] + disabled_reason_message: str + + + class azure.mgmt.edgeorder.types.BasicInformation(TypedDict, total=False): + key "availabilityInformation": ForwardRef('AvailabilityInformation', module='types') + key "costInformation": ForwardRef('CostInformation', module='types') + key "description": ForwardRef('Description', module='types') + key "displayName": str + key "fulfilledBy": Union[str, FulfillmentType] + key "hierarchyInformation": ForwardRef('HierarchyInformation', module='types') + availability_information: AvailabilityInformation + cost_information: CostInformation + description: Description + display_name: str + fulfilled_by: Union[str, FulfillmentType] + hierarchy_information: HierarchyInformation + imageInformation: list[ImageInformation] + image_information: list[ImageInformation] + + + class azure.mgmt.edgeorder.types.BillingMeterDetails(TypedDict, total=False): + key "frequency": str + key "meterDetails": ForwardRef('MeterDetails', module='types') + key "meteringType": Union[str, MeteringType] + key "name": str + key "termTypeDetails": ForwardRef('TermTypeDetails', module='types') + frequency: str + meter_details: MeterDetails + metering_type: Union[str, MeteringType] + name: str + term_type_details: TermTypeDetails + + + class azure.mgmt.edgeorder.types.BillingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PAV2 = "Pav2" + PURCHASE = "Purchase" + + + class azure.mgmt.edgeorder.types.CancellationReason(TypedDict, total=False): + key "reason": Required[str] + reason: str + + + class azure.mgmt.edgeorder.types.CategoryInformation(TypedDict, total=False): + key "categoryDisplayName": str + key "categoryName": str + key "description": str + category_display_name: str + category_name: str + description: str + links: list[Link] + + + class azure.mgmt.edgeorder.types.ChildConfiguration(TypedDict, total=False): + key "properties": ForwardRef('ChildConfigurationProperties', module='types') + properties: ChildConfigurationProperties + + + class azure.mgmt.edgeorder.types.ChildConfigurationFilter(TypedDict, total=False): + childConfigurationTypes: list[Union[str, ChildConfigurationType]] + child_configuration_types: list[Union[str, ChildConfigurationType]] + hierarchyInformations: list[HierarchyInformation] + hierarchy_informations: list[HierarchyInformation] + + + class azure.mgmt.edgeorder.types.ChildConfigurationProperties(TypedDict, total=False): + key "availabilityInformation": ForwardRef('AvailabilityInformation', module='types') + key "childConfigurationType": Union[str, ChildConfigurationType] + key "costInformation": ForwardRef('CostInformation', module='types') + key "description": ForwardRef('Description', module='types') + key "dimensions": ForwardRef('Dimensions', module='types') + key "displayName": str + key "fulfilledBy": Union[str, FulfillmentType] + key "hierarchyInformation": ForwardRef('HierarchyInformation', module='types') + key "isPartOfBaseConfiguration": bool + key "maximumQuantity": int + key "minimumQuantity": int + key "provisioningSupport": Union[str, ProvisioningSupport] + availability_information: AvailabilityInformation + childConfigurationTypes: list[Union[str, ChildConfigurationType]] + child_configuration_type: Union[str, ChildConfigurationType] + child_configuration_types: list[Union[str, ChildConfigurationType]] + cost_information: CostInformation + description: Description + dimensions: Dimensions + display_name: str + filterableProperties: list[FilterableProperty] + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + groupedChildConfigurations: list[GroupedChildConfigurations] + grouped_child_configurations: list[GroupedChildConfigurations] + hierarchy_information: HierarchyInformation + imageInformation: list[ImageInformation] + image_information: list[ImageInformation] + is_part_of_base_configuration: bool + maximum_quantity: int + minimum_quantity: int + provisioning_support: Union[str, ProvisioningSupport] + specifications: list[Specification] + supportedTermCommitmentDurations: list[str] + supported_term_commitment_durations: list[str] + + + class azure.mgmt.edgeorder.types.CommonProperties(BasicInformation): + key "availabilityInformation": ForwardRef('AvailabilityInformation', module='types') + key "costInformation": ForwardRef('CostInformation', module='types') + key "description": ForwardRef('Description', module='types') + key "displayName": str + key "fulfilledBy": Union[str, FulfillmentType] + key "hierarchyInformation": ForwardRef('HierarchyInformation', module='types') + availability_information: AvailabilityInformation + cost_information: CostInformation + description: Description + display_name: str + filterableProperties: list[FilterableProperty] + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + hierarchy_information: HierarchyInformation + imageInformation: list[ImageInformation] + image_information: list[ImageInformation] + + + class azure.mgmt.edgeorder.types.Configuration(TypedDict, total=False): + key "properties": ForwardRef('ConfigurationProperties', module='types') + properties: ConfigurationProperties + + + class azure.mgmt.edgeorder.types.ConfigurationDeviceDetails(TypedDict, total=False): + key "displayInfo": ForwardRef('DisplayInfo', module='types') + key "hierarchyInformation": ForwardRef('HierarchyInformation', module='types') + key "identificationType": Union[str, IdentificationType] + key "quantity": int + key "termCommitmentInformation": ForwardRef('TermCommitmentInformation', module='types') + deviceDetails: list[DeviceDetails] + device_details: list[DeviceDetails] + display_info: DisplayInfo + hierarchy_information: HierarchyInformation + identification_type: Union[str, IdentificationType] + quantity: int + term_commitment_information: TermCommitmentInformation + + + class azure.mgmt.edgeorder.types.ConfigurationFilter(TypedDict, total=False): + key "childConfigurationFilter": ForwardRef('ChildConfigurationFilter', module='types') + key "hierarchyInformation": Required[HierarchyInformation] + child_configuration_filter: ChildConfigurationFilter + filterableProperty: list[FilterableProperty] + filterable_property: list[FilterableProperty] + hierarchy_information: HierarchyInformation + + + class azure.mgmt.edgeorder.types.ConfigurationProperties(CommonProperties): + key "availabilityInformation": ForwardRef('AvailabilityInformation', module='types') + key "costInformation": ForwardRef('CostInformation', module='types') + key "description": ForwardRef('Description', module='types') + key "dimensions": ForwardRef('Dimensions', module='types') + key "displayName": str + key "fulfilledBy": Union[str, FulfillmentType] + key "hierarchyInformation": ForwardRef('HierarchyInformation', module='types') + key "provisioningSupport": Union[str, ProvisioningSupport] + availability_information: AvailabilityInformation + childConfigurationTypes: list[Union[str, ChildConfigurationType]] + child_configuration_types: list[Union[str, ChildConfigurationType]] + cost_information: CostInformation + description: Description + dimensions: Dimensions + display_name: str + filterableProperties: list[FilterableProperty] + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + groupedChildConfigurations: list[GroupedChildConfigurations] + grouped_child_configurations: list[GroupedChildConfigurations] + hierarchy_information: HierarchyInformation + imageInformation: list[ImageInformation] + image_information: list[ImageInformation] + provisioning_support: Union[str, ProvisioningSupport] + specifications: list[Specification] + supportedTermCommitmentDurations: list[str] + supported_term_commitment_durations: list[str] + + + class azure.mgmt.edgeorder.types.ConfigurationsRequest(TypedDict, total=False): + key "configurationFilter": ForwardRef('ConfigurationFilter', module='types') + key "customerSubscriptionDetails": ForwardRef('CustomerSubscriptionDetails', module='types') + configuration_filter: ConfigurationFilter + customer_subscription_details: CustomerSubscriptionDetails + + + class azure.mgmt.edgeorder.types.ContactDetails(TypedDict, total=False): + key "contactName": str + key "mobile": str + key "phone": str + key "phoneExtension": str + contact_name: str + emailList: list[str] + email_list: list[str] + mobile: str + phone: str + phone_extension: str + + + class azure.mgmt.edgeorder.types.CostInformation(TypedDict, total=False): + key "billingInfoUrl": str + billingMeterDetails: list[BillingMeterDetails] + billing_info_url: str + billing_meter_details: list[BillingMeterDetails] + + + class azure.mgmt.edgeorder.types.CustomerSubscriptionDetails(TypedDict, total=False): + key "locationPlacementId": str + key "quotaId": Required[str] + location_placement_id: str + quota_id: str + registeredFeatures: list[CustomerSubscriptionRegisteredFeatures] + registered_features: list[CustomerSubscriptionRegisteredFeatures] + + + class azure.mgmt.edgeorder.types.CustomerSubscriptionRegisteredFeatures(TypedDict, total=False): + key "name": str + key "state": str + name: str + state: str + + + class azure.mgmt.edgeorder.types.Description(TypedDict, total=False): + key "descriptionType": Union[str, DescriptionType] + key "longDescription": str + key "shortDescription": str + attributes: list[str] + description_type: Union[str, DescriptionType] + keywords: list[str] + links: list[Link] + long_description: str + short_description: str + + + class azure.mgmt.edgeorder.types.DeviceDetails(TypedDict, total=False): + key "displaySerialNumber": str + key "managementResourceId": str + key "managementResourceTenantId": str + key "provisioningDetails": ForwardRef('ProvisioningDetails', module='types') + key "provisioningSupport": Union[str, ProvisioningSupport] + key "serialNumber": str + display_serial_number: str + management_resource_id: str + management_resource_tenant_id: str + provisioning_details: ProvisioningDetails + provisioning_support: Union[str, ProvisioningSupport] + serial_number: str + + + class azure.mgmt.edgeorder.types.DevicePresenceVerificationDetails(TypedDict, total=False): + key "message": str + key "status": Union[str, DevicePresenceVerificationStatus] + message: str + status: Union[str, DevicePresenceVerificationStatus] + + + class azure.mgmt.edgeorder.types.Dimensions(TypedDict, total=False): + key "depth": float + key "height": float + key "length": float + key "lengthHeightUnit": Union[str, LengthHeightUnit] + key "weight": float + key "weightUnit": Union[str, WeightMeasurementUnit] + key "width": float + depth: float + height: float + length: float + length_height_unit: Union[str, LengthHeightUnit] + weight: float + weight_unit: Union[str, WeightMeasurementUnit] + width: float + + + class azure.mgmt.edgeorder.types.DisplayInfo(TypedDict, total=False): + key "configurationDisplayName": str + key "productFamilyDisplayName": str + configuration_display_name: str + product_family_display_name: str + + + class azure.mgmt.edgeorder.types.EncryptionPreferences(TypedDict, total=False): + key "doubleEncryptionStatus": Union[str, DoubleEncryptionStatus] + double_encryption_status: Union[str, DoubleEncryptionStatus] + + + class azure.mgmt.edgeorder.types.ErrorAdditionalInfo(TypedDict, total=False): + key "info": Any + key "type": str + info: Any + type: str + + + class azure.mgmt.edgeorder.types.ErrorDetail(TypedDict, total=False): + key "code": str + key "message": str + key "target": str + additionalInfo: list[ErrorAdditionalInfo] + additional_info: list[ErrorAdditionalInfo] + code: str + details: list[ErrorDetail] + message: str + target: str + + + class azure.mgmt.edgeorder.types.ErrorResponse(TypedDict, total=False): + key "error": ForwardRef('ErrorDetail', module='types') + error: ErrorDetail + + + class azure.mgmt.edgeorder.types.FilterableProperty(TypedDict, total=False): + key "supportedValues": Required[list[str]] + key "type": Required[Union[str, SupportedFilterTypes]] + supported_values: list[str] + type: Union[str, SupportedFilterTypes] + + + class azure.mgmt.edgeorder.types.ForwardShippingDetails(TypedDict, total=False): + key "carrierDisplayName": str + key "carrierName": str + key "trackingId": str + key "trackingUrl": str + carrier_display_name: str + carrier_name: str + tracking_id: str + tracking_url: str + + + class azure.mgmt.edgeorder.types.GroupedChildConfigurations(TypedDict, total=False): + key "categoryInformation": ForwardRef('CategoryInformation', module='types') + category_information: CategoryInformation + childConfigurations: list[ChildConfiguration] + child_configurations: list[ChildConfiguration] + + + class azure.mgmt.edgeorder.types.HierarchyInformation(TypedDict, total=False): + key "configurationIdDisplayName": str + key "configurationName": str + key "productFamilyName": str + key "productLineName": str + key "productName": str + configuration_id_display_name: str + configuration_name: str + product_family_name: str + product_line_name: str + product_name: str + + + class azure.mgmt.edgeorder.types.ImageInformation(TypedDict, total=False): + key "imageType": Union[str, ImageType] + key "imageUrl": str + image_type: Union[str, ImageType] + image_url: str + + + class azure.mgmt.edgeorder.types.Link(TypedDict, total=False): + key "linkType": Union[str, LinkType] + key "linkUrl": str + link_type: Union[str, LinkType] + link_url: str + + + class azure.mgmt.edgeorder.types.ManagementResourcePreferences(TypedDict, total=False): + key "preferredManagementResourceId": str + preferred_management_resource_id: str + + + class azure.mgmt.edgeorder.types.NotificationPreference(TypedDict, total=False): + key "sendNotification": Required[bool] + key "stageName": Required[Union[str, NotificationStageName]] + send_notification: bool + stage_name: Union[str, NotificationStageName] + + + class azure.mgmt.edgeorder.types.Operation(TypedDict, total=False): + key "actionType": Union[str, ActionType] + key "display": ForwardRef('OperationDisplay', module='types') + key "isDataAction": bool + key "name": str + key "origin": Union[str, Origin] + action_type: Union[str, ActionType] + display: OperationDisplay + is_data_action: bool + name: str + origin: Union[str, Origin] + + + class azure.mgmt.edgeorder.types.OperationDisplay(TypedDict, total=False): + key "description": str + key "operation": str + key "provider": str + key "resource": str + description: str + operation: str + provider: str + resource: str + + + class azure.mgmt.edgeorder.types.OrderItemDetails(TypedDict, total=False): + key "cancellationReason": str + key "cancellationStatus": Union[str, OrderItemCancellationEnum] + key "currentStage": ForwardRef('StageDetails', module='types') + key "deletionStatus": Union[str, ActionStatusEnum] + key "error": ForwardRef('ErrorDetail', module='types') + key "forwardShippingDetails": ForwardRef('ForwardShippingDetails', module='types') + key "orderItemMode": Union[str, OrderMode] + key "orderItemType": Required[Union[str, OrderItemType]] + key "preferences": ForwardRef('Preferences', module='types') + key "productDetails": Required[ProductDetails] + key "returnReason": str + key "returnStatus": Union[str, OrderItemReturnEnum] + key "reverseShippingDetails": ForwardRef('ReverseShippingDetails', module='types') + key "siteDetails": ForwardRef('SiteDetails', module='types') + cancellation_reason: str + cancellation_status: Union[str, OrderItemCancellationEnum] + current_stage: StageDetails + deletion_status: Union[str, ActionStatusEnum] + error: ErrorDetail + forward_shipping_details: ForwardShippingDetails + managementRpDetailsList: list[ResourceProviderDetails] + management_rp_details_list: list[ResourceProviderDetails] + notificationEmailList: list[str] + notification_email_list: list[str] + orderItemStageHistory: list[StageDetails] + order_item_mode: Union[str, OrderMode] + order_item_stage_history: list[StageDetails] + order_item_type: Union[str, OrderItemType] + preferences: Preferences + product_details: ProductDetails + return_reason: str + return_status: Union[str, OrderItemReturnEnum] + reverse_shipping_details: ReverseShippingDetails + site_details: SiteDetails + + + class azure.mgmt.edgeorder.types.OrderItemDetailsUpdateParameter(TypedDict, total=False): + key "productDetails": ForwardRef('ProductDetailsUpdateParameter', module='types') + key "siteDetails": ForwardRef('SiteDetails', module='types') + product_details: ProductDetailsUpdateParameter + site_details: SiteDetails + + + class azure.mgmt.edgeorder.types.OrderItemProperties(TypedDict, total=False): + key "addressDetails": ForwardRef('AddressDetails', module='types') + key "orderId": Required[str] + key "orderItemDetails": Required[OrderItemDetails] + key "provisioningState": Union[str, ProvisioningState] + key "startTime": str + address_details: AddressDetails + order_id: str + order_item_details: OrderItemDetails + provisioning_state: Union[str, ProvisioningState] + start_time: str + + + class azure.mgmt.edgeorder.types.OrderItemResource(TrackedResource): + key "id": str + key "identity": ForwardRef('ResourceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": Required[OrderItemProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ResourceIdentity + location: str + name: str + properties: OrderItemProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.edgeorder.types.OrderItemUpdateParameter(TypedDict, total=False): + key "identity": ForwardRef('ResourceIdentity', module='types') + key "properties": ForwardRef('OrderItemUpdateProperties', module='types') + identity: ResourceIdentity + properties: OrderItemUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.edgeorder.types.OrderItemUpdateProperties(TypedDict, total=False): + key "forwardAddress": ForwardRef('AddressProperties', module='types') + key "orderItemDetails": ForwardRef('OrderItemDetailsUpdateParameter', module='types') + key "preferences": ForwardRef('Preferences', module='types') + forward_address: AddressProperties + notificationEmailList: list[str] + notification_email_list: list[str] + order_item_details: OrderItemDetailsUpdateParameter + preferences: Preferences + + + class azure.mgmt.edgeorder.types.OrderProperties(TypedDict, total=False): + key "currentStage": ForwardRef('StageDetails', module='types') + key "orderMode": Union[str, OrderMode] + current_stage: StageDetails + orderItemIds: list[str] + orderStageHistory: list[StageDetails] + order_item_ids: list[str] + order_mode: Union[str, OrderMode] + order_stage_history: list[StageDetails] + + + class azure.mgmt.edgeorder.types.OrderResource(ProxyResource): + key "id": str + key "name": str + key "properties": Required[OrderProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: OrderProperties + system_data: SystemData + type: str + + + class azure.mgmt.edgeorder.types.Pav2MeterDetails(TypedDict, total=False): + key "billingType": Required[Literal[BillingType.PAV2]] + key "chargingType": Union[str, ChargingType] + key "meterGuid": str + key "multiplier": float + billing_type: Literal[BillingType.PAV2] + charging_type: Union[str, ChargingType] + meter_guid: str + multiplier: float + + + class azure.mgmt.edgeorder.types.Preferences(TypedDict, total=False): + key "encryptionPreferences": ForwardRef('EncryptionPreferences', module='types') + key "managementResourcePreferences": ForwardRef('ManagementResourcePreferences', module='types') + key "termCommitmentPreferences": ForwardRef('TermCommitmentPreferences', module='types') + key "transportPreferences": ForwardRef('TransportPreferences', module='types') + encryption_preferences: EncryptionPreferences + management_resource_preferences: ManagementResourcePreferences + notificationPreferences: list[NotificationPreference] + notification_preferences: list[NotificationPreference] + term_commitment_preferences: TermCommitmentPreferences + transport_preferences: TransportPreferences + + + class azure.mgmt.edgeorder.types.Product(TypedDict, total=False): + key "properties": ForwardRef('ProductProperties', module='types') + properties: ProductProperties + + + class azure.mgmt.edgeorder.types.ProductDetails(TypedDict, total=False): + key "displayInfo": ForwardRef('DisplayInfo', module='types') + key "hierarchyInformation": Required[HierarchyInformation] + key "identificationType": Union[str, IdentificationType] + key "parentDeviceDetails": ForwardRef('DeviceDetails', module='types') + key "parentProvisioningDetails": ForwardRef('ProvisioningDetails', module='types') + key "productDoubleEncryptionStatus": Union[str, DoubleEncryptionStatus] + key "termCommitmentInformation": ForwardRef('TermCommitmentInformation', module='types') + childConfigurationDeviceDetails: list[ConfigurationDeviceDetails] + child_configuration_device_details: list[ConfigurationDeviceDetails] + display_info: DisplayInfo + hierarchy_information: HierarchyInformation + identification_type: Union[str, IdentificationType] + optInAdditionalConfigurations: list[AdditionalConfiguration] + opt_in_additional_configurations: list[AdditionalConfiguration] + parent_device_details: DeviceDetails + parent_provisioning_details: ProvisioningDetails + product_double_encryption_status: Union[str, DoubleEncryptionStatus] + term_commitment_information: TermCommitmentInformation + + + class azure.mgmt.edgeorder.types.ProductDetailsUpdateParameter(TypedDict, total=False): + key "parentProvisioningDetails": ForwardRef('ProvisioningDetails', module='types') + parent_provisioning_details: ProvisioningDetails + + + class azure.mgmt.edgeorder.types.ProductFamiliesMetadataDetails(TypedDict, total=False): + key "properties": ForwardRef('ProductFamilyProperties', module='types') + properties: ProductFamilyProperties + + + class azure.mgmt.edgeorder.types.ProductFamiliesRequest(TypedDict, total=False): + key "customerSubscriptionDetails": ForwardRef('CustomerSubscriptionDetails', module='types') + key "filterableProperties": Required[dict[str, list[FilterableProperty]]] + customer_subscription_details: CustomerSubscriptionDetails + filterable_properties: dict[str, list[FilterableProperty]] + + + class azure.mgmt.edgeorder.types.ProductFamily(TypedDict, total=False): + key "properties": ForwardRef('ProductFamilyProperties', module='types') + properties: ProductFamilyProperties + + + class azure.mgmt.edgeorder.types.ProductFamilyProperties(CommonProperties): + key "availabilityInformation": ForwardRef('AvailabilityInformation', module='types') + key "costInformation": ForwardRef('CostInformation', module='types') + key "description": ForwardRef('Description', module='types') + key "displayName": str + key "fulfilledBy": Union[str, FulfillmentType] + key "hierarchyInformation": ForwardRef('HierarchyInformation', module='types') + availability_information: AvailabilityInformation + cost_information: CostInformation + description: Description + display_name: str + filterableProperties: list[FilterableProperty] + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + hierarchy_information: HierarchyInformation + imageInformation: list[ImageInformation] + image_information: list[ImageInformation] + productLines: list[ProductLine] + product_lines: list[ProductLine] + resourceProviderDetails: list[ResourceProviderDetails] + resource_provider_details: list[ResourceProviderDetails] + + + class azure.mgmt.edgeorder.types.ProductLine(TypedDict, total=False): + key "properties": ForwardRef('ProductLineProperties', module='types') + properties: ProductLineProperties + + + class azure.mgmt.edgeorder.types.ProductLineProperties(CommonProperties): + key "availabilityInformation": ForwardRef('AvailabilityInformation', module='types') + key "costInformation": ForwardRef('CostInformation', module='types') + key "description": ForwardRef('Description', module='types') + key "displayName": str + key "fulfilledBy": Union[str, FulfillmentType] + key "hierarchyInformation": ForwardRef('HierarchyInformation', module='types') + availability_information: AvailabilityInformation + cost_information: CostInformation + description: Description + display_name: str + filterableProperties: list[FilterableProperty] + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + hierarchy_information: HierarchyInformation + imageInformation: list[ImageInformation] + image_information: list[ImageInformation] + products: list[Product] + + + class azure.mgmt.edgeorder.types.ProductProperties(CommonProperties): + key "availabilityInformation": ForwardRef('AvailabilityInformation', module='types') + key "costInformation": ForwardRef('CostInformation', module='types') + key "description": ForwardRef('Description', module='types') + key "displayName": str + key "fulfilledBy": Union[str, FulfillmentType] + key "hierarchyInformation": ForwardRef('HierarchyInformation', module='types') + availability_information: AvailabilityInformation + configurations: list[Configuration] + cost_information: CostInformation + description: Description + display_name: str + filterableProperties: list[FilterableProperty] + filterable_properties: list[FilterableProperty] + fulfilled_by: Union[str, FulfillmentType] + hierarchy_information: HierarchyInformation + imageInformation: list[ImageInformation] + image_information: list[ImageInformation] + + + class azure.mgmt.edgeorder.types.ProvisioningDetails(TypedDict, total=False): + key "autoProvisioningStatus": Union[str, AutoProvisioningStatus] + key "devicePresenceVerification": ForwardRef('DevicePresenceVerificationDetails', module='types') + key "managementResourceArmId": str + key "provisioningArmId": str + key "provisioningEndPoint": str + key "quantity": int + key "readyToConnectArmId": str + key "serialNumber": str + key "uniqueDeviceIdentifier": str + key "vendorName": str + auto_provisioning_status: Union[str, AutoProvisioningStatus] + device_presence_verification: DevicePresenceVerificationDetails + management_resource_arm_id: str + provisioning_arm_id: str + provisioning_end_point: str + quantity: int + ready_to_connect_arm_id: str + serial_number: str + unique_device_identifier: str + vendor_name: str + + + class azure.mgmt.edgeorder.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.edgeorder.types.PurchaseMeterDetails(TypedDict, total=False): + key "billingType": Required[Literal[BillingType.PURCHASE]] + key "chargingType": Union[str, ChargingType] + key "multiplier": float + key "productId": str + key "skuId": str + key "termId": str + billing_type: Literal[BillingType.PURCHASE] + charging_type: Union[str, ChargingType] + multiplier: float + product_id: str + sku_id: str + term_id: str + + + class azure.mgmt.edgeorder.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.edgeorder.types.ResourceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": str + principal_id: str + tenant_id: str + type: str + userAssignedIdentities: dict[str, UserAssignedIdentity] + user_assigned_identities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.edgeorder.types.ResourceProviderDetails(TypedDict, total=False): + key "resourceProviderNamespace": str + resource_provider_namespace: str + + + class azure.mgmt.edgeorder.types.ReturnOrderItemDetails(TypedDict, total=False): + key "returnAddress": ForwardRef('AddressProperties', module='types') + key "returnReason": Required[str] + key "serviceTag": str + key "shippingBoxRequired": bool + return_address: AddressProperties + return_reason: str + service_tag: str + shipping_box_required: bool + + + class azure.mgmt.edgeorder.types.ReverseShippingDetails(TypedDict, total=False): + key "carrierDisplayName": str + key "carrierName": str + key "sasKeyForLabel": str + key "trackingId": str + key "trackingUrl": str + carrier_display_name: str + carrier_name: str + sas_key_for_label: str + tracking_id: str + tracking_url: str + + + class azure.mgmt.edgeorder.types.ShippingAddress(TypedDict, total=False): + key "addressType": Union[str, AddressType] + key "city": str + key "companyName": str + key "country": Required[str] + key "postalCode": str + key "stateOrProvince": str + key "streetAddress1": str + key "streetAddress2": str + key "streetAddress3": str + key "zipExtendedCode": str + address_type: Union[str, AddressType] + city: str + company_name: str + country: str + postal_code: str + state_or_province: str + street_address1: str + street_address2: str + street_address3: str + zip_extended_code: str + + + class azure.mgmt.edgeorder.types.SiteDetails(TypedDict, total=False): + key "siteId": Required[str] + site_id: str + + + class azure.mgmt.edgeorder.types.Specification(TypedDict, total=False): + key "name": str + key "value": str + name: str + value: str + + + class azure.mgmt.edgeorder.types.StageDetails(TypedDict, total=False): + key "displayName": str + key "stageName": Union[str, StageName] + key "stageStatus": Union[str, StageStatus] + key "startTime": str + display_name: str + stage_name: Union[str, StageName] + stage_status: Union[str, StageStatus] + start_time: str + + + class azure.mgmt.edgeorder.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + created_at: str + created_by: str + created_by_type: Union[str, CreatedByType] + last_modified_at: str + last_modified_by: str + last_modified_by_type: Union[str, CreatedByType] + + + class azure.mgmt.edgeorder.types.TermCommitmentInformation(TypedDict, total=False): + key "pendingDaysForTerm": int + key "termCommitmentType": Required[Union[str, TermCommitmentType]] + key "termCommitmentTypeDuration": str + pending_days_for_term: int + term_commitment_type: Union[str, TermCommitmentType] + term_commitment_type_duration: str + + + class azure.mgmt.edgeorder.types.TermCommitmentPreferences(TypedDict, total=False): + key "preferredTermCommitmentDuration": str + key "preferredTermCommitmentType": Required[Union[str, TermCommitmentType]] + preferred_term_commitment_duration: str + preferred_term_commitment_type: Union[str, TermCommitmentType] + + + class azure.mgmt.edgeorder.types.TermTypeDetails(TypedDict, total=False): + key "termType": Required[Union[str, TermCommitmentType]] + key "termTypeDuration": Required[str] + term_type: Union[str, TermCommitmentType] + term_type_duration: str + + + class azure.mgmt.edgeorder.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.edgeorder.types.TransportPreferences(TypedDict, total=False): + key "preferredShipmentType": Required[Union[str, TransportShipmentTypes]] + preferred_shipment_type: Union[str, TransportShipmentTypes] + + + class azure.mgmt.edgeorder.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + client_id: str + principal_id: str + + +``` \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/api.metadata.yml b/sdk/edgeorder/azure-mgmt-edgeorder/api.metadata.yml new file mode 100644 index 000000000000..f16d9ae01510 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: ab64edddfed56c91d382111f02e00f56ac352587d56e466b5305439bdecd3adc +parserVersion: 0.3.28 +pythonVersion: 3.13.13 diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/apiview-properties.json b/sdk/edgeorder/azure-mgmt-edgeorder/apiview-properties.json new file mode 100644 index 000000000000..f8952a99b2c3 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/apiview-properties.json @@ -0,0 +1,166 @@ +{ + "CrossLanguagePackageId": "Microsoft.EdgeOrder", + "CrossLanguageDefinitionId": { + "azure.mgmt.edgeorder.models.AdditionalConfiguration": "Microsoft.EdgeOrder.AdditionalConfiguration", + "azure.mgmt.edgeorder.models.AddressDetails": "Microsoft.EdgeOrder.AddressDetails", + "azure.mgmt.edgeorder.models.AddressProperties": "Microsoft.EdgeOrder.AddressProperties", + "azure.mgmt.edgeorder.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.edgeorder.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.edgeorder.models.AddressResource": "Microsoft.EdgeOrder.AddressResource", + "azure.mgmt.edgeorder.models.AddressUpdateParameter": "Microsoft.EdgeOrder.AddressUpdateParameter", + "azure.mgmt.edgeorder.models.AddressUpdateProperties": "Microsoft.EdgeOrder.AddressUpdateProperties", + "azure.mgmt.edgeorder.models.AvailabilityInformation": "Microsoft.EdgeOrder.AvailabilityInformation", + "azure.mgmt.edgeorder.models.BasicInformation": "Microsoft.EdgeOrder.BasicInformation", + "azure.mgmt.edgeorder.models.BillingMeterDetails": "Microsoft.EdgeOrder.BillingMeterDetails", + "azure.mgmt.edgeorder.models.CancellationReason": "Microsoft.EdgeOrder.CancellationReason", + "azure.mgmt.edgeorder.models.CategoryInformation": "Microsoft.EdgeOrder.CategoryInformation", + "azure.mgmt.edgeorder.models.ChildConfiguration": "Microsoft.EdgeOrder.ChildConfiguration", + "azure.mgmt.edgeorder.models.ChildConfigurationFilter": "Microsoft.EdgeOrder.ChildConfigurationFilter", + "azure.mgmt.edgeorder.models.ChildConfigurationProperties": "Microsoft.EdgeOrder.ChildConfigurationProperties", + "azure.mgmt.edgeorder.models.CommonProperties": "Microsoft.EdgeOrder.CommonProperties", + "azure.mgmt.edgeorder.models.Configuration": "Microsoft.EdgeOrder.Configuration", + "azure.mgmt.edgeorder.models.ConfigurationDeviceDetails": "Microsoft.EdgeOrder.ConfigurationDeviceDetails", + "azure.mgmt.edgeorder.models.ConfigurationFilter": "Microsoft.EdgeOrder.ConfigurationFilter", + "azure.mgmt.edgeorder.models.ConfigurationProperties": "Microsoft.EdgeOrder.ConfigurationProperties", + "azure.mgmt.edgeorder.models.ConfigurationsRequest": "Microsoft.EdgeOrder.ConfigurationsRequest", + "azure.mgmt.edgeorder.models.ContactDetails": "Microsoft.EdgeOrder.ContactDetails", + "azure.mgmt.edgeorder.models.CostInformation": "Microsoft.EdgeOrder.CostInformation", + "azure.mgmt.edgeorder.models.CustomerSubscriptionDetails": "Microsoft.EdgeOrder.CustomerSubscriptionDetails", + "azure.mgmt.edgeorder.models.CustomerSubscriptionRegisteredFeatures": "Microsoft.EdgeOrder.CustomerSubscriptionRegisteredFeatures", + "azure.mgmt.edgeorder.models.Description": "Microsoft.EdgeOrder.Description", + "azure.mgmt.edgeorder.models.DeviceDetails": "Microsoft.EdgeOrder.DeviceDetails", + "azure.mgmt.edgeorder.models.DevicePresenceVerificationDetails": "Microsoft.EdgeOrder.DevicePresenceVerificationDetails", + "azure.mgmt.edgeorder.models.Dimensions": "Microsoft.EdgeOrder.Dimensions", + "azure.mgmt.edgeorder.models.DisplayInfo": "Microsoft.EdgeOrder.DisplayInfo", + "azure.mgmt.edgeorder.models.EncryptionPreferences": "Microsoft.EdgeOrder.EncryptionPreferences", + "azure.mgmt.edgeorder.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.edgeorder.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.edgeorder.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.edgeorder.models.FilterableProperty": "Microsoft.EdgeOrder.FilterableProperty", + "azure.mgmt.edgeorder.models.ForwardShippingDetails": "Microsoft.EdgeOrder.ForwardShippingDetails", + "azure.mgmt.edgeorder.models.GroupedChildConfigurations": "Microsoft.EdgeOrder.GroupedChildConfigurations", + "azure.mgmt.edgeorder.models.HierarchyInformation": "Microsoft.EdgeOrder.HierarchyInformation", + "azure.mgmt.edgeorder.models.ImageInformation": "Microsoft.EdgeOrder.ImageInformation", + "azure.mgmt.edgeorder.models.Link": "Microsoft.EdgeOrder.Link", + "azure.mgmt.edgeorder.models.ManagementResourcePreferences": "Microsoft.EdgeOrder.ManagementResourcePreferences", + "azure.mgmt.edgeorder.models.MeterDetails": "Microsoft.EdgeOrder.MeterDetails", + "azure.mgmt.edgeorder.models.NotificationPreference": "Microsoft.EdgeOrder.NotificationPreference", + "azure.mgmt.edgeorder.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.edgeorder.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.edgeorder.models.OrderItemDetails": "Microsoft.EdgeOrder.OrderItemDetails", + "azure.mgmt.edgeorder.models.OrderItemDetailsUpdateParameter": "Microsoft.EdgeOrder.OrderItemDetailsUpdateParameter", + "azure.mgmt.edgeorder.models.OrderItemProperties": "Microsoft.EdgeOrder.OrderItemProperties", + "azure.mgmt.edgeorder.models.OrderItemResource": "Microsoft.EdgeOrder.OrderItemResource", + "azure.mgmt.edgeorder.models.OrderItemUpdateParameter": "Microsoft.EdgeOrder.OrderItemUpdateParameter", + "azure.mgmt.edgeorder.models.OrderItemUpdateProperties": "Microsoft.EdgeOrder.OrderItemUpdateProperties", + "azure.mgmt.edgeorder.models.OrderProperties": "Microsoft.EdgeOrder.OrderProperties", + "azure.mgmt.edgeorder.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.edgeorder.models.OrderResource": "Microsoft.EdgeOrder.OrderResource", + "azure.mgmt.edgeorder.models.Pav2MeterDetails": "Microsoft.EdgeOrder.Pav2MeterDetails", + "azure.mgmt.edgeorder.models.Preferences": "Microsoft.EdgeOrder.Preferences", + "azure.mgmt.edgeorder.models.Product": "Microsoft.EdgeOrder.Product", + "azure.mgmt.edgeorder.models.ProductDetails": "Microsoft.EdgeOrder.ProductDetails", + "azure.mgmt.edgeorder.models.ProductDetailsUpdateParameter": "Microsoft.EdgeOrder.ProductDetailsUpdateParameter", + "azure.mgmt.edgeorder.models.ProductFamiliesMetadataDetails": "Microsoft.EdgeOrder.ProductFamiliesMetadataDetails", + "azure.mgmt.edgeorder.models.ProductFamiliesRequest": "Microsoft.EdgeOrder.ProductFamiliesRequest", + "azure.mgmt.edgeorder.models.ProductFamily": "Microsoft.EdgeOrder.ProductFamily", + "azure.mgmt.edgeorder.models.ProductFamilyProperties": "Microsoft.EdgeOrder.ProductFamilyProperties", + "azure.mgmt.edgeorder.models.ProductLine": "Microsoft.EdgeOrder.ProductLine", + "azure.mgmt.edgeorder.models.ProductLineProperties": "Microsoft.EdgeOrder.ProductLineProperties", + "azure.mgmt.edgeorder.models.ProductProperties": "Microsoft.EdgeOrder.ProductProperties", + "azure.mgmt.edgeorder.models.ProvisioningDetails": "Microsoft.EdgeOrder.ProvisioningDetails", + "azure.mgmt.edgeorder.models.PurchaseMeterDetails": "Microsoft.EdgeOrder.PurchaseMeterDetails", + "azure.mgmt.edgeorder.models.ResourceIdentity": "Microsoft.EdgeOrder.ResourceIdentity", + "azure.mgmt.edgeorder.models.ResourceProviderDetails": "Microsoft.EdgeOrder.ResourceProviderDetails", + "azure.mgmt.edgeorder.models.ReturnOrderItemDetails": "Microsoft.EdgeOrder.ReturnOrderItemDetails", + "azure.mgmt.edgeorder.models.ReverseShippingDetails": "Microsoft.EdgeOrder.ReverseShippingDetails", + "azure.mgmt.edgeorder.models.ShippingAddress": "Microsoft.EdgeOrder.ShippingAddress", + "azure.mgmt.edgeorder.models.SiteDetails": "Microsoft.EdgeOrder.SiteDetails", + "azure.mgmt.edgeorder.models.Specification": "Microsoft.EdgeOrder.Specification", + "azure.mgmt.edgeorder.models.StageDetails": "Microsoft.EdgeOrder.StageDetails", + "azure.mgmt.edgeorder.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.edgeorder.models.TermCommitmentInformation": "Microsoft.EdgeOrder.TermCommitmentInformation", + "azure.mgmt.edgeorder.models.TermCommitmentPreferences": "Microsoft.EdgeOrder.TermCommitmentPreferences", + "azure.mgmt.edgeorder.models.TermTypeDetails": "Microsoft.EdgeOrder.TermTypeDetails", + "azure.mgmt.edgeorder.models.TransportPreferences": "Microsoft.EdgeOrder.TransportPreferences", + "azure.mgmt.edgeorder.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "azure.mgmt.edgeorder.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.edgeorder.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.edgeorder.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.edgeorder.models.AddressClassification": "Microsoft.EdgeOrder.AddressClassification", + "azure.mgmt.edgeorder.models.AddressType": "Microsoft.EdgeOrder.AddressType", + "azure.mgmt.edgeorder.models.AddressValidationStatus": "Microsoft.EdgeOrder.AddressValidationStatus", + "azure.mgmt.edgeorder.models.ProvisioningState": "Microsoft.EdgeOrder.ProvisioningState", + "azure.mgmt.edgeorder.models.DoubleEncryptionStatus": "Microsoft.EdgeOrder.DoubleEncryptionStatus", + "azure.mgmt.edgeorder.models.IdentificationType": "Microsoft.EdgeOrder.IdentificationType", + "azure.mgmt.edgeorder.models.ProvisioningSupport": "Microsoft.EdgeOrder.ProvisioningSupport", + "azure.mgmt.edgeorder.models.AutoProvisioningStatus": "Microsoft.EdgeOrder.AutoProvisioningStatus", + "azure.mgmt.edgeorder.models.DevicePresenceVerificationStatus": "Microsoft.EdgeOrder.DevicePresenceVerificationStatus", + "azure.mgmt.edgeorder.models.TermCommitmentType": "Microsoft.EdgeOrder.TermCommitmentType", + "azure.mgmt.edgeorder.models.OrderItemType": "Microsoft.EdgeOrder.OrderItemType", + "azure.mgmt.edgeorder.models.OrderMode": "Microsoft.EdgeOrder.OrderMode", + "azure.mgmt.edgeorder.models.StageStatus": "Microsoft.EdgeOrder.StageStatus", + "azure.mgmt.edgeorder.models.StageName": "Microsoft.EdgeOrder.StageName", + "azure.mgmt.edgeorder.models.NotificationStageName": "Microsoft.EdgeOrder.NotificationStageName", + "azure.mgmt.edgeorder.models.TransportShipmentTypes": "Microsoft.EdgeOrder.TransportShipmentTypes", + "azure.mgmt.edgeorder.models.OrderItemCancellationEnum": "Microsoft.EdgeOrder.OrderItemCancellationEnum", + "azure.mgmt.edgeorder.models.ActionStatusEnum": "Microsoft.EdgeOrder.ActionStatusEnum", + "azure.mgmt.edgeorder.models.OrderItemReturnEnum": "Microsoft.EdgeOrder.OrderItemReturnEnum", + "azure.mgmt.edgeorder.models.DescriptionType": "Microsoft.EdgeOrder.DescriptionType", + "azure.mgmt.edgeorder.models.LinkType": "Microsoft.EdgeOrder.LinkType", + "azure.mgmt.edgeorder.models.ImageType": "Microsoft.EdgeOrder.ImageType", + "azure.mgmt.edgeorder.models.BillingType": "Microsoft.EdgeOrder.BillingType", + "azure.mgmt.edgeorder.models.ChargingType": "Microsoft.EdgeOrder.ChargingType", + "azure.mgmt.edgeorder.models.MeteringType": "Microsoft.EdgeOrder.MeteringType", + "azure.mgmt.edgeorder.models.AvailabilityStage": "Microsoft.EdgeOrder.AvailabilityStage", + "azure.mgmt.edgeorder.models.DisabledReason": "Microsoft.EdgeOrder.DisabledReason", + "azure.mgmt.edgeorder.models.FulfillmentType": "Microsoft.EdgeOrder.FulfillmentType", + "azure.mgmt.edgeorder.models.SupportedFilterTypes": "Microsoft.EdgeOrder.SupportedFilterTypes", + "azure.mgmt.edgeorder.models.LengthHeightUnit": "Microsoft.EdgeOrder.LengthHeightUnit", + "azure.mgmt.edgeorder.models.WeightMeasurementUnit": "Microsoft.EdgeOrder.WeightMeasurementUnit", + "azure.mgmt.edgeorder.models.ChildConfigurationType": "Microsoft.EdgeOrder.ChildConfigurationType", + "azure.mgmt.edgeorder.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.edgeorder.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.edgeorder.operations.AddressesOperations.get": "Microsoft.EdgeOrder.AddressResources.get", + "azure.mgmt.edgeorder.aio.operations.AddressesOperations.get": "Microsoft.EdgeOrder.AddressResources.get", + "azure.mgmt.edgeorder.operations.AddressesOperations.begin_create": "Microsoft.EdgeOrder.AddressResources.create", + "azure.mgmt.edgeorder.aio.operations.AddressesOperations.begin_create": "Microsoft.EdgeOrder.AddressResources.create", + "azure.mgmt.edgeorder.operations.AddressesOperations.begin_update": "Microsoft.EdgeOrder.AddressResources.update", + "azure.mgmt.edgeorder.aio.operations.AddressesOperations.begin_update": "Microsoft.EdgeOrder.AddressResources.update", + "azure.mgmt.edgeorder.operations.AddressesOperations.begin_delete": "Microsoft.EdgeOrder.AddressResources.delete", + "azure.mgmt.edgeorder.aio.operations.AddressesOperations.begin_delete": "Microsoft.EdgeOrder.AddressResources.delete", + "azure.mgmt.edgeorder.operations.AddressesOperations.list_by_resource_group": "Microsoft.EdgeOrder.AddressResources.listByResourceGroup", + "azure.mgmt.edgeorder.aio.operations.AddressesOperations.list_by_resource_group": "Microsoft.EdgeOrder.AddressResources.listByResourceGroup", + "azure.mgmt.edgeorder.operations.AddressesOperations.list_by_subscription": "Microsoft.EdgeOrder.AddressResources.listBySubscription", + "azure.mgmt.edgeorder.aio.operations.AddressesOperations.list_by_subscription": "Microsoft.EdgeOrder.AddressResources.listBySubscription", + "azure.mgmt.edgeorder.operations.OrderItemsOperations.get": "Microsoft.EdgeOrder.OrderItemResources.get", + "azure.mgmt.edgeorder.aio.operations.OrderItemsOperations.get": "Microsoft.EdgeOrder.OrderItemResources.get", + "azure.mgmt.edgeorder.operations.OrderItemsOperations.begin_create": "Microsoft.EdgeOrder.OrderItemResources.create", + "azure.mgmt.edgeorder.aio.operations.OrderItemsOperations.begin_create": "Microsoft.EdgeOrder.OrderItemResources.create", + "azure.mgmt.edgeorder.operations.OrderItemsOperations.begin_update": "Microsoft.EdgeOrder.OrderItemResources.update", + "azure.mgmt.edgeorder.aio.operations.OrderItemsOperations.begin_update": "Microsoft.EdgeOrder.OrderItemResources.update", + "azure.mgmt.edgeorder.operations.OrderItemsOperations.begin_delete": "Microsoft.EdgeOrder.OrderItemResources.delete", + "azure.mgmt.edgeorder.aio.operations.OrderItemsOperations.begin_delete": "Microsoft.EdgeOrder.OrderItemResources.delete", + "azure.mgmt.edgeorder.operations.OrderItemsOperations.list_by_resource_group": "Microsoft.EdgeOrder.OrderItemResources.listByResourceGroup", + "azure.mgmt.edgeorder.aio.operations.OrderItemsOperations.list_by_resource_group": "Microsoft.EdgeOrder.OrderItemResources.listByResourceGroup", + "azure.mgmt.edgeorder.operations.OrderItemsOperations.list_by_subscription": "Microsoft.EdgeOrder.OrderItemResources.listBySubscription", + "azure.mgmt.edgeorder.aio.operations.OrderItemsOperations.list_by_subscription": "Microsoft.EdgeOrder.OrderItemResources.listBySubscription", + "azure.mgmt.edgeorder.operations.OrderItemsOperations.cancel": "Microsoft.EdgeOrder.OrderItemResources.cancel", + "azure.mgmt.edgeorder.aio.operations.OrderItemsOperations.cancel": "Microsoft.EdgeOrder.OrderItemResources.cancel", + "azure.mgmt.edgeorder.operations.OrderItemsOperations.begin_return_method": "Microsoft.EdgeOrder.OrderItemResources.returnOrderItem", + "azure.mgmt.edgeorder.aio.operations.OrderItemsOperations.begin_return_method": "Microsoft.EdgeOrder.OrderItemResources.returnOrderItem", + "azure.mgmt.edgeorder.operations.OrdersOperations.get": "Microsoft.EdgeOrder.OrderResources.get", + "azure.mgmt.edgeorder.aio.operations.OrdersOperations.get": "Microsoft.EdgeOrder.OrderResources.get", + "azure.mgmt.edgeorder.operations.OrdersOperations.list_by_subscription": "Microsoft.EdgeOrder.OrdersOperationGroup.listBySubscription", + "azure.mgmt.edgeorder.aio.operations.OrdersOperations.list_by_subscription": "Microsoft.EdgeOrder.OrdersOperationGroup.listBySubscription", + "azure.mgmt.edgeorder.operations.OrdersOperations.list_by_resource_group": "Microsoft.EdgeOrder.OrdersOperationGroup.listByResourceGroup", + "azure.mgmt.edgeorder.aio.operations.OrdersOperations.list_by_resource_group": "Microsoft.EdgeOrder.OrdersOperationGroup.listByResourceGroup", + "azure.mgmt.edgeorder.operations.ProductsAndConfigurationsOperations.list_configurations": "Microsoft.EdgeOrder.ProductsAndConfigurationsOperationGroup.listConfigurations", + "azure.mgmt.edgeorder.aio.operations.ProductsAndConfigurationsOperations.list_configurations": "Microsoft.EdgeOrder.ProductsAndConfigurationsOperationGroup.listConfigurations", + "azure.mgmt.edgeorder.operations.ProductsAndConfigurationsOperations.list_product_families": "Microsoft.EdgeOrder.ProductsAndConfigurationsOperationGroup.listProductFamilies", + "azure.mgmt.edgeorder.aio.operations.ProductsAndConfigurationsOperations.list_product_families": "Microsoft.EdgeOrder.ProductsAndConfigurationsOperationGroup.listProductFamilies", + "azure.mgmt.edgeorder.operations.ProductsAndConfigurationsOperations.list_product_families_metadata": "Microsoft.EdgeOrder.ProductsAndConfigurationsOperationGroup.listProductFamiliesMetadata", + "azure.mgmt.edgeorder.aio.operations.ProductsAndConfigurationsOperations.list_product_families_metadata": "Microsoft.EdgeOrder.ProductsAndConfigurationsOperationGroup.listProductFamiliesMetadata" + }, + "CrossLanguageVersion": "c450e03f8cfa" +} \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 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 cf345f5e5ed1..1e5eec1a5e51 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/__init__.py @@ -2,18 +2,24 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._edge_order_management_client import EdgeOrderManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import EdgeOrderManagementClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "EdgeOrderManagementClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_client.py new file mode 100644 index 000000000000..d44e222b6197 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_client.py @@ -0,0 +1,160 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, Optional, TYPE_CHECKING, cast + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints + +from ._configuration import EdgeOrderManagementClientConfiguration +from ._utils.serialization import Deserializer, Serializer +from .operations import ( + AddressesOperations, + Operations, + OrderItemsOperations, + OrdersOperations, + ProductsAndConfigurationsOperations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials import TokenCredential + + +class EdgeOrderManagementClient: + """Edge Order API's. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.edgeorder.operations.Operations + :ivar addresses: AddressesOperations operations + :vartype addresses: azure.mgmt.edgeorder.operations.AddressesOperations + :ivar order_items: OrderItemsOperations operations + :vartype order_items: azure.mgmt.edgeorder.operations.OrderItemsOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.edgeorder.operations.OrdersOperations + :ivar products_and_configurations: ProductsAndConfigurationsOperations operations + :vartype products_and_configurations: + azure.mgmt.edgeorder.operations.ProductsAndConfigurationsOperations + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is None. + :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2024-02-01" + and None. Default value is None. If not set, the operation's default API version will be used. + 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: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = EdgeOrderManagementClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs + ) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + 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.order_items = OrderItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize) + self.products_and_configurations = ProductsAndConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def send_request(self, request: HttpRequest, *, stream: bool = False, **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) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> Self: + 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/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_configuration.py index 1c28307f38a0..f672bc1d1de2 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_configuration.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_configuration.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,27 +14,40 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class EdgeOrderManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class EdgeOrderManagementClientConfiguration: # 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. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. 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. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2024-02-01" + and None. Default value is None. If not set, the operation's default API version will be used. + 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: - api_version: str = kwargs.pop("api_version", "2021-12-01") + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2024-02-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -43,6 +56,8 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting 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)) 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 deleted file mode 100644 index 9c115640d3b2..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient -from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy - -from . import models as _models -from ._configuration import EdgeOrderManagementClientConfiguration -from ._serialization import Deserializer, Serializer -from .operations import EdgeOrderManagementClientOperationsMixin - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class EdgeOrderManagementClient( - EdgeOrderManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The EdgeOrder Client. - - :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 "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: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = EdgeOrderManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - ARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - - 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 - - def _send_request(self, request: HttpRequest, *, stream: bool = False, **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, stream=stream, **kwargs) # type: ignore - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> Self: - 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/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_patch.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/model_base.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/model_base.py new file mode 100644 index 000000000000..b93f5120d517 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/model_base.py @@ -0,0 +1,1770 @@ +# pylint: disable=line-too-long,useless-suppression,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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_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}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _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") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _serialize_duration(o, format) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass: dict[str, typing.Any] = {} + if args: + if isinstance(args[0], ET.Element): + dict_to_pass.update(self._init_from_xml(args[0])) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) + super().__init__(dict_to_pass) + + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._deserializer = deserializer + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + deserializer=deserializer, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) + wrapped_element = _create_xml_element( + element_name, + model_meta.get("prefix"), + _model_ns, + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + _set_xml_attribute(wrapped_element, k, v, prop_meta) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": _dict_ns, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": _items_ns, + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/serialization.py similarity index 76% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/serialization.py index 8139854b97bb..75906e2eb77f 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/serialization.py @@ -1,30 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -39,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -48,11 +29,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, - List, - Mapping, ) try: @@ -66,9 +43,13 @@ from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -91,6 +72,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :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. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +95,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -155,6 +138,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -179,80 +167,31 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], 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 +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? None: - self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + self.additional_properties: Optional[dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items 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): @@ -300,13 +246,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -326,7 +282,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -346,12 +306,14 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + 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, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,12 +342,15 @@ def my_key_transformer(key, attr_desc, value): 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 :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) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -395,30 +360,31 @@ def _infer_class_models(cls): 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: + except Exception: # pylint: disable=broad-exception-caught # 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: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """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 + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -426,9 +392,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -448,21 +416,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access 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. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ 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) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -501,11 +473,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -540,12 +514,16 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -556,17 +534,20 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object 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. + :raises SerializationError: if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -592,17 +573,19 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + 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) + serialized |= target_obj.additional_properties continue try: @@ -633,7 +616,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): 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 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 @@ -664,17 +648,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object 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 + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -703,7 +687,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -712,11 +696,13 @@ def body(self, 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 name: The name of the URL path parameter. + :param object 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 + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -728,21 +714,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + 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 name: The name of the query parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :keyword bool skip_quote: Whether to skip quote the serialized result. - Defaults to False. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -759,19 +744,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + 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 name: The name of the header. + :param object 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 + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -780,21 +766,20 @@ def header(self, name, data, data_type, **kwargs): 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) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + 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 object 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. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -805,12 +790,12 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if 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__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -821,11 +806,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -841,23 +825,33 @@ def serialize_basic(cls, data, data_type, **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 obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ 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 + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @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. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -871,8 +865,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -882,15 +875,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): 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 list data: 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'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. Defaults to False. :rtype: list, str + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -945,9 +936,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :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 + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -971,7 +961,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """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 @@ -979,6 +969,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1003,7 +994,7 @@ def serialize_object(self, attr, **kwargs): 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): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1034,56 +1025,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: 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)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1091,11 +1087,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1105,30 +1102,87 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. + :return: serialized rfc """ 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.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1141,12 +1195,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1172,13 +1227,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """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 + :raises SerializationError: if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1186,17 +1242,17 @@ def serialize_unix(attr, **kwargs): 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.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument 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)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1211,7 +1267,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1232,17 +1290,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, 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.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ 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): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """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" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1279,7 +1349,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1331,22 +1401,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + 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 - ) + # 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. + ) + 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: @@ -1354,7 +1423,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1363,14 +1432,18 @@ class Deserializer(object): 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}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1383,9 +1456,13 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1395,33 +1472,56 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """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. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """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. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: 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(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1440,13 +1540,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1476,9 +1576,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + 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: @@ -1505,6 +1604,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1516,7 +1617,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1531,10 +1632,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :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. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1552,10 +1655,12 @@ def _unpack_content(raw_data, content_type=None): 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. + :param obj raw_data: Data to be processed. + :param str 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 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1579,24 +1684,35 @@ def _unpack_content(raw_data, content_type=None): 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. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ 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")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + 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 + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1605,15 +1721,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """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. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1627,7 +1744,11 @@ def deserialize_data(self, data, data_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"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "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) @@ -1647,14 +1768,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + 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. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1671,6 +1792,7 @@ def deserialize_dict(self, attr, dict_type): :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. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1681,13 +1803,14 @@ def deserialize_dict(self, attr, dict_type): 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): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1720,11 +1843,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """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 @@ -1732,8 +1854,9 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1743,24 +1866,27 @@ def deserialize_basic(self, attr, data_type): 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 + # 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, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if 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 + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): @@ -1768,6 +1894,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1781,8 +1908,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1794,6 +1920,7 @@ def deserialize_enum(data, enum_obj): :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. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1804,9 +1931,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1822,8 +1949,9 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1834,8 +1962,9 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1849,8 +1978,9 @@ 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. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1865,8 +1995,9 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1877,8 +2008,9 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1887,16 +2019,58 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration + + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1910,8 +2084,9 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1924,31 +2099,32 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :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)) + *parsed_date[:6], tzinfo=datetime.timezone(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 DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1976,8 +2152,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1985,8 +2160,9 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore @@ -1996,5 +2172,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/utils.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/utils.py new file mode 100644 index 000000000000..cbaa624660e4 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_utils/utils.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Optional + +from azure.core import MatchConditions + + +def quote_etag(etag: Optional[str]) -> Optional[str]: + if not etag or etag == "*": + return etag + if etag.startswith("W/"): + return etag + if etag.startswith('"') and etag.endswith('"'): + return etag + if etag.startswith("'") and etag.endswith("'"): + return etag + return '"' + etag + '"' + + +def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfNotModified: + if_match = quote_etag(etag) if etag else None + return if_match + if match_condition == MatchConditions.IfPresent: + return "*" + return None + + +def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfModified: + if_none_match = quote_etag(etag) if etag else None + return if_none_match + if match_condition == MatchConditions.IfMissing: + return "*" + return None diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_vendor.py deleted file mode 100644 index 97de9394b7bd..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_vendor.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import EdgeOrderManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from ._serialization import Deserializer, Serializer - - -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/_version.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_version.py index 48944bf3938a..fd5e9189cf06 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_version.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_version.py @@ -2,8 +2,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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "3.0.0b1" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/__init__.py index b9eec9b0ea44..e3423b457768 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/__init__.py @@ -2,15 +2,21 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._edge_order_management_client import EdgeOrderManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import EdgeOrderManagementClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "EdgeOrderManagementClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_client.py new file mode 100644 index 000000000000..970d7d41adac --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_client.py @@ -0,0 +1,164 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints + +from .._utils.serialization import Deserializer, Serializer +from ._configuration import EdgeOrderManagementClientConfiguration +from .operations import ( + AddressesOperations, + Operations, + OrderItemsOperations, + OrdersOperations, + ProductsAndConfigurationsOperations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials_async import AsyncTokenCredential + + +class EdgeOrderManagementClient: + """Edge Order API's. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.edgeorder.aio.operations.Operations + :ivar addresses: AddressesOperations operations + :vartype addresses: azure.mgmt.edgeorder.aio.operations.AddressesOperations + :ivar order_items: OrderItemsOperations operations + :vartype order_items: azure.mgmt.edgeorder.aio.operations.OrderItemsOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.edgeorder.aio.operations.OrdersOperations + :ivar products_and_configurations: ProductsAndConfigurationsOperations operations + :vartype products_and_configurations: + azure.mgmt.edgeorder.aio.operations.ProductsAndConfigurationsOperations + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is None. + :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2024-02-01" + and None. Default value is None. If not set, the operation's default API version will be used. + 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, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = EdgeOrderManagementClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs + ) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) + + self._serialize = Serializer() + self._deserialize = Deserializer() + 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.order_items = OrderItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize) + self.products_and_configurations = ProductsAndConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def send_request( + self, request: HttpRequest, *, stream: bool = False, **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) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> Self: + 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/aio/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_configuration.py index 5adb2abf8fd7..79f5c6ef2dfa 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 @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,27 +14,40 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class EdgeOrderManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class EdgeOrderManagementClientConfiguration: # 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. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. 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. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2024-02-01" + and None. Default value is None. If not set, the operation's default API version will be used. + 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: - api_version: str = kwargs.pop("api_version", "2021-12-01") + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2024-02-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -43,6 +56,8 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting 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)) 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 deleted file mode 100644 index e38b3d3a311c..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient -from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy - -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 - - -class EdgeOrderManagementClient( - EdgeOrderManagementClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword - """The EdgeOrder Client. - - :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 "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: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = EdgeOrderManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - AsyncARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - - 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 - - def _send_request( - self, request: HttpRequest, *, stream: bool = False, **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, stream=stream, **kwargs) # type: ignore - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> Self: - 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/aio/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_patch.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_vendor.py deleted file mode 100644 index ed13e1b40b7d..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_vendor.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from abc import ABC -from typing import TYPE_CHECKING - -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/aio/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/__init__.py index 9e856f64458f..acad6cc70de4 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/__init__.py @@ -2,18 +2,32 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._edge_order_management_client_operations import EdgeOrderManagementClientOperationsMixin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import AddressesOperations # type: ignore +from ._operations import OrderItemsOperations # type: ignore +from ._operations import OrdersOperations # type: ignore +from ._operations import ProductsAndConfigurationsOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "EdgeOrderManagementClientOperationsMixin", + "Operations", + "AddressesOperations", + "OrderItemsOperations", + "OrdersOperations", + "ProductsAndConfigurationsOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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/_operations.py similarity index 53% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_edge_order_management_client_operations.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_operations.py index 0bfa17afc009..50bdfaa009dc 100644 --- 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/_operations.py @@ -1,21 +1,24 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient, MatchConditions from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -31,59 +34,70 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models -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 ... import models as _models, types as _types +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ...operations._operations import ( + build_addresses_create_request, + build_addresses_delete_request, + build_addresses_get_request, + build_addresses_list_by_resource_group_request, + build_addresses_list_by_subscription_request, + build_addresses_update_request, + build_operations_list_request, + build_order_items_cancel_request, + build_order_items_create_request, + build_order_items_delete_request, + build_order_items_get_request, + build_order_items_list_by_resource_group_request, + build_order_items_list_by_subscription_request, + build_order_items_return_method_request, + build_order_items_update_request, + build_orders_get_request, + build_orders_list_by_resource_group_request, + build_orders_list_by_subscription_request, + build_products_and_configurations_list_configurations_request, + build_products_and_configurations_list_product_families_metadata_request, + build_products_and_configurations_list_product_families_request, ) -from .._vendor import EdgeOrderManagementClientMixinABC +from .._configuration import EdgeOrderManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +List = list -class EdgeOrderManagementClientOperationsMixin( # pylint: disable=too-many-public-methods - EdgeOrderManagementClientMixinABC -): +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.aio.EdgeOrderManagementClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations that are exposed for customer. + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: + """List the operations for the provider. - :return: An iterator like instance of either Operation or the result of cls(response) + :return: An iterator like instance of Operation :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -94,12 +108,17 @@ def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_operations_request( - api_version=api_version, + _request = build_operations_list_request( + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -112,60 +131,85 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - @distributed_trace - def list_addresses_at_subscription_level( - 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. 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 - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) +class AddressesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.aio.EdgeOrderManagementClient`'s + :attr:`addresses` attribute. + """ - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, address_name: str, **kwargs: Any) -> _models.AddressResource: + """Get information about the specified address. - error_map: MutableMapping[int, Type[HttpResponseError]] = { + :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 + :return: AddressResource. The AddressResource is compatible with MutableMapping + :rtype: ~azure.mgmt.edgeorder.models.AddressResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,473 +217,589 @@ def list_addresses_at_subscription_level( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_list_addresses_at_subscription_level_request( - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - 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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + _request = build_addresses_get_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - 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) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - async def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - 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) - - @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. + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: ~azure.mgmt.edgeorder.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 - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AddressResource, response.json()) - @overload - def list_product_families( - self, - product_families_request: IO[bytes], - 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. + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: IO[bytes] - :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 - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return deserialized # type: ignore - @distributed_trace - def list_product_families( + async def _create_initial( self, - product_families_request: Union[_models.ProductFamiliesRequest, IO[bytes]], - expand: Optional[str] = None, - skip_token: Optional[str] = None, + resource_group_name: str, + address_name: str, + address_resource: Union[_models.AddressResource, _types.AddressResource, IO[bytes]], **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. Is either a - ProductFamiliesRequest type or a IO[bytes] type. Required. - :type product_families_request: ~azure.mgmt.edgeorder.models.ProductFamiliesRequest or - IO[bytes] - :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 - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + content_type = content_type or "application/json" - _json = None _content = None - if isinstance(product_families_request, (IOBase, bytes)): - _content = product_families_request + if isinstance(address_resource, (IOBase, bytes)): + _content = address_resource 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + _content = json.dumps(address_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - 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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + _request = build_addresses_create_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - 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) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - async def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - 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) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return AsyncItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @overload - def list_configurations( + async def begin_create( self, - configurations_request: _models.ConfigurationsRequest, - skip_token: Optional[str] = None, + resource_group_name: str, + address_name: str, + address_resource: _models.AddressResource, *, 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. + ) -> 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 configurations_request: Filters for showing the configurations. Required. - :type configurations_request: ~azure.mgmt.edgeorder.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 + :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.models.AddressResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.Configuration] + :return: An instance of AsyncLROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def list_configurations( + async def begin_create( self, - configurations_request: IO[bytes], - skip_token: Optional[str] = None, + resource_group_name: str, + address_name: str, + address_resource: _types.AddressResource, *, 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. + ) -> 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 configurations_request: Filters for showing the configurations. Required. - :type configurations_request: IO[bytes] - :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. + :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.types.AddressResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.Configuration] + :return: An instance of AsyncLROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace - def list_configurations( + @overload + async def begin_create( self, - configurations_request: Union[_models.ConfigurationsRequest, IO[bytes]], - skip_token: Optional[str] = None, + resource_group_name: str, + address_name: str, + address_resource: IO[bytes], + *, + 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. + ) -> 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 configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO[bytes] type. Required. - :type configurations_request: ~azure.mgmt.edgeorder.models.ConfigurationsRequest or IO[bytes] - :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 - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.Configuration] + :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[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.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, _types.AddressResource, IO[bytes]], + **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[bytes] type. Required. + :type address_resource: ~azure.mgmt.edgeorder.models.AddressResource or + ~azure.mgmt.edgeorder.types.AddressResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Configurations] = kwargs.pop("cls", 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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AddressResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AddressResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AddressResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, _types.AddressUpdateParameter, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + content_type = content_type or "application/json" - _json = None _content = None - if isinstance(configurations_request, (IOBase, bytes)): - _content = configurations_request + if isinstance(address_update_parameter, (IOBase, bytes)): + _content = address_update_parameter else: - _json = self._serialize.body(configurations_request, "ConfigurationsRequest") + _content = json.dumps(address_update_parameter, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - def prepare_request(next_link=None): - if not next_link: + _request = build_addresses_update_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - 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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + response = pipeline_response.http_response - 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) + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - async def get_next(next_link=None): - _request = prepare_request(next_link) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - 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) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return pipeline_response + return deserialized # type: ignore - return AsyncItemPaged(get_next, extract_data) + @overload + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: _models.AddressUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Update the properties of an existing address. - @distributed_trace - def list_product_families_metadata( - 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. Default value is None. - :type skip_token: str - :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamiliesMetadataDetails] + :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.models.AddressUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + @overload + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: _types.AddressUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Update the properties of an existing address. - 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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + :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.types.AddressUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ - 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) + @overload + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Update the properties of an existing address. - async def get_next(next_link=None): - _request = prepare_request(next_link) + :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[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, _types.AddressUpdateParameter, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AddressResource]: + """Update the properties of an existing address. - 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) + :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[bytes] type. Required. + :type address_update_parameter: ~azure.mgmt.edgeorder.models.AddressUpdateParameter or + ~azure.mgmt.edgeorder.types.AddressUpdateParameter or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - return pipeline_response + 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, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - return AsyncItemPaged(get_next, extract_data) + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AddressResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - @distributed_trace - def list_order_at_subscription_level( - 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. Default value is None. - :type skip_token: str - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AddressResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AddressResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + async def _delete_initial(self, resource_group_name: str, address_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -647,93 +807,149 @@ def list_order_at_subscription_level( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_list_order_at_subscription_level_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - 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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + _request = build_addresses_delete_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - 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) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - async def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - 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) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return AsyncItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @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 + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + address_name=address_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_order_items_at_subscription_level( + 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"]: - """Lists order item 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 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. 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 - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.OrderItemResource] + ) -> AsyncItemPaged["_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 + :keyword filter: $filter is supported to filter based on shipping address properties. Filter + supports only equals operation. Default value is None. + :paramtype filter: str + :keyword skip_token: $skipToken is supported on Get list of addresses, which provides the next + page in the list of addresses. Default value is None. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of AddressResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AddressResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -744,16 +960,22 @@ def list_order_items_at_subscription_level( def prepare_request(next_link=None): if not next_link: - _request = build_list_order_items_at_subscription_level_request( + _request = build_addresses_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, - api_version=api_version, + top=top, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -766,31 +988,45 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AddressResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -798,31 +1034,35 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @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.AddressResource"]: - """Lists all the addresses available under the given resource group. + def list_by_subscription( + self, + *, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.AddressResource"]: + """List all the addresses available under the subscription. - :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 + :keyword 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 address. Default value is None. - :type skip_token: str - :return: An iterator like instance of either AddressResource or the result of cls(response) + :paramtype filter: str + :keyword skip_token: $skipToken is supported on Get list of addresses, which provides the next + page in the list of addresses. Default value is None. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of AddressResource :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AddressResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -833,16 +1073,21 @@ def list_addresses_at_resource_group_level( def prepare_request(next_link=None): if not next_link: - _request = build_list_addresses_at_resource_group_level_request( - resource_group_name=resource_group_name, + _request = build_addresses_list_by_subscription_request( subscription_id=self._config.subscription_id, filter=filter, skip_token=skip_token, - api_version=api_version, + top=top, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -855,55 +1100,92 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AddressResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + +class OrderItemsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.aio.EdgeOrderManagementClient`'s + :attr:`order_items` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace_async - async def get_address_by_name( - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.AddressResource: - """Gets information about the specified address. + 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 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 - :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.models.AddressResource + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :keyword 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. + :paramtype expand: str + :return: OrderItemResource. The OrderItemResource is compatible with MutableMapping + :rtype: ~azure.mgmt.edgeorder.models.OrderItemResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,48 +1194,63 @@ async def get_address_by_name( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - _request = build_get_address_by_name_request( - address_name=address_name, + _request = build_order_items_get_request( resource_group_name=resource_group_name, + order_item_name=order_item_name, subscription_id=self._config.subscription_id, - api_version=api_version, + expand=expand, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AddressResource", pipeline_response.http_response) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OrderItemResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_address_initial( + async def _create_initial( self, - address_name: str, resource_group_name: str, - address_resource: Union[_models.AddressResource, IO[bytes]], + order_item_name: str, + order_item_resource: Union[_models.OrderItemResource, _types.OrderItemResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -962,36 +1259,36 @@ async def _create_address_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" - _json = None _content = None - if isinstance(address_resource, (IOBase, bytes)): - _content = address_resource + if isinstance(order_item_resource, (IOBase, bytes)): + _content = order_item_resource else: - _json = self._serialize.body(address_resource, "AddressResource") + _content = json.dumps(order_item_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_create_address_request( - address_name=address_name, + _request = build_order_items_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, + api_version=self._config.api_version, content=_content, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1003,119 +1300,149 @@ async def _create_address_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - async def begin_create_address( + async def begin_create( self, - address_name: str, resource_group_name: str, - address_resource: _models.AddressResource, + order_item_name: str, + order_item_resource: _models.OrderItemResource, *, 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. + ) -> 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 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: ~azure.mgmt.edgeorder.models.AddressResource + :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.models.OrderItemResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :return: An instance of AsyncLROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_address( + async def begin_create( self, - address_name: str, resource_group_name: str, - address_resource: IO[bytes], + order_item_name: str, + order_item_resource: _types.OrderItemResource, *, 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. + ) -> 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.types.OrderItemResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.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[bytes], + *, + 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 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[bytes] + :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[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :return: An instance of AsyncLROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_address( + async def begin_create( self, - address_name: str, resource_group_name: str, - address_resource: Union[_models.AddressResource, IO[bytes]], + order_item_name: str, + order_item_resource: Union[_models.OrderItemResource, _types.OrderItemResource, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address can be updated with this - API. + ) -> 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 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[bytes] type. Required. - :type address_resource: ~azure.mgmt.edgeorder.models.AddressResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :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[bytes] type. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.models.OrderItemResource or + ~azure.mgmt.edgeorder.types.OrderItemResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", 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_address_initial( - address_name=address_name, + raw_result = await self._create_initial( resource_group_name=resource_group_name, - address_resource=address_resource, - api_version=api_version, + order_item_name=order_item_name, + order_item_resource=order_item_resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -1126,109 +1453,278 @@ async def begin_create_address( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response.http_response) + response = pipeline_response.http_response + deserialized = _deserialize(_models.OrderItemResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.AddressResource].from_continuation_token( + return AsyncLROPoller[_models.OrderItemResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.AddressResource]( + return AsyncLROPoller[_models.OrderItemResource]( 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 + async def _update_initial( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: Union[ + _models.OrderItemUpdateParameter, _types.OrderItemUpdateParameter, IO[bytes] + ], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_delete_address_by_name_request( - address_name=address_name, + content_type = content_type or "application/json" + _content = None + if isinstance(order_item_update_parameter, (IOBase, bytes)): + _content = order_item_update_parameter + else: + _content = json.dumps(order_item_update_parameter, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_order_items_update_request( resource_group_name=resource_group_name, + order_item_name=order_item_name, subscription_id=self._config.subscription_id, - api_version=api_version, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore + @overload + async def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: _models.OrderItemUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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. Required. + :type order_item_update_parameter: ~azure.mgmt.edgeorder.models.OrderItemUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.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: _types.OrderItemUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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. Required. + :type order_item_update_parameter: ~azure.mgmt.edgeorder.types.OrderItemUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.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[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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. Required. + :type order_item_update_parameter: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - async def begin_delete_address_by_name( - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an address. + async def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: Union[ + _models.OrderItemUpdateParameter, _types.OrderItemUpdateParameter, IO[bytes] + ], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OrderItemResource]: + """Update the properties of an existing order item. - :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 - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :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[bytes] type. Required. + :type order_item_update_parameter: ~azure.mgmt.edgeorder.models.OrderItemUpdateParameter or + ~azure.mgmt.edgeorder.types.OrderItemUpdateParameter or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + 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._delete_address_by_name_initial( - address_name=address_name, + raw_result = await self._update_initial( resource_group_name=resource_group_name, - api_version=api_version, + order_item_name=order_item_name, + order_item_update_parameter=order_item_update_parameter, + etag=etag, + match_condition=match_condition, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1237,34 +1733,40 @@ async def begin_delete_address_by_name( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.OrderItemResource, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.OrderItemResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return AsyncLROPoller[_models.OrderItemResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _update_address_initial( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any + async def _delete_initial( + self, resource_group_name: str, order_item_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1272,174 +1774,80 @@ async def _update_address_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_update_parameter, (IOBase, bytes)): - _content = address_update_parameter - else: - _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") - - _request = build_update_address_request( - address_name=address_name, + _request = build_order_items_delete_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, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - async def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: _models.AddressUpdateParameter, - 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: ~azure.mgmt.edgeorder.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 - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: IO[bytes], - 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[bytes] - :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 - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.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[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Updates the properties of an existing address. + async def begin_delete(self, resource_group_name: str, order_item_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete an order item. - :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[bytes] type. Required. - :type address_update_parameter: ~azure.mgmt.edgeorder.models.AddressUpdateParameter or - IO[bytes] - :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 - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :return: An instance of AsyncLROPoller that returns None + :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 {}) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", 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._update_address_initial( - address_name=address_name, + raw_result = await self._delete_initial( resource_group_name=resource_group_name, - address_update_parameter=address_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, + order_item_name=order_item_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1448,52 +1856,73 @@ async def begin_update_address( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.AddressResource].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.AddressResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_order_at_resource_group_level( - self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OrderResource"]: - """Lists order at resource group level. + 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 + ) -> AsyncItemPaged["_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 skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. Default value is None. - :type skip_token: str - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.OrderResource] + :keyword filter: $filter is supported to filter based on order id and order Item Type. Filter + supports only equals operation. Default value is None. + :paramtype filter: str + :keyword 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. + :paramtype expand: str + :keyword 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. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of OrderItemResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + cls: ClsType[List[_models.OrderItemResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1504,15 +1933,23 @@ def list_order_at_resource_group_level( def prepare_request(next_link=None): if not next_link: - _request = build_list_order_at_resource_group_level_request( + _request = build_order_items_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, - api_version=api_version, + top=top, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -1525,135 +1962,89 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OrderItemResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - @distributed_trace_async - 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. 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. Required. - :type location: str - :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.models.OrderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - @distributed_trace - def list_order_items_at_resource_group_level( + def list_by_subscription( 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"]: - """Lists order item at resource group level. + ) -> AsyncItemPaged["_models.OrderItemResource"]: + """List order items at subscription 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 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. 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 - :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :keyword filter: $filter is supported to filter based on order id and order Item Type. Filter + supports only equals operation. Default value is None. + :paramtype filter: str + :keyword 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. + :paramtype expand: str + :keyword 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. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of OrderItemResource :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + cls: ClsType[List[_models.OrderItemResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1664,17 +2055,22 @@ def list_order_items_at_resource_group_level( def prepare_request(next_link=None): if not next_link: - _request = build_list_order_items_at_resource_group_level_request( - resource_group_name=resource_group_name, + _request = build_order_items_list_by_subscription_request( subscription_id=self._config.subscription_id, filter=filter, expand=expand, skip_token=skip_token, - api_version=api_version, + top=top, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -1687,59 +2083,156 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OrderItemResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - @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: - """Gets an order item. + @overload + async def cancel( + 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.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: _types.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.types.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: IO[bytes], + *, + 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[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: Union[_models.CancellationReason, _types.CancellationReason, IO[bytes]], + **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 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. Default value is - None. - :type expand: str - :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.models.OrderItemResource + :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[bytes] type. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.models.CancellationReason or + ~azure.mgmt.edgeorder.types.CancellationReason or IO[bytes] + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1747,50 +2240,60 @@ async def get_order_item_by_name( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_get_order_item_by_name_request( - order_item_name=order_item_name, + content_type = content_type or "application/json" + _content = None + if isinstance(cancellation_reason, (IOBase, bytes)): + _content = cancellation_reason + else: + _content = json.dumps(cancellation_reason, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_order_items_cancel_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore - async def _create_order_item_initial( + async def _return_method_initial( self, - order_item_name: str, resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO[bytes]], + order_item_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, _types.ReturnOrderItemDetails, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1799,36 +2302,36 @@ async def _create_order_item_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" - _json = None _content = None - if isinstance(order_item_resource, (IOBase, bytes)): - _content = order_item_resource + if isinstance(return_order_item_details, (IOBase, bytes)): + _content = return_order_item_details else: - _json = self._serialize.body(order_item_resource, "OrderItemResource") + _content = json.dumps(return_order_item_details, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_create_order_item_request( - order_item_name=order_item_name, + _request = build_order_items_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, + api_version=self._config.api_version, content=_content, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1840,113 +2343,141 @@ async def _create_order_item_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - async def begin_create_order_item( + 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.models.ReturnOrderItemDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_return_method( + self, resource_group_name: str, - order_item_resource: _models.OrderItemResource, + order_item_name: str, + return_order_item_details: _types.ReturnOrderItemDetails, *, 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. + ) -> 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 order_item_resource: Order item details from request body. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.models.OrderItemResource + :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.types.ReturnOrderItemDetails :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_order_item( + async def begin_return_method( self, - order_item_name: str, resource_group_name: str, - order_item_resource: IO[bytes], + order_item_name: str, + return_order_item_details: IO[bytes], *, 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. + ) -> 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 order_item_resource: Order item details from request body. Required. - :type order_item_resource: IO[bytes] + :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[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_order_item( + async def begin_return_method( self, - order_item_name: str, resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO[bytes]], + order_item_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, _types.ReturnOrderItemDetails, IO[bytes]], **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. + ) -> 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 order_item_resource: Order item details from request body. Is either a OrderItemResource + :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[bytes] type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.models.OrderItemResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :type return_order_item_details: ~azure.mgmt.edgeorder.models.ReturnOrderItemDetails or + ~azure.mgmt.edgeorder.types.ReturnOrderItemDetails or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :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 {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", 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._create_order_item_initial( - order_item_name=order_item_name, + raw_result = await self._return_method_initial( resource_group_name=resource_group_name, - order_item_resource=order_item_resource, - api_version=api_version, + order_item_name=order_item_name, + return_order_item_details=return_order_item_details, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -1956,33 +2487,67 @@ async def begin_create_order_item( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.OrderItemResource].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.OrderItemResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](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 - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + +class OrdersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.aio.EdgeOrderManagementClient`'s + :attr:`orders` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @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 the Azure region. Required. + :type location: str + :param order_name: The name of the order. Required. + :type order_name: str + :return: OrderResource. The OrderResource is compatible with MutableMapping + :rtype: ~azure.mgmt.edgeorder.models.OrderResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1991,109 +2556,183 @@ async def _delete_order_item_by_name_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) - _request = build_delete_order_item_by_name_request( - order_item_name=order_item_name, + _request = build_orders_get_request( resource_group_name=resource_group_name, + location=location, + order_name=order_name, subscription_id=self._config.subscription_id, - api_version=api_version, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OrderResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - 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. 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 - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] + @distributed_trace + def list_by_subscription( + self, *, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.OrderResource"]: + """List orders at subscription level. + + :keyword skip_token: $skipToken is supported on Get list of orders, which provides the next + page in the list of orders. Default value is None. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of OrderResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.OrderResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[List[_models.OrderResource]] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + error_map: MutableMapping = { + 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_orders_list_by_subscription_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OrderResource], + deserialized.get("value", []), + ) if cls: - return cls(pipeline_response, None, {}) # type: ignore + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + response = pipeline_response.http_response - async def _update_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> AsyncItemPaged["_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 + :keyword skip_token: $skipToken is supported on Get list of orders, which provides the next + page in the list of orders. Default value is None. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of OrderResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OrderResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2101,509 +2740,592 @@ async def _update_order_item_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + _request = build_orders_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_update_parameter, (IOBase, bytes)): - _content = order_item_update_parameter - else: - _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + return _request - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OrderResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - response = pipeline_response.http_response + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - 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 = response.stream_download(self._client._pipeline, decompress=_decompress) +class ProductsAndConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.aio.EdgeOrderManagementClient`'s + :attr:`products_and_configurations` attribute. + """ - return deserialized # type: ignore + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def begin_update_order_item( + def list_configurations( self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: _models.OrderItemUpdateParameter, - if_match: Optional[str] = None, + configurations_request: _models.ConfigurationsRequest, *, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. + ) -> AsyncItemPaged["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. - :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.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 + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: ~azure.mgmt.edgeorder.models.ConfigurationsRequest + :keyword skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :paramtype 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 - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :return: An iterator like instance of Configuration + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update_order_item( + def list_configurations( self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: IO[bytes], - if_match: Optional[str] = None, + configurations_request: _types.ConfigurationsRequest, *, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. + ) -> AsyncItemPaged["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. - :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[bytes] - :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. + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: ~azure.mgmt.edgeorder.types.ConfigurationsRequest + :keyword skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :paramtype 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 - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.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[bytes]], - 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[bytes] type. Required. - :type order_item_update_parameter: ~azure.mgmt.edgeorder.models.OrderItemUpdateParameter or - IO[bytes] - :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 - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :return: An iterator like instance of Configuration + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.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, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.OrderItemResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OrderItemResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) @overload - async def cancel_order_item( # pylint: disable=inconsistent-return-statements + def list_configurations( self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: _models.CancellationReason, + configurations_request: IO[bytes], *, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Cancel order item. + ) -> AsyncItemPaged["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. - :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.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: IO[bytes] + :keyword skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :paramtype 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 - :return: None or the result of cls(response) - :rtype: None + :return: An iterator like instance of Configuration + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ - @overload - async def cancel_order_item( # pylint: disable=inconsistent-return-statements + @distributed_trace + def list_configurations( self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: IO[bytes], + configurations_request: Union[_models.ConfigurationsRequest, _types.ConfigurationsRequest, IO[bytes]], *, - content_type: str = "application/json", + skip_token: Optional[str] = None, **kwargs: Any - ) -> None: - """Cancel order item. + ) -> AsyncItemPaged["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. - :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[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO[bytes] type. Required. + :type configurations_request: ~azure.mgmt.edgeorder.models.ConfigurationsRequest or + ~azure.mgmt.edgeorder.types.ConfigurationsRequest or IO[bytes] + :keyword skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of Configuration + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - @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[bytes]], - **kwargs: Any - ) -> None: - """Cancel order item. + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.Configuration]] = kwargs.pop("cls", None) - :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[bytes] type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.models.CancellationReason or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None _content = None - if isinstance(cancellation_reason, (IOBase, bytes)): - _content = cancellation_reason + if isinstance(configurations_request, (IOBase, bytes)): + _content = configurations_request 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) + _content = json.dumps(configurations_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - async def _return_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _request = build_products_and_configurations_list_configurations_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(return_order_item_details, (IOBase, bytes)): - _content = return_order_item_details - else: - _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") + return _request - _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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Configuration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + async def get_next(next_link=None): + _request = prepare_request(next_link) - response = pipeline_response.http_response + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - 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 response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + return pipeline_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return AsyncItemPaged(get_next, extract_data) - return deserialized # type: ignore + @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 + ) -> AsyncItemPaged["_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.models.ProductFamiliesRequest + :keyword expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :paramtype expand: str + :keyword 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. + :paramtype 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 + :return: An iterator like instance of ProductFamily + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ @overload - async def begin_return_order_item( + def list_product_families( self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: _models.ReturnOrderItemDetails, + product_families_request: _types.ProductFamiliesRequest, *, + expand: Optional[str] = None, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. + ) -> AsyncItemPaged["_models.ProductFamily"]: + """List product families for the given subscription. - :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: ~azure.mgmt.edgeorder.models.ReturnOrderItemDetails + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: ~azure.mgmt.edgeorder.types.ProductFamiliesRequest + :keyword expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :paramtype expand: str + :keyword 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. + :paramtype 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 - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: An iterator like instance of ProductFamily + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_return_order_item( + def list_product_families( self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: IO[bytes], + product_families_request: IO[bytes], *, + expand: Optional[str] = None, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. + ) -> AsyncItemPaged["_models.ProductFamily"]: + """List product families for the given subscription. - :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[bytes] + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: IO[bytes] + :keyword expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :paramtype expand: str + :keyword 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. + :paramtype 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 - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: An iterator like instance of ProductFamily + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async - async def begin_return_order_item( + @distributed_trace + def list_product_families( self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO[bytes]], + product_families_request: Union[_models.ProductFamiliesRequest, _types.ProductFamiliesRequest, IO[bytes]], + *, + expand: Optional[str] = None, + skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. + ) -> AsyncItemPaged["_models.ProductFamily"]: + """List product families for the given subscription. - :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[bytes] type. Required. - :type return_order_item_details: ~azure.mgmt.edgeorder.models.ReturnOrderItemDetails or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO[bytes] type. Required. + :type product_families_request: ~azure.mgmt.edgeorder.models.ProductFamiliesRequest or + ~azure.mgmt.edgeorder.types.ProductFamiliesRequest or IO[bytes] + :keyword expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :paramtype expand: str + :keyword 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. + :paramtype skip_token: str + :return: An iterator like instance of ProductFamily + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - 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( - order_item_name=order_item_name, - resource_group_name=resource_group_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 + cls: ClsType[List[_models.ProductFamily]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _content = None + if isinstance(product_families_request, (IOBase, bytes)): + _content = product_families_request + else: + _content = json.dumps(product_families_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + def prepare_request(next_link=None): + if not next_link: + + _request = build_products_and_configurations_list_product_families_request( + subscription_id=self._config.subscription_id, + expand=expand, + skip_token=skip_token, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ProductFamily], + deserialized.get("value", []), ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_product_families_metadata( + self, *, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.ProductFamiliesMetadataDetails"]: + """List product families metadata for the given subscription. + + :keyword 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. + :paramtype skip_token: str + :return: An iterator like instance of ProductFamiliesMetadataDetails + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ProductFamiliesMetadataDetails]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_products_and_configurations_list_product_families_metadata_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ProductFamiliesMetadataDetails], + deserialized.get("value", []), + ) if cls: - return cls(pipeline_response, None, {}) # type: ignore + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_patch.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/__init__.py index d3d9ea404673..aab31f3030b7 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/__init__.py @@ -2,126 +2,164 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -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 typing import TYPE_CHECKING -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 +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AdditionalConfiguration, + AddressDetails, + AddressProperties, + AddressResource, + AddressUpdateParameter, + AddressUpdateProperties, + AvailabilityInformation, + BasicInformation, + BillingMeterDetails, + CancellationReason, + CategoryInformation, + ChildConfiguration, + ChildConfigurationFilter, + ChildConfigurationProperties, + CommonProperties, + Configuration, + ConfigurationDeviceDetails, + ConfigurationFilter, + ConfigurationProperties, + ConfigurationsRequest, + ContactDetails, + CostInformation, + CustomerSubscriptionDetails, + CustomerSubscriptionRegisteredFeatures, + Description, + DeviceDetails, + DevicePresenceVerificationDetails, + Dimensions, + DisplayInfo, + EncryptionPreferences, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + FilterableProperty, + ForwardShippingDetails, + GroupedChildConfigurations, + HierarchyInformation, + ImageInformation, + Link, + ManagementResourcePreferences, + MeterDetails, + NotificationPreference, + Operation, + OperationDisplay, + OrderItemDetails, + OrderItemDetailsUpdateParameter, + OrderItemProperties, + OrderItemResource, + OrderItemUpdateParameter, + OrderItemUpdateProperties, + OrderProperties, + OrderResource, + Pav2MeterDetails, + Preferences, + Product, + ProductDetails, + ProductDetailsUpdateParameter, + ProductFamiliesMetadataDetails, + ProductFamiliesRequest, + ProductFamily, + ProductFamilyProperties, + ProductLine, + ProductLineProperties, + ProductProperties, + ProvisioningDetails, + ProxyResource, + PurchaseMeterDetails, + Resource, + ResourceIdentity, + ResourceProviderDetails, + ReturnOrderItemDetails, + ReverseShippingDetails, + ShippingAddress, + SiteDetails, + Specification, + StageDetails, + SystemData, + TermCommitmentInformation, + TermCommitmentPreferences, + TermTypeDetails, + TrackedResource, + TransportPreferences, + UserAssignedIdentity, +) + +from ._enums import ( # type: ignore + ActionStatusEnum, + ActionType, + AddressClassification, + AddressType, + AddressValidationStatus, + AutoProvisioningStatus, + AvailabilityStage, + BillingType, + ChargingType, + ChildConfigurationType, + CreatedByType, + DescriptionType, + DevicePresenceVerificationStatus, + DisabledReason, + DoubleEncryptionStatus, + FulfillmentType, + IdentificationType, + ImageType, + LengthHeightUnit, + LinkType, + MeteringType, + NotificationStageName, + OrderItemCancellationEnum, + OrderItemReturnEnum, + OrderItemType, + OrderMode, + Origin, + ProvisioningState, + ProvisioningSupport, + StageName, + StageStatus, + SupportedFilterTypes, + TermCommitmentType, + TransportShipmentTypes, + WeightMeasurementUnit, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "AdditionalConfiguration", "AddressDetails", "AddressProperties", "AddressResource", - "AddressResourceList", "AddressUpdateParameter", + "AddressUpdateProperties", "AvailabilityInformation", "BasicInformation", "BillingMeterDetails", "CancellationReason", + "CategoryInformation", + "ChildConfiguration", + "ChildConfigurationFilter", + "ChildConfigurationProperties", "CommonProperties", "Configuration", - "ConfigurationFilters", + "ConfigurationDeviceDetails", + "ConfigurationFilter", "ConfigurationProperties", - "Configurations", "ConfigurationsRequest", "ContactDetails", "CostInformation", @@ -129,6 +167,7 @@ "CustomerSubscriptionRegisteredFeatures", "Description", "DeviceDetails", + "DevicePresenceVerificationDetails", "Dimensions", "DisplayInfo", "EncryptionPreferences", @@ -137,6 +176,7 @@ "ErrorResponse", "FilterableProperty", "ForwardShippingDetails", + "GroupedChildConfigurations", "HierarchyInformation", "ImageInformation", "Link", @@ -145,19 +185,19 @@ "NotificationPreference", "Operation", "OperationDisplay", - "OperationListResult", "OrderItemDetails", + "OrderItemDetailsUpdateParameter", + "OrderItemProperties", "OrderItemResource", - "OrderItemResourceList", "OrderItemUpdateParameter", + "OrderItemUpdateProperties", + "OrderProperties", "OrderResource", - "OrderResourceList", "Pav2MeterDetails", "Preferences", "Product", "ProductDetails", - "ProductFamilies", - "ProductFamiliesMetadata", + "ProductDetailsUpdateParameter", "ProductFamiliesMetadataDetails", "ProductFamiliesRequest", "ProductFamily", @@ -165,6 +205,7 @@ "ProductLine", "ProductLineProperties", "ProductProperties", + "ProvisioningDetails", "ProxyResource", "PurchaseMeterDetails", "Resource", @@ -173,23 +214,33 @@ "ReturnOrderItemDetails", "ReverseShippingDetails", "ShippingAddress", - "ShippingDetails", + "SiteDetails", "Specification", "StageDetails", "SystemData", + "TermCommitmentInformation", + "TermCommitmentPreferences", + "TermTypeDetails", "TrackedResource", "TransportPreferences", + "UserAssignedIdentity", "ActionStatusEnum", "ActionType", + "AddressClassification", "AddressType", "AddressValidationStatus", + "AutoProvisioningStatus", "AvailabilityStage", "BillingType", "ChargingType", + "ChildConfigurationType", "CreatedByType", "DescriptionType", + "DevicePresenceVerificationStatus", "DisabledReason", "DoubleEncryptionStatus", + "FulfillmentType", + "IdentificationType", "ImageType", "LengthHeightUnit", "LinkType", @@ -198,12 +249,16 @@ "OrderItemCancellationEnum", "OrderItemReturnEnum", "OrderItemType", + "OrderMode", "Origin", + "ProvisioningState", + "ProvisioningSupport", "StageName", "StageStatus", "SupportedFilterTypes", + "TermCommitmentType", "TransportShipmentTypes", "WeightMeasurementUnit", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_edge_order_management_client_enums.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_enums.py similarity index 62% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_edge_order_management_client_enums.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_enums.py index e0ba5928071e..2951adfd4841 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_edge_order_management_client_enums.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_enums.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -20,9 +20,21 @@ class ActionStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" + """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + only APIs. + """ INTERNAL = "Internal" + """Actions are for internal-only APIs.""" + + +class AddressClassification(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of address based on its usage context.""" + + SHIPPING = "Shipping" + """Shipping address for the order.""" + SITE = "Site" + """Site Address.""" class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -47,21 +59,33 @@ class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Address provided is ambiguous, please choose one of the alternate addresses returned.""" +class AutoProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Auto Provisioning Details.""" + + ENABLED = "Enabled" + """Provisioning Enabled. Will act as pre-approved, and arc extension will be enabled as soon as + the device is verified to be at the right edge location.""" + DISABLED = "Disabled" + """Provisioning Disabled.""" + + class AvailabilityStage(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current availability stage of the product. Availability stage.""" + """Current availability stage of the product.""" AVAILABLE = "Available" """Product is available.""" - COMING_SOON = "ComingSoon" - """Product is coming soon.""" PREVIEW = "Preview" """Product is in preview.""" - DEPRECATED = "Deprecated" - """Product is deprecated.""" 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): @@ -82,13 +106,26 @@ class ChargingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Per device charging type.""" +class ChildConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of 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.""" + """The kind of entity that created the resource.""" USER = "User" + """The entity was created by a user.""" APPLICATION = "Application" + """The entity was created by an application.""" MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" KEY = "Key" + """The entity was created by a key.""" class DescriptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -98,6 +135,17 @@ class DescriptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Base description.""" +class DevicePresenceVerificationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Proof of possession status.""" + + NOT_INITIATED = "NotInitiated" + """The device has not yet been verified to be with the right edge operator or at the right + location.""" + COMPLETED = "Completed" + """Confirms that the device is verified to be with the right edge operator or at the right + location.""" + + class DisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Reason why the product is disabled.""" @@ -126,9 +174,28 @@ class DoubleEncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ DISABLED = "Disabled" - """Double encryption is disabled""" + """Double encryption is disabled.""" ENABLED = "Enabled" - """Double encryption is 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): @@ -149,8 +216,6 @@ class LengthHeightUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Inch, applicable for West US.""" CM = "CM" """Centimeter.""" - IN_ENUM = "IN" - """Inch, applicable for West US.""" class LinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -163,11 +228,13 @@ class LinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SPECIFICATION = "Specification" """Link to product specification.""" DOCUMENTATION = "Documentation" - """Link to product documentation""" + """Link to product documentation.""" KNOW_MORE = "KnowMore" - """Link to know more""" + """Link to know more.""" SIGN_UP = "SignUp" - """Link to sign up for products""" + """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): @@ -219,6 +286,17 @@ class OrderItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Purchase OrderItem.""" RENTAL = "Rental" """Rental OrderItem.""" + EXTERNAL = "External" + """Orders placed outside of azure.""" + + +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): @@ -227,33 +305,60 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ USER = "user" + """Indicates the operation is initiated by a user.""" SYSTEM = "system" + """Indicates the operation is initiated by a system.""" USER_SYSTEM = "user,system" + """Indicates the operation is initiated by a user or system.""" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state.""" + + CREATING = "Creating" + """Creating state.""" + SUCCEEDED = "Succeeded" + """Succeeded state.""" + FAILED = "Failed" + """Failed state.""" + CANCELED = "Canceled" + """Canceled state.""" + + +class ProvisioningSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Determining nature of provisioning that the configuration supports.""" + + CLOUD_BASED = "CloudBased" + """The configuration can be provisioned from the cloud.""" + MANUAL = "Manual" + """The configuration need to be provisioned manually by the end user.""" class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Stage name.""" PLACED = "Placed" - """Currently in draft mode and can still be cancelled""" + """Currently in draft mode and can still be cancelled.""" IN_REVIEW = "InReview" - """Order is currently in draft mode and can still be cancelled""" + """Order is currently in draft mode and can still be cancelled.""" CONFIRMED = "Confirmed" - """Order is confirmed""" + """Order is confirmed.""" READY_TO_SHIP = "ReadyToShip" - """Order is ready to ship""" + """Order is ready to ship.""" SHIPPED = "Shipped" - """Order is in transit to customer""" + """Order is in transit to customer.""" DELIVERED = "Delivered" - """Order is delivered to customer""" + """Order is delivered to customer.""" + READY_TO_SETUP = "ReadyToSetup" + """Order is ready to get cloud connected.""" IN_USE = "InUse" - """Order is in use at customer site""" + """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.""" + """Order is in transit from customer to Microsoft.""" RETURNED_TO_MICROSOFT = "ReturnedToMicrosoft" - """Order has been received back to microsoft.""" + """Order has been received back to Microsoft.""" RETURN_COMPLETED = "ReturnCompleted" """Return has now completed.""" CANCELLED = "Cancelled" @@ -281,9 +386,20 @@ class SupportedFilterTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of product filter.""" SHIP_TO_COUNTRIES = "ShipToCountries" - """Ship to country""" + """Ship to country.""" DOUBLE_ENCRYPTION_STATUS = "DoubleEncryptionStatus" - """Double encryption status""" + """Double encryption status.""" + + +class TermCommitmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Term Commitment Type.""" + + NONE = "None" + """Pay as you go Term Commitment Model.""" + TRIAL = "Trial" + """Trial Term Commitment Model.""" + TIMED = "Timed" + """Time based Term Commitment Model.""" class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models.py new file mode 100644 index 000000000000..3ded8c60394e --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models.py @@ -0,0 +1,3414 @@ +# pylint: disable=line-too-long,useless-suppression,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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_discriminator, rest_field +from ._enums import BillingType + +if TYPE_CHECKING: + from .. import models as _models + + +class AdditionalConfiguration(_Model): + """Additional Configuration details. + + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the + configuration. Required. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation + :ivar quantity: Quantity of the product. Required. + :vartype quantity: int + :ivar provisioning_details: List Provisioning Details for Devices in Additional Config. + :vartype provisioning_details: list[~azure.mgmt.edgeorder.models.ProvisioningDetails] + """ + + hierarchy_information: "_models.HierarchyInformation" = rest_field( + name="hierarchyInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Hierarchy of the product which uniquely identifies the configuration. Required.""" + quantity: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Quantity of the product. Required.""" + provisioning_details: Optional[list["_models.ProvisioningDetails"]] = rest_field( + name="provisioningDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """List Provisioning Details for Devices in Additional Config.""" + + @overload + def __init__( + self, + *, + hierarchy_information: "_models.HierarchyInformation", + quantity: int, + provisioning_details: Optional[list["_models.ProvisioningDetails"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AddressDetails(_Model): + """Address details for an order item. + + :ivar forward_address: Customer address and contact details. Required. + :vartype forward_address: ~azure.mgmt.edgeorder.models.AddressProperties + :ivar return_address: Return shipping address. + :vartype return_address: ~azure.mgmt.edgeorder.models.AddressProperties + """ + + forward_address: "_models.AddressProperties" = rest_field( + name="forwardAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer address and contact details. Required.""" + return_address: Optional["_models.AddressProperties"] = rest_field(name="returnAddress", visibility=["read"]) + """Return shipping address.""" + + @overload + def __init__( + self, + *, + forward_address: "_models.AddressProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AddressProperties(_Model): + """Address Properties. + + :ivar address_classification: Type of address based on its usage context. Known values are: + "Shipping" and "Site". + :vartype address_classification: str or ~azure.mgmt.edgeorder.models.AddressClassification + :ivar shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress + :ivar contact_details: Contact details for the address. + :vartype contact_details: ~azure.mgmt.edgeorder.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.models.AddressValidationStatus + :ivar provisioning_state: Provisioning state. Known values are: "Creating", "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.edgeorder.models.ProvisioningState + """ + + address_classification: Optional[Union[str, "_models.AddressClassification"]] = rest_field( + name="addressClassification", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of address based on its usage context. Known values are: \"Shipping\" and \"Site\".""" + shipping_address: Optional["_models.ShippingAddress"] = rest_field( + name="shippingAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Shipping details for the address.""" + contact_details: Optional["_models.ContactDetails"] = rest_field( + name="contactDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Contact details for the address.""" + address_validation_status: Optional[Union[str, "_models.AddressValidationStatus"]] = rest_field( + name="addressValidationStatus", visibility=["read"] + ) + """Status of address validation. Known values are: \"Valid\", \"Invalid\", and \"Ambiguous\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state. Known values are: \"Creating\", \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + @overload + def __init__( + self, + *, + address_classification: Optional[Union[str, "_models.AddressClassification"]] = None, + shipping_address: Optional["_models.ShippingAddress"] = None, + contact_details: Optional["_models.ContactDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Resource(_Model): + """Resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.edgeorder.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.edgeorder.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AddressResource(TrackedResource): + """Address Resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.edgeorder.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Properties of an address. Required. + :vartype properties: ~azure.mgmt.edgeorder.models.AddressProperties + """ + + properties: "_models.AddressProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Properties of an address. Required.""" + + __flattened_items = [ + "address_classification", + "shipping_address", + "contact_details", + "address_validation_status", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.AddressProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class AddressUpdateParameter(_Model): + """The Address update parameters. + + :ivar properties: Properties of an address to be updated. + :vartype properties: ~azure.mgmt.edgeorder.models.AddressUpdateProperties + :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] + """ + + properties: Optional["_models.AddressUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of an address to be updated.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The list of key value pairs that describe the resource. These tags can be used in viewing and + grouping this resource (across resource groups).""" + + __flattened_items = ["shipping_address", "contact_details"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.AddressUpdateProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class AddressUpdateProperties(_Model): + """Address Update Properties. + + :ivar shipping_address: Shipping details for the address. + :vartype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress + :ivar contact_details: Contact details for the address. + :vartype contact_details: ~azure.mgmt.edgeorder.models.ContactDetails + """ + + shipping_address: Optional["_models.ShippingAddress"] = rest_field( + name="shippingAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Shipping details for the address.""" + contact_details: Optional["_models.ContactDetails"] = rest_field( + name="contactDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Contact details for the address.""" + + @overload + def __init__( + self, + *, + shipping_address: Optional["_models.ShippingAddress"] = None, + contact_details: Optional["_models.ContactDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AvailabilityInformation(_Model): + """Availability information of a product system. + + :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.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.models.DisabledReason + :ivar disabled_reason_message: Message for why the product is disabled. + :vartype disabled_reason_message: str + """ + + availability_stage: Optional[Union[str, "_models.AvailabilityStage"]] = rest_field( + name="availabilityStage", visibility=["read"] + ) + """Current availability stage of the product. Known values are: \"Available\", \"Preview\", + \"Signup\", \"Discoverable\", \"ComingSoon\", \"Unavailable\", and \"Deprecated\".""" + disabled_reason: Optional[Union[str, "_models.DisabledReason"]] = rest_field( + name="disabledReason", visibility=["read"] + ) + """Reason why the product is disabled. Known values are: \"None\", \"Country\", \"Region\", + \"Feature\", \"OfferType\", \"NoSubscriptionInfo\", \"NotAvailable\", and \"OutOfStock\".""" + disabled_reason_message: Optional[str] = rest_field(name="disabledReasonMessage", visibility=["read"]) + """Message for why the product is disabled.""" + + +class BasicInformation(_Model): + """Basic information for any product system. + + :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.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.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.models.FulfillmentType + """ + + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """Display Name for the product system.""" + description: Optional["_models.Description"] = rest_field(visibility=["read"]) + """Description related to the product system.""" + image_information: Optional[list["_models.ImageInformation"]] = rest_field( + name="imageInformation", visibility=["read"] + ) + """Image information for the product system.""" + cost_information: Optional["_models.CostInformation"] = rest_field(name="costInformation", visibility=["read"]) + """Cost information for the product system.""" + availability_information: Optional["_models.AvailabilityInformation"] = rest_field( + name="availabilityInformation", visibility=["read"] + ) + """Availability information of the product system.""" + hierarchy_information: Optional["_models.HierarchyInformation"] = rest_field( + name="hierarchyInformation", visibility=["read"] + ) + """Hierarchy information of a product.""" + fulfilled_by: Optional[Union[str, "_models.FulfillmentType"]] = rest_field(name="fulfilledBy", visibility=["read"]) + """The entity responsible for fulfillment of the item at the given hierarchy level. Known values + are: \"Microsoft\" and \"External\".""" + + +class BillingMeterDetails(_Model): + """Holds billing meter details for each type of billing. + + :ivar name: Represents Billing type name. + :vartype name: str + :ivar meter_details: Represents MeterDetails. + :vartype meter_details: ~azure.mgmt.edgeorder.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.models.MeteringType + :ivar frequency: Frequency of recurrence. + :vartype frequency: str + :ivar term_type_details: Represent Term Type details. + :vartype term_type_details: ~azure.mgmt.edgeorder.models.TermTypeDetails + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Represents Billing type name.""" + meter_details: Optional["_models.MeterDetails"] = rest_field(name="meterDetails", visibility=["read"]) + """Represents MeterDetails.""" + metering_type: Optional[Union[str, "_models.MeteringType"]] = rest_field(name="meteringType", visibility=["read"]) + """Represents Metering type (eg one-time or recurrent). Known values are: \"OneTime\", + \"Recurring\", and \"Adhoc\".""" + frequency: Optional[str] = rest_field(visibility=["read"]) + """Frequency of recurrence.""" + term_type_details: Optional["_models.TermTypeDetails"] = rest_field(name="termTypeDetails", visibility=["read"]) + """Represent Term Type details.""" + + +class CancellationReason(_Model): + """Reason for cancellation. + + :ivar reason: Reason for cancellation. Required. + :vartype reason: str + """ + + reason: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Reason for cancellation. Required.""" + + @overload + def __init__( + self, + *, + reason: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CategoryInformation(_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.models.Link] + """ + + category_name: Optional[str] = rest_field( + name="categoryName", visibility=["read", "create", "update", "delete", "query"] + ) + """Category name of the child configuration.""" + category_display_name: Optional[str] = rest_field( + name="categoryDisplayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Category display name of the child configuration.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description text for the category.""" + links: Optional[list["_models.Link"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Links for the category.""" + + @overload + def __init__( + self, + *, + category_name: Optional[str] = None, + category_display_name: Optional[str] = None, + description: Optional[str] = None, + links: Optional[list["_models.Link"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChildConfiguration(_Model): + """Child configuration object. + + :ivar properties: Properties of child configuration. + :vartype properties: ~azure.mgmt.edgeorder.models.ChildConfigurationProperties + """ + + properties: Optional["_models.ChildConfigurationProperties"] = rest_field(visibility=["read"]) + """Properties of child configuration.""" + + __flattened_items = [ + "child_configuration_type", + "is_part_of_base_configuration", + "minimum_quantity", + "maximum_quantity", + "specifications", + "dimensions", + "provisioning_support", + "child_configuration_types", + "grouped_child_configurations", + "supported_term_commitment_durations", + "filterable_properties", + "display_name", + "description", + "image_information", + "cost_information", + "availability_information", + "hierarchy_information", + "fulfilled_by", + ] + + +class ChildConfigurationFilter(_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.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.models.ChildConfigurationType] + """ + + hierarchy_informations: Optional[list["_models.HierarchyInformation"]] = rest_field( + name="hierarchyInformations", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of child configuration hierarchy customer wants to filter for the given configuration.""" + child_configuration_types: Optional[list[Union[str, "_models.ChildConfigurationType"]]] = rest_field( + name="childConfigurationTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """Filter to fetch all child configurations belonging to the given list of configuration types.""" + + @overload + def __init__( + self, + *, + hierarchy_informations: Optional[list["_models.HierarchyInformation"]] = None, + child_configuration_types: Optional[list[Union[str, "_models.ChildConfigurationType"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChildConfigurationProperties(_Model): + """Properties of child configuration. + + :ivar child_configuration_type: Child configuration type. Known values are: + "DeviceConfiguration" and "AdditionalConfiguration". + :vartype child_configuration_type: str or ~azure.mgmt.edgeorder.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.models.Specification] + :ivar dimensions: Dimensions of the configuration. + :vartype dimensions: ~azure.mgmt.edgeorder.models.Dimensions + :ivar provisioning_support: Determining nature of provisioning that the configuration supports. + Known values are: "CloudBased" and "Manual". + :vartype provisioning_support: str or ~azure.mgmt.edgeorder.models.ProvisioningSupport + :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.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.models.GroupedChildConfigurations] + :ivar supported_term_commitment_durations: The Term Commitment Durations that are supported for + a configuration. + :vartype supported_term_commitment_durations: list[~datetime.timedelta] + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list[~azure.mgmt.edgeorder.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.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.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.models.FulfillmentType + """ + + child_configuration_type: Optional[Union[str, "_models.ChildConfigurationType"]] = rest_field( + name="childConfigurationType", visibility=["read"] + ) + """Child configuration type. Known values are: \"DeviceConfiguration\" and + \"AdditionalConfiguration\".""" + is_part_of_base_configuration: Optional[bool] = rest_field(name="isPartOfBaseConfiguration", visibility=["read"]) + """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.""" + minimum_quantity: Optional[int] = rest_field(name="minimumQuantity", visibility=["read"]) + """Minimum quantity a customer can order while choosing this configuration.""" + maximum_quantity: Optional[int] = rest_field(name="maximumQuantity", visibility=["read"]) + """Maximum quantity a customer can order while choosing this configuration.""" + specifications: Optional[list["_models.Specification"]] = rest_field(visibility=["read"]) + """Specifications of the configuration.""" + dimensions: Optional["_models.Dimensions"] = rest_field(visibility=["read"]) + """Dimensions of the configuration.""" + provisioning_support: Optional[Union[str, "_models.ProvisioningSupport"]] = rest_field( + name="provisioningSupport", visibility=["read"] + ) + """Determining nature of provisioning that the configuration supports. Known values are: + \"CloudBased\" and \"Manual\".""" + child_configuration_types: Optional[list[Union[str, "_models.ChildConfigurationType"]]] = rest_field( + name="childConfigurationTypes", visibility=["read"] + ) + """Different types of child configurations which exist for this configuration, these can be used + to populate the child configuration filter.""" + grouped_child_configurations: Optional[list["_models.GroupedChildConfigurations"]] = rest_field( + name="groupedChildConfigurations", visibility=["read"] + ) + """Child configurations present for the configuration after applying child configuration filter, + grouped by the category name of the child configuration.""" + supported_term_commitment_durations: Optional[list[datetime.timedelta]] = rest_field( + name="supportedTermCommitmentDurations", visibility=["read"] + ) + """The Term Commitment Durations that are supported for a configuration.""" + filterable_properties: Optional[list["_models.FilterableProperty"]] = rest_field( + name="filterableProperties", visibility=["read"] + ) + """List of filters supported for a product.""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """Display Name for the product system.""" + description: Optional["_models.Description"] = rest_field(visibility=["read"]) + """Description related to the product system.""" + image_information: Optional[list["_models.ImageInformation"]] = rest_field( + name="imageInformation", visibility=["read"] + ) + """Image information for the product system.""" + cost_information: Optional["_models.CostInformation"] = rest_field(name="costInformation", visibility=["read"]) + """Cost information for the product system.""" + availability_information: Optional["_models.AvailabilityInformation"] = rest_field( + name="availabilityInformation", visibility=["read"] + ) + """Availability information of the product system.""" + hierarchy_information: Optional["_models.HierarchyInformation"] = rest_field( + name="hierarchyInformation", visibility=["read"] + ) + """Hierarchy information of a product.""" + fulfilled_by: Optional[Union[str, "_models.FulfillmentType"]] = rest_field(name="fulfilledBy", visibility=["read"]) + """The entity responsible for fulfillment of the item at the given hierarchy level. Known values + are: \"Microsoft\" and \"External\".""" + + +class CommonProperties(BasicInformation): + """Represents common properties across product hierarchy. + + :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.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.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.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] + """ + + filterable_properties: Optional[list["_models.FilterableProperty"]] = rest_field( + name="filterableProperties", visibility=["read"] + ) + """List of filters supported for a product.""" + + +class Configuration(_Model): + """Configuration object. + + :ivar properties: Properties of configuration. + :vartype properties: ~azure.mgmt.edgeorder.models.ConfigurationProperties + """ + + properties: Optional["_models.ConfigurationProperties"] = rest_field(visibility=["read"]) + """Properties of configuration.""" + + __flattened_items = [ + "display_name", + "description", + "image_information", + "cost_information", + "availability_information", + "hierarchy_information", + "fulfilled_by", + "filterable_properties", + "specifications", + "dimensions", + "provisioning_support", + "child_configuration_types", + "grouped_child_configurations", + "supported_term_commitment_durations", + ] + + +class ConfigurationDeviceDetails(_Model): + """Device details for configuration. + + :ivar display_info: Display details of the product. + :vartype display_info: ~azure.mgmt.edgeorder.models.DisplayInfo + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the + configuration. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.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.models.IdentificationType + :ivar device_details: List of device details. + :vartype device_details: list[~azure.mgmt.edgeorder.models.DeviceDetails] + :ivar term_commitment_information: Term Commitment Information of the Device. + :vartype term_commitment_information: ~azure.mgmt.edgeorder.models.TermCommitmentInformation + """ + + display_info: Optional["_models.DisplayInfo"] = rest_field( + name="displayInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """Display details of the product.""" + hierarchy_information: Optional["_models.HierarchyInformation"] = rest_field( + name="hierarchyInformation", visibility=["read"] + ) + """Hierarchy of the product which uniquely identifies the configuration.""" + quantity: Optional[int] = rest_field(visibility=["read"]) + """Quantity of the product.""" + identification_type: Optional[Union[str, "_models.IdentificationType"]] = rest_field( + name="identificationType", visibility=["read"] + ) + """Identification type of the configuration. Known values are: \"NotSupported\" and + \"SerialNumber\".""" + device_details: Optional[list["_models.DeviceDetails"]] = rest_field(name="deviceDetails", visibility=["read"]) + """List of device details.""" + term_commitment_information: Optional["_models.TermCommitmentInformation"] = rest_field( + name="termCommitmentInformation", visibility=["read"] + ) + """Term Commitment Information of the Device.""" + + @overload + def __init__( + self, + *, + display_info: Optional["_models.DisplayInfo"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConfigurationFilter(_Model): + """Configuration filters. + + :ivar hierarchy_information: Product hierarchy information. Required. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation + :ivar filterable_property: Filters specific to product. + :vartype filterable_property: list[~azure.mgmt.edgeorder.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.models.ChildConfigurationFilter + """ + + hierarchy_information: "_models.HierarchyInformation" = rest_field( + name="hierarchyInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Product hierarchy information. Required.""" + filterable_property: Optional[list["_models.FilterableProperty"]] = rest_field( + name="filterableProperty", visibility=["read", "create", "update", "delete", "query"] + ) + """Filters specific to product.""" + child_configuration_filter: Optional["_models.ChildConfigurationFilter"] = rest_field( + name="childConfigurationFilter", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + + @overload + def __init__( + self, + *, + hierarchy_information: "_models.HierarchyInformation", + filterable_property: Optional[list["_models.FilterableProperty"]] = None, + child_configuration_filter: Optional["_models.ChildConfigurationFilter"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConfigurationProperties(CommonProperties): + """Properties of configuration. + + :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.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.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.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] + :ivar specifications: Specifications of the configuration. + :vartype specifications: list[~azure.mgmt.edgeorder.models.Specification] + :ivar dimensions: Dimensions of the configuration. + :vartype dimensions: ~azure.mgmt.edgeorder.models.Dimensions + :ivar provisioning_support: Determining nature of provisioning that the configuration supports. + Known values are: "CloudBased" and "Manual". + :vartype provisioning_support: str or ~azure.mgmt.edgeorder.models.ProvisioningSupport + :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.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.models.GroupedChildConfigurations] + :ivar supported_term_commitment_durations: The Term Commitment Durations that are supported for + a configuration. + :vartype supported_term_commitment_durations: list[~datetime.timedelta] + """ + + specifications: Optional[list["_models.Specification"]] = rest_field(visibility=["read"]) + """Specifications of the configuration.""" + dimensions: Optional["_models.Dimensions"] = rest_field(visibility=["read"]) + """Dimensions of the configuration.""" + provisioning_support: Optional[Union[str, "_models.ProvisioningSupport"]] = rest_field( + name="provisioningSupport", visibility=["read"] + ) + """Determining nature of provisioning that the configuration supports. Known values are: + \"CloudBased\" and \"Manual\".""" + child_configuration_types: Optional[list[Union[str, "_models.ChildConfigurationType"]]] = rest_field( + name="childConfigurationTypes", visibility=["read"] + ) + """Different types of child configurations which exist for this configuration, these can be used + to populate the child configuration filter.""" + grouped_child_configurations: Optional[list["_models.GroupedChildConfigurations"]] = rest_field( + name="groupedChildConfigurations", visibility=["read"] + ) + """Child configurations present for the configuration after applying child configuration filter, + grouped by the category name of the child configuration.""" + supported_term_commitment_durations: Optional[list[datetime.timedelta]] = rest_field( + name="supportedTermCommitmentDurations", visibility=["read"] + ) + """The Term Commitment Durations that are supported for a configuration.""" + + +class ConfigurationsRequest(_Model): + """Configuration request object. + + :ivar configuration_filter: Holds details about product hierarchy information and filterable + property. + :vartype configuration_filter: ~azure.mgmt.edgeorder.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.models.CustomerSubscriptionDetails + """ + + configuration_filter: Optional["_models.ConfigurationFilter"] = rest_field( + name="configurationFilter", visibility=["read", "create", "update", "delete", "query"] + ) + """Holds details about product hierarchy information and filterable property.""" + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = rest_field( + name="customerSubscriptionDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer subscription properties. Clients can display available products to unregistered + customers by explicitly passing subscription details.""" + + @overload + def __init__( + self, + *, + configuration_filter: Optional["_models.ConfigurationFilter"] = None, + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ContactDetails(_Model): + """Contact Details. + + :ivar contact_name: Contact name of the person. + :vartype contact_name: str + :ivar phone: Phone number of the contact person. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: List of Email-ids to be notified about job progress. + :vartype email_list: list[str] + """ + + contact_name: Optional[str] = rest_field( + name="contactName", visibility=["read", "create", "update", "delete", "query"] + ) + """Contact name of the person.""" + phone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Phone number of the contact person.""" + phone_extension: Optional[str] = rest_field( + name="phoneExtension", visibility=["read", "create", "update", "delete", "query"] + ) + """Phone extension number of the contact person.""" + mobile: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Mobile number of the contact person.""" + email_list: Optional[list[str]] = rest_field( + name="emailList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Email-ids to be notified about job progress.""" + + @overload + def __init__( + self, + *, + contact_name: Optional[str] = None, + phone: Optional[str] = None, + phone_extension: Optional[str] = None, + mobile: Optional[str] = None, + email_list: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CostInformation(_Model): + """Cost information for the product system. + + :ivar billing_meter_details: Details on the various billing aspects for the product system. + :vartype billing_meter_details: list[~azure.mgmt.edgeorder.models.BillingMeterDetails] + :ivar billing_info_url: Default url to display billing information. + :vartype billing_info_url: str + """ + + billing_meter_details: Optional[list["_models.BillingMeterDetails"]] = rest_field( + name="billingMeterDetails", visibility=["read"] + ) + """Details on the various billing aspects for the product system.""" + billing_info_url: Optional[str] = rest_field(name="billingInfoUrl", visibility=["read"]) + """Default url to display billing information.""" + + +class CustomerSubscriptionDetails(_Model): + """Holds Customer subscription details. Clients can display available products to unregistered + customers by explicitly passing subscription details. + + :ivar registered_features: List of registered feature flags for subscription. + :vartype registered_features: + list[~azure.mgmt.edgeorder.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 + """ + + registered_features: Optional[list["_models.CustomerSubscriptionRegisteredFeatures"]] = rest_field( + name="registeredFeatures", visibility=["read", "create", "update", "delete", "query"] + ) + """List of registered feature flags for subscription.""" + location_placement_id: Optional[str] = rest_field( + name="locationPlacementId", visibility=["read", "create", "update", "delete", "query"] + ) + """Location placement Id of a subscription.""" + quota_id: str = rest_field(name="quotaId", visibility=["read", "create", "update", "delete", "query"]) + """Quota ID of a subscription. Required.""" + + @overload + def __init__( + self, + *, + quota_id: str, + registered_features: Optional[list["_models.CustomerSubscriptionRegisteredFeatures"]] = None, + location_placement_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CustomerSubscriptionRegisteredFeatures(_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 + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of subscription registered feature.""" + state: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """State of subscription registered feature.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + state: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Description(_Model): + """Description related properties of a product system. + + :ivar description_type: Type of description. "Base" + :vartype description_type: str or ~azure.mgmt.edgeorder.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.models.Link] + """ + + description_type: Optional[Union[str, "_models.DescriptionType"]] = rest_field( + name="descriptionType", visibility=["read"] + ) + """Type of description. \"Base\"""" + short_description: Optional[str] = rest_field(name="shortDescription", visibility=["read"]) + """Short description of the product system.""" + long_description: Optional[str] = rest_field(name="longDescription", visibility=["read"]) + """Long description of the product system.""" + keywords: Optional[list[str]] = rest_field(visibility=["read"]) + """Keywords for the product system.""" + attributes: Optional[list[str]] = rest_field(visibility=["read"]) + """Attributes for the product system.""" + links: Optional[list["_models.Link"]] = rest_field(visibility=["read"]) + """Links for the product system.""" + + +class DeviceDetails(_Model): + """Device details. + + :ivar serial_number: Device serial number. + :vartype serial_number: str + :ivar display_serial_number: Device serial number to be displayed. + :vartype display_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 + :ivar provisioning_support: Determining nature of provisioning that the configuration supports. + Known values are: "CloudBased" and "Manual". + :vartype provisioning_support: str or ~azure.mgmt.edgeorder.models.ProvisioningSupport + :ivar provisioning_details: Provisioning Details for the device. + :vartype provisioning_details: ~azure.mgmt.edgeorder.models.ProvisioningDetails + """ + + serial_number: Optional[str] = rest_field(name="serialNumber", visibility=["read"]) + """Device serial number.""" + display_serial_number: Optional[str] = rest_field(name="displaySerialNumber", visibility=["read"]) + """Device serial number to be displayed.""" + management_resource_id: Optional[str] = rest_field(name="managementResourceId", visibility=["read"]) + """Management Resource Id.""" + management_resource_tenant_id: Optional[str] = rest_field(name="managementResourceTenantId", visibility=["read"]) + """Management Resource Tenant ID.""" + provisioning_support: Optional[Union[str, "_models.ProvisioningSupport"]] = rest_field( + name="provisioningSupport", visibility=["read"] + ) + """Determining nature of provisioning that the configuration supports. Known values are: + \"CloudBased\" and \"Manual\".""" + provisioning_details: Optional["_models.ProvisioningDetails"] = rest_field( + name="provisioningDetails", visibility=["read"] + ) + """Provisioning Details for the device.""" + + +class DevicePresenceVerificationDetails(_Model): + """Proof of possession details. + + :ivar status: Proof of possession status. Known values are: "NotInitiated" and "Completed". + :vartype status: str or ~azure.mgmt.edgeorder.models.DevicePresenceVerificationStatus + :ivar message: Insights on current status. + :vartype message: str + """ + + status: Optional[Union[str, "_models.DevicePresenceVerificationStatus"]] = rest_field(visibility=["read"]) + """Proof of possession status. Known values are: \"NotInitiated\" and \"Completed\".""" + message: Optional[str] = rest_field(visibility=["read"]) + """Insights on current status.""" + + +class Dimensions(_Model): + """Dimensions of a configuration. + + :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.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.models.WeightMeasurementUnit + """ + + length: Optional[float] = rest_field(visibility=["read"]) + """Length of the device.""" + height: Optional[float] = rest_field(visibility=["read"]) + """Height of the device.""" + width: Optional[float] = rest_field(visibility=["read"]) + """Width of the device.""" + length_height_unit: Optional[Union[str, "_models.LengthHeightUnit"]] = rest_field( + name="lengthHeightUnit", visibility=["read"] + ) + """Unit for the dimensions of length, height and width. Known values are: \"IN\" and \"CM\".""" + weight: Optional[float] = rest_field(visibility=["read"]) + """Weight of the device.""" + depth: Optional[float] = rest_field(visibility=["read"]) + """Depth of the device.""" + weight_unit: Optional[Union[str, "_models.WeightMeasurementUnit"]] = rest_field( + name="weightUnit", visibility=["read"] + ) + """Unit for the dimensions of weight. Known values are: \"LBS\" and \"KGS\".""" + + +class DisplayInfo(_Model): + """Describes product display information. + + :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 + """ + + product_family_display_name: Optional[str] = rest_field(name="productFamilyDisplayName", visibility=["read"]) + """Product family display name.""" + configuration_display_name: Optional[str] = rest_field(name="configurationDisplayName", visibility=["read"]) + """Configuration display name.""" + + +class EncryptionPreferences(_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.models.DoubleEncryptionStatus + """ + + double_encryption_status: Optional[Union[str, "_models.DoubleEncryptionStatus"]] = rest_field( + name="doubleEncryptionStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """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\".""" + + @overload + def __init__( + self, + *, + double_encryption_status: Optional[Union[str, "_models.DoubleEncryptionStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :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.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.edgeorder.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.edgeorder.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FilterableProperty(_Model): + """Different types of filters supported and its values. + + :ivar type: Type of product filter. Required. Known values are: "ShipToCountries" and + "DoubleEncryptionStatus". + :vartype type: str or ~azure.mgmt.edgeorder.models.SupportedFilterTypes + :ivar supported_values: Values to be filtered. Required. + :vartype supported_values: list[str] + """ + + type: Union[str, "_models.SupportedFilterTypes"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of product filter. Required. Known values are: \"ShipToCountries\" and + \"DoubleEncryptionStatus\".""" + supported_values: list[str] = rest_field( + name="supportedValues", visibility=["read", "create", "update", "delete", "query"] + ) + """Values to be filtered. Required.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.SupportedFilterTypes"], + supported_values: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ForwardShippingDetails(_Model): + """Forward shipment details. + + :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 + """ + + carrier_name: Optional[str] = rest_field(name="carrierName", visibility=["read"]) + """Name of the carrier.""" + carrier_display_name: Optional[str] = rest_field(name="carrierDisplayName", visibility=["read"]) + """Carrier Name for display purpose. Not to be used for any processing.""" + tracking_id: Optional[str] = rest_field(name="trackingId", visibility=["read"]) + """TrackingId of the package.""" + tracking_url: Optional[str] = rest_field(name="trackingUrl", visibility=["read"]) + """TrackingUrl of the package.""" + + +class GroupedChildConfigurations(_Model): + """Grouped child configuration object. + + :ivar category_information: Category information. + :vartype category_information: ~azure.mgmt.edgeorder.models.CategoryInformation + :ivar child_configurations: List of child configurations. + :vartype child_configurations: list[~azure.mgmt.edgeorder.models.ChildConfiguration] + """ + + category_information: Optional["_models.CategoryInformation"] = rest_field( + name="categoryInformation", visibility=["read"] + ) + """Category information.""" + child_configurations: Optional[list["_models.ChildConfiguration"]] = rest_field( + name="childConfigurations", visibility=["read"] + ) + """List of child configurations.""" + + +class HierarchyInformation(_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 + :ivar configuration_id_display_name: Represents Model Display Name. + :vartype configuration_id_display_name: str + """ + + product_family_name: Optional[str] = rest_field( + name="productFamilyName", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents product family name that uniquely identifies product family.""" + product_line_name: Optional[str] = rest_field( + name="productLineName", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents product line name that uniquely identifies product line.""" + product_name: Optional[str] = rest_field( + name="productName", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents product name that uniquely identifies product.""" + configuration_name: Optional[str] = rest_field( + name="configurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents configuration name that uniquely identifies configuration.""" + configuration_id_display_name: Optional[str] = rest_field( + name="configurationIdDisplayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents Model Display Name.""" + + @overload + 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, + configuration_id_display_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ImageInformation(_Model): + """Image for the product. + + :ivar image_type: Type of the image. Known values are: "MainImage", "BulletImage", and + "GenericImage". + :vartype image_type: str or ~azure.mgmt.edgeorder.models.ImageType + :ivar image_url: Url of the image. + :vartype image_url: str + """ + + image_type: Optional[Union[str, "_models.ImageType"]] = rest_field(name="imageType", visibility=["read"]) + """Type of the image. Known values are: \"MainImage\", \"BulletImage\", and \"GenericImage\".""" + image_url: Optional[str] = rest_field(name="imageUrl", visibility=["read"]) + """Url of the image.""" + + +class Link(_Model): + """Returns link related to the product. + + :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.models.LinkType + :ivar link_url: Url of the link. + :vartype link_url: str + """ + + link_type: Optional[Union[str, "_models.LinkType"]] = rest_field(name="linkType", visibility=["read"]) + """Type of link. Known values are: \"Generic\", \"TermsAndConditions\", \"Specification\", + \"Documentation\", \"KnowMore\", \"SignUp\", and \"Discoverable\".""" + link_url: Optional[str] = rest_field(name="linkUrl", visibility=["read"]) + """Url of the link.""" + + +class ManagementResourcePreferences(_Model): + """Management resource preference to link device. + + :ivar preferred_management_resource_id: Customer preferred Management resource ARM ID. + :vartype preferred_management_resource_id: str + """ + + preferred_management_resource_id: Optional[str] = rest_field( + name="preferredManagementResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer preferred Management resource ARM ID.""" + + @overload + def __init__( + self, + *, + preferred_management_resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MeterDetails(_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 + + :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". + :vartype billing_type: str or ~azure.mgmt.edgeorder.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.models.ChargingType + """ + + __mapping__: dict[str, _Model] = {} + billing_type: str = rest_discriminator( + name="billingType", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents billing type. Required. Known values are: \"Pav2\" and \"Purchase\".""" + multiplier: Optional[float] = rest_field(visibility=["read"]) + """Billing unit applicable for Pav2 billing.""" + charging_type: Optional[Union[str, "_models.ChargingType"]] = rest_field(name="chargingType", visibility=["read"]) + """Charging type. Known values are: \"PerOrder\" and \"PerDevice\".""" + + @overload + def __init__( + self, + *, + billing_type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NotificationPreference(_Model): + """Notification preference for a job stage. + + :ivar stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". + :vartype stage_name: str or ~azure.mgmt.edgeorder.models.NotificationStageName + :ivar send_notification: Notification is required or not. Required. + :vartype send_notification: bool + """ + + stage_name: Union[str, "_models.NotificationStageName"] = rest_field( + name="stageName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the stage. Required. Known values are: \"Shipped\" and \"Delivered\".""" + send_notification: bool = rest_field( + name="sendNotification", visibility=["read", "create", "update", "delete", "query"] + ) + """Notification is required or not. Required.""" + + @overload + def __init__( + self, + *, + stage_name: Union[str, "_models.NotificationStageName"], + send_notification: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): + """REST API Operation. + + :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 Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.edgeorder.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.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.edgeorder.models.ActionType + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """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\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDisplay(_Model): + """Localized display information for an operation. + + :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 + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class OrderItemDetails(_Model): + """Order item details. + + :ivar product_details: Represents product details. Required. + :vartype product_details: ~azure.mgmt.edgeorder.models.ProductDetails + :ivar order_item_type: Order item type. Required. Known values are: "Purchase", "Rental", and + "External". + :vartype order_item_type: str or ~azure.mgmt.edgeorder.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.models.OrderMode + :ivar site_details: Site Related Details. + :vartype site_details: ~azure.mgmt.edgeorder.models.SiteDetails + :ivar current_stage: Current Order item Status. + :vartype current_stage: ~azure.mgmt.edgeorder.models.StageDetails + :ivar order_item_stage_history: Order item status history. + :vartype order_item_stage_history: list[~azure.mgmt.edgeorder.models.StageDetails] + :ivar preferences: Customer notification Preferences. + :vartype preferences: ~azure.mgmt.edgeorder.models.Preferences + :ivar forward_shipping_details: Forward Package Shipping details. + :vartype forward_shipping_details: ~azure.mgmt.edgeorder.models.ForwardShippingDetails + :ivar reverse_shipping_details: Reverse Package Shipping details. + :vartype reverse_shipping_details: ~azure.mgmt.edgeorder.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.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.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.models.OrderItemReturnEnum + :ivar management_rp_details_list: List of parent RP details supported for configuration. + :vartype management_rp_details_list: list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] + :ivar error: Top level error for the job. + :vartype error: ~azure.mgmt.edgeorder.models.ErrorDetail + """ + + product_details: "_models.ProductDetails" = rest_field( + name="productDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents product details. Required.""" + order_item_type: Union[str, "_models.OrderItemType"] = rest_field( + name="orderItemType", visibility=["read", "create", "update", "delete", "query"] + ) + """Order item type. Required. Known values are: \"Purchase\", \"Rental\", and \"External\".""" + order_item_mode: Optional[Union[str, "_models.OrderMode"]] = rest_field( + name="orderItemMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the mode of the Order item. Known values are: \"Default\" and \"DoNotFulfill\".""" + site_details: Optional["_models.SiteDetails"] = rest_field( + name="siteDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Site Related Details.""" + current_stage: Optional["_models.StageDetails"] = rest_field(name="currentStage", visibility=["read"]) + """Current Order item Status.""" + order_item_stage_history: Optional[list["_models.StageDetails"]] = rest_field( + name="orderItemStageHistory", visibility=["read"] + ) + """Order item status history.""" + preferences: Optional["_models.Preferences"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Customer notification Preferences.""" + forward_shipping_details: Optional["_models.ForwardShippingDetails"] = rest_field( + name="forwardShippingDetails", visibility=["read"] + ) + """Forward Package Shipping details.""" + reverse_shipping_details: Optional["_models.ReverseShippingDetails"] = rest_field( + name="reverseShippingDetails", visibility=["read"] + ) + """Reverse Package Shipping details.""" + notification_email_list: Optional[list[str]] = rest_field( + name="notificationEmailList", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional notification email list.""" + cancellation_reason: Optional[str] = rest_field(name="cancellationReason", visibility=["read"]) + """Cancellation reason.""" + cancellation_status: Optional[Union[str, "_models.OrderItemCancellationEnum"]] = rest_field( + name="cancellationStatus", visibility=["read"] + ) + """Describes whether the order item is cancellable or not. Known values are: \"Cancellable\", + \"CancellableWithFee\", and \"NotCancellable\".""" + deletion_status: Optional[Union[str, "_models.ActionStatusEnum"]] = rest_field( + name="deletionStatus", visibility=["read"] + ) + """Describes whether the order item is deletable or not. Known values are: \"Allowed\" and + \"NotAllowed\".""" + return_reason: Optional[str] = rest_field(name="returnReason", visibility=["read"]) + """Return reason.""" + return_status: Optional[Union[str, "_models.OrderItemReturnEnum"]] = rest_field( + name="returnStatus", visibility=["read"] + ) + """Describes whether the order item is returnable or not. Known values are: \"Returnable\", + \"ReturnableWithFee\", and \"NotReturnable\".""" + management_rp_details_list: Optional[list["_models.ResourceProviderDetails"]] = rest_field( + name="managementRpDetailsList", visibility=["read"] + ) + """List of parent RP details supported for configuration.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read"]) + """Top level error for the job.""" + + @overload + def __init__( + self, + *, + product_details: "_models.ProductDetails", + order_item_type: Union[str, "_models.OrderItemType"], + order_item_mode: Optional[Union[str, "_models.OrderMode"]] = None, + site_details: Optional["_models.SiteDetails"] = None, + preferences: Optional["_models.Preferences"] = None, + notification_email_list: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OrderItemDetailsUpdateParameter(_Model): + """Order item details Patchable Properties. + + :ivar product_details: Represents product details. + :vartype product_details: ~azure.mgmt.edgeorder.models.ProductDetailsUpdateParameter + :ivar site_details: Site Related Details. + :vartype site_details: ~azure.mgmt.edgeorder.models.SiteDetails + """ + + product_details: Optional["_models.ProductDetailsUpdateParameter"] = rest_field( + name="productDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents product details.""" + site_details: Optional["_models.SiteDetails"] = rest_field( + name="siteDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Site Related Details.""" + + @overload + def __init__( + self, + *, + product_details: Optional["_models.ProductDetailsUpdateParameter"] = None, + site_details: Optional["_models.SiteDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OrderItemProperties(_Model): + """Represents order item properties. + + :ivar order_item_details: Represents order item details. Required. + :vartype order_item_details: ~azure.mgmt.edgeorder.models.OrderItemDetails + :ivar address_details: Represents shipping and return address for order item. + :vartype address_details: ~azure.mgmt.edgeorder.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 + :ivar provisioning_state: Provisioning state. Known values are: "Creating", "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.edgeorder.models.ProvisioningState + """ + + order_item_details: "_models.OrderItemDetails" = rest_field( + name="orderItemDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents order item details. Required.""" + address_details: Optional["_models.AddressDetails"] = rest_field( + name="addressDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents shipping and return address for order item.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """Start time of order item.""" + order_id: str = rest_field(name="orderId", visibility=["read", "create", "update", "delete", "query"]) + """Id of the order to which order item belongs to. Required.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state. Known values are: \"Creating\", \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + @overload + def __init__( + self, + *, + order_item_details: "_models.OrderItemDetails", + order_id: str, + address_details: Optional["_models.AddressDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OrderItemResource(TrackedResource): + """Represents order item resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.edgeorder.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Order item properties. Required. + :vartype properties: ~azure.mgmt.edgeorder.models.OrderItemProperties + :ivar identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.edgeorder.models.ResourceIdentity + """ + + properties: "_models.OrderItemProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Order item properties. Required.""" + identity: Optional["_models.ResourceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Msi identity of the resource.""" + + __flattened_items = ["order_item_details", "address_details", "start_time", "order_id", "provisioning_state"] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.OrderItemProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ResourceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class OrderItemUpdateParameter(_Model): + """Updates order item parameters. + + :ivar properties: Order item update properties. + :vartype properties: ~azure.mgmt.edgeorder.models.OrderItemUpdateProperties + :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 identity: Msi identity of the resource. + :vartype identity: ~azure.mgmt.edgeorder.models.ResourceIdentity + """ + + properties: Optional["_models.OrderItemUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Order item update properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The list of key value pairs that describe the resource. These tags can be used in viewing and + grouping this resource (across resource groups).""" + identity: Optional["_models.ResourceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Msi identity of the resource.""" + + __flattened_items = ["forward_address", "preferences", "notification_email_list", "order_item_details"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.OrderItemUpdateProperties"] = None, + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ResourceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class OrderItemUpdateProperties(_Model): + """Order item update properties. + + :ivar forward_address: Updates forward shipping address and contact details. + :vartype forward_address: ~azure.mgmt.edgeorder.models.AddressProperties + :ivar preferences: Customer preference. + :vartype preferences: ~azure.mgmt.edgeorder.models.Preferences + :ivar notification_email_list: Additional notification email list. + :vartype notification_email_list: list[str] + :ivar order_item_details: Represents order item details. + :vartype order_item_details: ~azure.mgmt.edgeorder.models.OrderItemDetailsUpdateParameter + """ + + forward_address: Optional["_models.AddressProperties"] = rest_field( + name="forwardAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Updates forward shipping address and contact details.""" + preferences: Optional["_models.Preferences"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Customer preference.""" + notification_email_list: Optional[list[str]] = rest_field( + name="notificationEmailList", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional notification email list.""" + order_item_details: Optional["_models.OrderItemDetailsUpdateParameter"] = rest_field( + name="orderItemDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents order item details.""" + + @overload + def __init__( + self, + *, + forward_address: Optional["_models.AddressProperties"] = None, + preferences: Optional["_models.Preferences"] = None, + notification_email_list: Optional[list[str]] = None, + order_item_details: Optional["_models.OrderItemDetailsUpdateParameter"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OrderProperties(_Model): + """Represents order details. + + :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.models.StageDetails + :ivar order_stage_history: Order status history. + :vartype order_stage_history: list[~azure.mgmt.edgeorder.models.StageDetails] + :ivar order_mode: Order mode. Known values are: "Default" and "DoNotFulfill". + :vartype order_mode: str or ~azure.mgmt.edgeorder.models.OrderMode + """ + + order_item_ids: Optional[list[str]] = rest_field(name="orderItemIds", visibility=["read"]) + """List of order item ARM Ids which are part of an order.""" + current_stage: Optional["_models.StageDetails"] = rest_field(name="currentStage", visibility=["read"]) + """Order current status.""" + order_stage_history: Optional[list["_models.StageDetails"]] = rest_field( + name="orderStageHistory", visibility=["read"] + ) + """Order status history.""" + order_mode: Optional[Union[str, "_models.OrderMode"]] = rest_field(name="orderMode", visibility=["read"]) + """Order mode. Known values are: \"Default\" and \"DoNotFulfill\".""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.edgeorder.models.SystemData + """ + + +class OrderResource(ProxyResource): + """Specifies the properties or parameters for an order. Order is a grouping of one or more order + items. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.edgeorder.models.SystemData + :ivar properties: Order properties. Required. + :vartype properties: ~azure.mgmt.edgeorder.models.OrderProperties + """ + + properties: "_models.OrderProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Order properties. Required.""" + + __flattened_items = ["order_item_ids", "current_stage", "order_stage_history", "order_mode"] + + @overload + def __init__( + self, + *, + properties: "_models.OrderProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class Pav2MeterDetails(MeterDetails, discriminator="Pav2"): + """Billing type PAV2 meter details. + + :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.models.ChargingType + :ivar meter_guid: Validation status of requested data center and transport. + :vartype meter_guid: str + :ivar billing_type: Represents billing type. Required. PaV2 billing. + :vartype billing_type: str or ~azure.mgmt.edgeorder.models.PAV2 + """ + + meter_guid: Optional[str] = rest_field(name="meterGuid", visibility=["read"]) + """Validation status of requested data center and transport.""" + billing_type: Literal[BillingType.PAV2] = rest_discriminator(name="billingType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Represents billing type. Required. PaV2 billing.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.billing_type = BillingType.PAV2 # type: ignore + + +class Preferences(_Model): + """Preferences related to the order. + + :ivar notification_preferences: Notification preferences. + :vartype notification_preferences: list[~azure.mgmt.edgeorder.models.NotificationPreference] + :ivar transport_preferences: Preferences related to the shipment logistics of the order. + :vartype transport_preferences: ~azure.mgmt.edgeorder.models.TransportPreferences + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: ~azure.mgmt.edgeorder.models.EncryptionPreferences + :ivar management_resource_preferences: Preferences related to the Management resource. + :vartype management_resource_preferences: + ~azure.mgmt.edgeorder.models.ManagementResourcePreferences + :ivar term_commitment_preferences: Preferences related to the Term commitment. + :vartype term_commitment_preferences: ~azure.mgmt.edgeorder.models.TermCommitmentPreferences + """ + + notification_preferences: Optional[list["_models.NotificationPreference"]] = rest_field( + name="notificationPreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Notification preferences.""" + transport_preferences: Optional["_models.TransportPreferences"] = rest_field( + name="transportPreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences related to the shipment logistics of the order.""" + encryption_preferences: Optional["_models.EncryptionPreferences"] = rest_field( + name="encryptionPreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences related to the Encryption.""" + management_resource_preferences: Optional["_models.ManagementResourcePreferences"] = rest_field( + name="managementResourcePreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences related to the Management resource.""" + term_commitment_preferences: Optional["_models.TermCommitmentPreferences"] = rest_field( + name="termCommitmentPreferences", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferences related to the Term commitment.""" + + @overload + 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, + term_commitment_preferences: Optional["_models.TermCommitmentPreferences"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Product(_Model): + """Represents a product. + + :ivar properties: Properties of product. + :vartype properties: ~azure.mgmt.edgeorder.models.ProductProperties + """ + + properties: Optional["_models.ProductProperties"] = rest_field(visibility=["read"]) + """Properties of product.""" + + __flattened_items = [ + "display_name", + "description", + "image_information", + "cost_information", + "availability_information", + "hierarchy_information", + "fulfilled_by", + "filterable_properties", + "configurations", + ] + + +class ProductDetails(_Model): + """Represents product details. + + :ivar display_info: Display details of the product. + :vartype display_info: ~azure.mgmt.edgeorder.models.DisplayInfo + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the product. + Required. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.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.models.DoubleEncryptionStatus + :ivar identification_type: Identification type of the configuration. Known values are: + "NotSupported" and "SerialNumber". + :vartype identification_type: str or ~azure.mgmt.edgeorder.models.IdentificationType + :ivar parent_device_details: Device details of the parent configuration. + :vartype parent_device_details: ~azure.mgmt.edgeorder.models.DeviceDetails + :ivar parent_provisioning_details: Device Provisioning Details for Parent. + :vartype parent_provisioning_details: ~azure.mgmt.edgeorder.models.ProvisioningDetails + :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.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.models.ConfigurationDeviceDetails] + :ivar term_commitment_information: Term Commitment Information of the Device. + :vartype term_commitment_information: ~azure.mgmt.edgeorder.models.TermCommitmentInformation + """ + + display_info: Optional["_models.DisplayInfo"] = rest_field( + name="displayInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """Display details of the product.""" + hierarchy_information: "_models.HierarchyInformation" = rest_field( + name="hierarchyInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Hierarchy of the product which uniquely identifies the product. Required.""" + product_double_encryption_status: Optional[Union[str, "_models.DoubleEncryptionStatus"]] = rest_field( + name="productDoubleEncryptionStatus", visibility=["read"] + ) + """Double encryption status of the configuration. Read-only field. Known values are: \"Disabled\" + and \"Enabled\".""" + identification_type: Optional[Union[str, "_models.IdentificationType"]] = rest_field( + name="identificationType", visibility=["read"] + ) + """Identification type of the configuration. Known values are: \"NotSupported\" and + \"SerialNumber\".""" + parent_device_details: Optional["_models.DeviceDetails"] = rest_field( + name="parentDeviceDetails", visibility=["read"] + ) + """Device details of the parent configuration.""" + parent_provisioning_details: Optional["_models.ProvisioningDetails"] = rest_field( + name="parentProvisioningDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Device Provisioning Details for Parent.""" + opt_in_additional_configurations: Optional[list["_models.AdditionalConfiguration"]] = rest_field( + name="optInAdditionalConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of additional configurations customer wants in the order item apart from the ones included + in the base configuration.""" + child_configuration_device_details: Optional[list["_models.ConfigurationDeviceDetails"]] = rest_field( + name="childConfigurationDeviceDetails", visibility=["read"] + ) + """Details of all child configurations that are part of the order item.""" + term_commitment_information: Optional["_models.TermCommitmentInformation"] = rest_field( + name="termCommitmentInformation", visibility=["read"] + ) + """Term Commitment Information of the Device.""" + + @overload + def __init__( + self, + *, + hierarchy_information: "_models.HierarchyInformation", + display_info: Optional["_models.DisplayInfo"] = None, + parent_provisioning_details: Optional["_models.ProvisioningDetails"] = None, + opt_in_additional_configurations: Optional[list["_models.AdditionalConfiguration"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProductDetailsUpdateParameter(_Model): + """Represents product details patchable properties. + + :ivar parent_provisioning_details: Device Provisioning Details for Parent. + :vartype parent_provisioning_details: ~azure.mgmt.edgeorder.models.ProvisioningDetails + """ + + parent_provisioning_details: Optional["_models.ProvisioningDetails"] = rest_field( + name="parentProvisioningDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Device Provisioning Details for Parent.""" + + @overload + def __init__( + self, + *, + parent_provisioning_details: Optional["_models.ProvisioningDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProductFamiliesMetadataDetails(_Model): + """Product families metadata details. + + :ivar properties: Product family properties. + :vartype properties: ~azure.mgmt.edgeorder.models.ProductFamilyProperties + """ + + properties: Optional["_models.ProductFamilyProperties"] = rest_field(visibility=["read"]) + """Product family properties.""" + + __flattened_items = [ + "display_name", + "description", + "image_information", + "cost_information", + "availability_information", + "hierarchy_information", + "fulfilled_by", + "filterable_properties", + "product_lines", + "resource_provider_details", + ] + + +class ProductFamiliesRequest(_Model): + """The filters for showing the product families. + + :ivar filterable_properties: Dictionary of filterable properties on product family. Required. + :vartype filterable_properties: dict[str, + list[~azure.mgmt.edgeorder.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.models.CustomerSubscriptionDetails + """ + + filterable_properties: dict[str, list["_models.FilterableProperty"]] = rest_field( + name="filterableProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Dictionary of filterable properties on product family. Required.""" + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = rest_field( + name="customerSubscriptionDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer subscription properties. Clients can display available products to unregistered + customers by explicitly passing subscription details.""" + + @overload + def __init__( + self, + *, + filterable_properties: dict[str, list["_models.FilterableProperty"]], + customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProductFamily(_Model): + """Product Family. + + :ivar properties: Properties of product family. + :vartype properties: ~azure.mgmt.edgeorder.models.ProductFamilyProperties + """ + + properties: Optional["_models.ProductFamilyProperties"] = rest_field(visibility=["read"]) + """Properties of product family.""" + + __flattened_items = [ + "display_name", + "description", + "image_information", + "cost_information", + "availability_information", + "hierarchy_information", + "fulfilled_by", + "filterable_properties", + "product_lines", + "resource_provider_details", + ] + + +class ProductFamilyProperties(CommonProperties): + """Properties of product family. + + :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.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.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.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] + :ivar product_lines: List of product lines supported in the product family. + :vartype product_lines: list[~azure.mgmt.edgeorder.models.ProductLine] + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] + """ + + product_lines: Optional[list["_models.ProductLine"]] = rest_field(name="productLines", visibility=["read"]) + """List of product lines supported in the product family.""" + resource_provider_details: Optional[list["_models.ResourceProviderDetails"]] = rest_field( + name="resourceProviderDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Contains details related to resource provider.""" + + @overload + def __init__( + self, + *, + resource_provider_details: Optional[list["_models.ResourceProviderDetails"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProductLine(_Model): + """Product line. + + :ivar properties: Properties of product line. + :vartype properties: ~azure.mgmt.edgeorder.models.ProductLineProperties + """ + + properties: Optional["_models.ProductLineProperties"] = rest_field(visibility=["read"]) + """Properties of product line.""" + + __flattened_items = [ + "display_name", + "description", + "image_information", + "cost_information", + "availability_information", + "hierarchy_information", + "fulfilled_by", + "filterable_properties", + "products", + ] + + +class ProductLineProperties(CommonProperties): + """Properties of product line. + + :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.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.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.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] + :ivar products: List of products in the product line. + :vartype products: list[~azure.mgmt.edgeorder.models.Product] + """ + + products: Optional[list["_models.Product"]] = rest_field(visibility=["read"]) + """List of products in the product line.""" + + +class ProductProperties(CommonProperties): + """Properties of product. + + :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.models.Description + :ivar image_information: Image information for the product system. + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation + :ivar availability_information: Availability information of the product system. + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: ~azure.mgmt.edgeorder.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.models.FulfillmentType + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] + :ivar configurations: List of configurations for the product. + :vartype configurations: list[~azure.mgmt.edgeorder.models.Configuration] + """ + + configurations: Optional[list["_models.Configuration"]] = rest_field(visibility=["read"]) + """List of configurations for the product.""" + + +class ProvisioningDetails(_Model): + """Details Related To Provision Resource. + + :ivar quantity: Quantity of the devices. + :vartype quantity: int + :ivar provisioning_arm_id: Provisioning Resource Arm ID. + :vartype provisioning_arm_id: str + :ivar provisioning_end_point: Provisioning End Point. + :vartype provisioning_end_point: str + :ivar serial_number: Serial Number for the Device. + :vartype serial_number: str + :ivar vendor_name: Vendor Name for the Device , (for 1P devices - Microsoft). + :vartype vendor_name: str + :ivar ready_to_connect_arm_id: Arc Enabled Resource Arm id. + :vartype ready_to_connect_arm_id: str + :ivar management_resource_arm_id: Management Resource ArmId. + :vartype management_resource_arm_id: str + :ivar unique_device_identifier: Unique Identity for a Device. + :vartype unique_device_identifier: str + :ivar auto_provisioning_status: Auto Provisioning Details. Known values are: "Enabled" and + "Disabled". + :vartype auto_provisioning_status: str or ~azure.mgmt.edgeorder.models.AutoProvisioningStatus + :ivar device_presence_verification: Proof of possession details. + :vartype device_presence_verification: + ~azure.mgmt.edgeorder.models.DevicePresenceVerificationDetails + """ + + quantity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Quantity of the devices.""" + provisioning_arm_id: Optional[str] = rest_field( + name="provisioningArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """Provisioning Resource Arm ID.""" + provisioning_end_point: Optional[str] = rest_field( + name="provisioningEndPoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Provisioning End Point.""" + serial_number: Optional[str] = rest_field( + name="serialNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Serial Number for the Device.""" + vendor_name: Optional[str] = rest_field( + name="vendorName", visibility=["read", "create", "update", "delete", "query"] + ) + """Vendor Name for the Device , (for 1P devices - Microsoft).""" + ready_to_connect_arm_id: Optional[str] = rest_field( + name="readyToConnectArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """Arc Enabled Resource Arm id.""" + management_resource_arm_id: Optional[str] = rest_field( + name="managementResourceArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """Management Resource ArmId.""" + unique_device_identifier: Optional[str] = rest_field(name="uniqueDeviceIdentifier", visibility=["read"]) + """Unique Identity for a Device.""" + auto_provisioning_status: Optional[Union[str, "_models.AutoProvisioningStatus"]] = rest_field( + name="autoProvisioningStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """Auto Provisioning Details. Known values are: \"Enabled\" and \"Disabled\".""" + device_presence_verification: Optional["_models.DevicePresenceVerificationDetails"] = rest_field( + name="devicePresenceVerification", visibility=["read", "create", "update", "delete", "query"] + ) + """Proof of possession details.""" + + @overload + def __init__( + self, + *, + quantity: Optional[int] = None, + provisioning_arm_id: Optional[str] = None, + provisioning_end_point: Optional[str] = None, + serial_number: Optional[str] = None, + vendor_name: Optional[str] = None, + ready_to_connect_arm_id: Optional[str] = None, + management_resource_arm_id: Optional[str] = None, + auto_provisioning_status: Optional[Union[str, "_models.AutoProvisioningStatus"]] = None, + device_presence_verification: Optional["_models.DevicePresenceVerificationDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PurchaseMeterDetails(MeterDetails, discriminator="Purchase"): + """Billing type Purchase meter details. + + :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.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 + :ivar billing_type: Represents billing type. Required. Purchase billing. + :vartype billing_type: str or ~azure.mgmt.edgeorder.models.PURCHASE + """ + + product_id: Optional[str] = rest_field(name="productId", visibility=["read"]) + """Product Id.""" + sku_id: Optional[str] = rest_field(name="skuId", visibility=["read"]) + """Sku Id.""" + term_id: Optional[str] = rest_field(name="termId", visibility=["read"]) + """Term Id.""" + billing_type: Literal[BillingType.PURCHASE] = rest_discriminator(name="billingType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Represents billing type. Required. Purchase billing.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.billing_type = BillingType.PURCHASE # type: ignore + + +class ResourceIdentity(_Model): + """Msi identity details of the resource. + + :ivar type: Identity type. + :vartype type: str + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :ivar user_assigned_identities: User Assigned Identities. + :vartype user_assigned_identities: dict[str, ~azure.mgmt.edgeorder.models.UserAssignedIdentity] + """ + + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identity type.""" + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """Service Principal Id backing the Msi.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """Home Tenant Id.""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """User Assigned Identities.""" + + @overload + def __init__( + self, + *, + type: Optional[str] = None, + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceProviderDetails(_Model): + """Management RP details. + + :ivar resource_provider_namespace: Resource provider namespace. + :vartype resource_provider_namespace: str + """ + + resource_provider_namespace: Optional[str] = rest_field(name="resourceProviderNamespace", visibility=["read"]) + """Resource provider namespace.""" + + +class ReturnOrderItemDetails(_Model): + """Return order item request body. + + :ivar return_address: Customer return address. + :vartype return_address: ~azure.mgmt.edgeorder.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 + """ + + return_address: Optional["_models.AddressProperties"] = rest_field( + name="returnAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer return address.""" + return_reason: str = rest_field(name="returnReason", visibility=["read", "create", "update", "delete", "query"]) + """Return Reason. Required.""" + service_tag: Optional[str] = rest_field( + name="serviceTag", visibility=["read", "create", "update", "delete", "query"] + ) + """Service tag (located on the bottom-right corner of the device).""" + shipping_box_required: Optional[bool] = rest_field( + name="shippingBoxRequired", visibility=["read", "create", "update", "delete", "query"] + ) + """Shipping Box required.""" + + @overload + def __init__( + self, + *, + return_reason: str, + return_address: Optional["_models.AddressProperties"] = None, + service_tag: Optional[str] = None, + shipping_box_required: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ReverseShippingDetails(_Model): + """Reverse shipment details. + + :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 + """ + + sas_key_for_label: Optional[str] = rest_field(name="sasKeyForLabel", visibility=["read"]) + """SAS key to download the reverse shipment label of the package.""" + carrier_name: Optional[str] = rest_field(name="carrierName", visibility=["read"]) + """Name of the carrier.""" + carrier_display_name: Optional[str] = rest_field(name="carrierDisplayName", visibility=["read"]) + """Carrier Name for display purpose. Not to be used for any processing.""" + tracking_id: Optional[str] = rest_field(name="trackingId", visibility=["read"]) + """TrackingId of the package.""" + tracking_url: Optional[str] = rest_field(name="trackingUrl", visibility=["read"]) + """TrackingUrl of the package.""" + + +class ShippingAddress(_Model): + """Shipping address where customer wishes to receive the device. + + :ivar street_address1: Street Address line 1. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: 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.models.AddressType + """ + + street_address1: Optional[str] = rest_field( + name="streetAddress1", visibility=["read", "create", "update", "delete", "query"] + ) + """Street Address line 1.""" + street_address2: Optional[str] = rest_field( + name="streetAddress2", visibility=["read", "create", "update", "delete", "query"] + ) + """Street Address line 2.""" + street_address3: Optional[str] = rest_field( + name="streetAddress3", visibility=["read", "create", "update", "delete", "query"] + ) + """Street Address line 3.""" + city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the City.""" + state_or_province: Optional[str] = rest_field( + name="stateOrProvince", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the State or Province.""" + country: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Country. Required.""" + postal_code: Optional[str] = rest_field( + name="postalCode", visibility=["read", "create", "update", "delete", "query"] + ) + """Postal code.""" + zip_extended_code: Optional[str] = rest_field( + name="zipExtendedCode", visibility=["read", "create", "update", "delete", "query"] + ) + """Extended Zip Code.""" + company_name: Optional[str] = rest_field( + name="companyName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the company.""" + address_type: Optional[Union[str, "_models.AddressType"]] = rest_field( + name="addressType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of address. Known values are: \"None\", \"Residential\", and \"Commercial\".""" + + @overload + def __init__( + self, + *, + country: str, + street_address1: Optional[str] = None, + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SiteDetails(_Model): + """Represents Site Related Details. + + :ivar site_id: Unique Id, Identifying A Site. Required. + :vartype site_id: str + """ + + site_id: str = rest_field(name="siteId", visibility=["read", "create", "update", "delete", "query"]) + """Unique Id, Identifying A Site. Required.""" + + @overload + def __init__( + self, + *, + site_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Specification(_Model): + """Specification of the configurations. + + :ivar name: Name of the specification. + :vartype name: str + :ivar value: Value of the specification. + :vartype value: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the specification.""" + value: Optional[str] = rest_field(visibility=["read"]) + """Value of the specification.""" + + +class StageDetails(_Model): + """Resource stage details. + + :ivar stage_status: Stage status. Known values are: "None", "InProgress", "Succeeded", + "Failed", "Cancelled", and "Cancelling". + :vartype stage_status: str or ~azure.mgmt.edgeorder.models.StageStatus + :ivar stage_name: Stage name. Known values are: "Placed", "InReview", "Confirmed", + "ReadyToShip", "Shipped", "Delivered", "ReadyToSetup", "InUse", "ReturnInitiated", + "ReturnPickedUp", "ReturnedToMicrosoft", "ReturnCompleted", and "Cancelled". + :vartype stage_name: str or ~azure.mgmt.edgeorder.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 + """ + + stage_status: Optional[Union[str, "_models.StageStatus"]] = rest_field(name="stageStatus", visibility=["read"]) + """Stage status. Known values are: \"None\", \"InProgress\", \"Succeeded\", \"Failed\", + \"Cancelled\", and \"Cancelling\".""" + stage_name: Optional[Union[str, "_models.StageName"]] = rest_field(name="stageName", visibility=["read"]) + """Stage name. Known values are: \"Placed\", \"InReview\", \"Confirmed\", \"ReadyToShip\", + \"Shipped\", \"Delivered\", \"ReadyToSetup\", \"InUse\", \"ReturnInitiated\", + \"ReturnPickedUp\", \"ReturnedToMicrosoft\", \"ReturnCompleted\", and \"Cancelled\".""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """Display name of the resource stage.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """Stage start time.""" + + +class SystemData(_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.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.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TermCommitmentInformation(_Model): + """Term Commitment Information. + + :ivar term_commitment_type: Term Commitment Type. Required. Known values are: "None", "Trial", + and "Timed". + :vartype term_commitment_type: str or ~azure.mgmt.edgeorder.models.TermCommitmentType + :ivar term_commitment_type_duration: Term Commitment Duration. Currently Supporting P365D, + P1095D. + :vartype term_commitment_type_duration: ~datetime.timedelta + :ivar pending_days_for_term: Number of Days Pending for Term Commitment. + :vartype pending_days_for_term: int + """ + + term_commitment_type: Union[str, "_models.TermCommitmentType"] = rest_field( + name="termCommitmentType", visibility=["read", "create", "update", "delete", "query"] + ) + """Term Commitment Type. Required. Known values are: \"None\", \"Trial\", and \"Timed\".""" + term_commitment_type_duration: Optional[datetime.timedelta] = rest_field( + name="termCommitmentTypeDuration", visibility=["read"] + ) + """Term Commitment Duration. Currently Supporting P365D, P1095D.""" + pending_days_for_term: Optional[int] = rest_field(name="pendingDaysForTerm", visibility=["read"]) + """Number of Days Pending for Term Commitment.""" + + @overload + def __init__( + self, + *, + term_commitment_type: Union[str, "_models.TermCommitmentType"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TermCommitmentPreferences(_Model): + """Term Commitment preference received from customer. + + :ivar preferred_term_commitment_type: Term Commitment Type. Required. Known values are: "None", + "Trial", and "Timed". + :vartype preferred_term_commitment_type: str or ~azure.mgmt.edgeorder.models.TermCommitmentType + :ivar preferred_term_commitment_duration: Customer preferred Term Duration. + :vartype preferred_term_commitment_duration: ~datetime.timedelta + """ + + preferred_term_commitment_type: Union[str, "_models.TermCommitmentType"] = rest_field( + name="preferredTermCommitmentType", visibility=["read", "create", "update", "delete", "query"] + ) + """Term Commitment Type. Required. Known values are: \"None\", \"Trial\", and \"Timed\".""" + preferred_term_commitment_duration: Optional[datetime.timedelta] = rest_field( + name="preferredTermCommitmentDuration", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer preferred Term Duration.""" + + @overload + def __init__( + self, + *, + preferred_term_commitment_type: Union[str, "_models.TermCommitmentType"], + preferred_term_commitment_duration: Optional[datetime.timedelta] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TermTypeDetails(_Model): + """Holds details about term type and duration. + + :ivar term_type: Term Commitment Type. Required. Known values are: "None", "Trial", and + "Timed". + :vartype term_type: str or ~azure.mgmt.edgeorder.models.TermCommitmentType + :ivar term_type_duration: Duration for the term type. Required. + :vartype term_type_duration: ~datetime.timedelta + """ + + term_type: Union[str, "_models.TermCommitmentType"] = rest_field( + name="termType", visibility=["read", "create", "update", "delete", "query"] + ) + """Term Commitment Type. Required. Known values are: \"None\", \"Trial\", and \"Timed\".""" + term_type_duration: datetime.timedelta = rest_field( + name="termTypeDuration", visibility=["read", "create", "update", "delete", "query"] + ) + """Duration for the term type. Required.""" + + @overload + def __init__( + self, + *, + term_type: Union[str, "_models.TermCommitmentType"], + term_type_duration: datetime.timedelta, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransportPreferences(_Model): + """Preferences related to the shipment logistics of the sku. + + :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.models.TransportShipmentTypes + """ + + preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"] = rest_field( + name="preferredShipmentType", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates Shipment Logistics type that the customer preferred. Required. Known values are: + \"CustomerManaged\" and \"MicrosoftManaged\".""" + + @overload + def __init__( + self, + *, + preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models_py3.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models_py3.py deleted file mode 100644 index 16c22ff72120..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models_py3.py +++ /dev/null @@ -1,3147 +0,0 @@ -# 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 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 server. - - :ivar forward_address: Customer address and contact details. It should be address resource. - Required. - :vartype forward_address: ~azure.mgmt.edgeorder.models.AddressProperties - :ivar return_address: Return shipping address. - :vartype return_address: ~azure.mgmt.edgeorder.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. It should be address resource. - Required. - :paramtype forward_address: ~azure.mgmt.edgeorder.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 server. - - :ivar shipping_address: Shipping details for the address. - :vartype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress - :ivar contact_details: Contact details for the address. Required. - :vartype contact_details: ~azure.mgmt.edgeorder.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.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.models.ShippingAddress - :keyword contact_details: Contact details for the address. Required. - :paramtype contact_details: ~azure.mgmt.edgeorder.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}. # pylint: disable=line-too-long - :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 server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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 server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.models.SystemData - :ivar shipping_address: Shipping details for the address. - :vartype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress - :ivar contact_details: Contact details for the address. Required. - :vartype contact_details: ~azure.mgmt.edgeorder.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.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.models.ShippingAddress - :keyword contact_details: Contact details for the address. Required. - :paramtype contact_details: ~azure.mgmt.edgeorder.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.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.models.ShippingAddress - :ivar contact_details: Contact details for the address. - :vartype contact_details: ~azure.mgmt.edgeorder.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.models.ShippingAddress - :keyword contact_details: Contact details for the address. - :paramtype contact_details: ~azure.mgmt.edgeorder.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. Availability stage. Known - values are: "Available", "ComingSoon", "Preview", "Deprecated", "Signup", and "Unavailable". - :vartype availability_stage: str or ~azure.mgmt.edgeorder.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.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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.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: 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 - - -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.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.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 server. - - :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 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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.filterable_properties = None - - -class Configuration(_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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.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: 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.filterable_properties = None - self.specifications = None - self.dimensions = None - - -class ConfigurationFilters(_serialization.Model): - """Configuration filters. - - All required parameters must be populated in order to send to server. - - :ivar hierarchy_information: Product hierarchy information. Required. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_property: Filters specific to product. - :vartype filterable_property: list[~azure.mgmt.edgeorder.models.FilterableProperty] - """ - - _validation = { - "hierarchy_information": {"required": True}, - } - - _attribute_map = { - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_property": {"key": "filterableProperty", "type": "[FilterableProperty]"}, - } - - def __init__( - self, - *, - 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.models.HierarchyInformation - :keyword filterable_property: Filters specific to product. - :paramtype filterable_property: list[~azure.mgmt.edgeorder.models.FilterableProperty] - """ - super().__init__(**kwargs) - self.hierarchy_information = hierarchy_information - self.filterable_property = filterable_property - - -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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.specifications = None - self.dimensions = 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.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. - - All required parameters must be populated in order to send to server. - - :ivar configuration_filters: Holds details about product hierarchy information and filterable - property. Required. - :vartype configuration_filters: list[~azure.mgmt.edgeorder.models.ConfigurationFilters] - :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.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, - *, - 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.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.models.CustomerSubscriptionDetails - """ - super().__init__(**kwargs) - self.configuration_filters = configuration_filters - self.customer_subscription_details = customer_subscription_details - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to server. - - :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.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 server. - - :ivar registered_features: List of registered feature flags for subscription. - :vartype registered_features: - list[~azure.mgmt.edgeorder.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.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.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.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", "CM", and "IN". - :vartype length_height_unit: str or ~azure.mgmt.edgeorder.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.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.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.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.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.edgeorder.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.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.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 server. - - :ivar type: Type of product filter. Required. Known values are: "ShipToCountries" and - "DoubleEncryptionStatus". - :vartype type: str or ~azure.mgmt.edgeorder.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.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 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.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", and "SignUp". - :vartype link_type: str or ~azure.mgmt.edgeorder.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 server. - - :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". - :vartype billing_type: str or ~azure.mgmt.edgeorder.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.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 server. - - :ivar stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". - :vartype stage_name: str or ~azure.mgmt.edgeorder.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.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.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.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.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.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.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 server. - - :ivar product_details: Unique identifier for configuration. Required. - :vartype product_details: ~azure.mgmt.edgeorder.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.models.OrderItemType - :ivar current_stage: Current Order item Status. - :vartype current_stage: ~azure.mgmt.edgeorder.models.StageDetails - :ivar order_item_stage_history: Order item status history. - :vartype order_item_stage_history: list[~azure.mgmt.edgeorder.models.StageDetails] - :ivar preferences: Customer notification Preferences. - :vartype preferences: ~azure.mgmt.edgeorder.models.Preferences - :ivar forward_shipping_details: Forward Package Shipping details. - :vartype forward_shipping_details: ~azure.mgmt.edgeorder.models.ForwardShippingDetails - :ivar reverse_shipping_details: Reverse Package Shipping details. - :vartype reverse_shipping_details: ~azure.mgmt.edgeorder.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.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.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.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.models.ResourceProviderDetails - :ivar management_rp_details_list: List of parent RP details supported for configuration. - :vartype management_rp_details_list: list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.edgeorder.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, - *, - product_details: "_models.ProductDetails", - order_item_type: Union[str, "_models.OrderItemType"], - 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.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.models.OrderItemType - :keyword preferences: Customer notification Preferences. - :paramtype preferences: ~azure.mgmt.edgeorder.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 - 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 = 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 server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.models.SystemData - :ivar order_item_details: Represents order item details. Required. - :vartype order_item_details: ~azure.mgmt.edgeorder.models.OrderItemDetails - :ivar address_details: Represents shipping and return address for order item. Required. - :vartype address_details: ~azure.mgmt.edgeorder.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.models.OrderItemDetails - :keyword address_details: Represents shipping and return address for order item. Required. - :paramtype address_details: ~azure.mgmt.edgeorder.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 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.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.models.AddressProperties - :ivar preferences: Customer preference. - :vartype preferences: ~azure.mgmt.edgeorder.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.models.AddressProperties - :keyword preferences: Customer preference. - :paramtype preferences: ~azure.mgmt.edgeorder.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}. # pylint: disable=line-too-long - :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 - """ - - -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}. # pylint: disable=line-too-long - :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.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.models.StageDetails - :ivar order_stage_history: Order status history. - :vartype order_stage_history: list[~azure.mgmt.edgeorder.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: 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(_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.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 server. - - :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". - :vartype billing_type: str or ~azure.mgmt.edgeorder.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.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.models.NotificationPreference] - :ivar transport_preferences: Preferences related to the shipment logistics of the order. - :vartype transport_preferences: ~azure.mgmt.edgeorder.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.edgeorder.models.EncryptionPreferences - :ivar management_resource_preferences: Preferences related to the Management resource. - :vartype management_resource_preferences: - ~azure.mgmt.edgeorder.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.models.NotificationPreference] - :keyword transport_preferences: Preferences related to the shipment logistics of the order. - :paramtype transport_preferences: ~azure.mgmt.edgeorder.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: ~azure.mgmt.edgeorder.models.EncryptionPreferences - :keyword management_resource_preferences: Preferences related to the Management resource. - :paramtype management_resource_preferences: - ~azure.mgmt.edgeorder.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): - """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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.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: 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.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 server. - - :ivar display_info: Display details of the product. - :vartype display_info: ~azure.mgmt.edgeorder.models.DisplayInfo - :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the product. - Required. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.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. Known values are: "Disabled" and "Enabled". - :vartype product_double_encryption_status: str or - ~azure.mgmt.edgeorder.models.DoubleEncryptionStatus - :ivar device_details: list of device details. - :vartype device_details: list[~azure.mgmt.edgeorder.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, - *, - 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.models.DisplayInfo - :keyword hierarchy_information: Hierarchy of the product which uniquely identifies the product. - Required. - :paramtype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - """ - super().__init__(**kwargs) - self.display_info = display_info - self.hierarchy_information = hierarchy_information - self.count = None - self.product_double_encryption_status = None - self.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.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.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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.models.ProductLine] - :ivar resource_provider_details: Contains details related to resource provider. - :vartype resource_provider_details: list[~azure.mgmt.edgeorder.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["_models.ResourceProviderDetails"]] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_provider_details: Contains details related to resource provider. - :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.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.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 server. - - :ivar filterable_properties: Dictionary of filterable properties on product family. Required. - :vartype filterable_properties: dict[str, - list[~azure.mgmt.edgeorder.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.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.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.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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.models.ProductLine] - :ivar resource_provider_details: Contains details related to resource provider. - :vartype resource_provider_details: list[~azure.mgmt.edgeorder.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["_models.ResourceProviderDetails"]] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_provider_details: Contains details related to resource provider. - :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.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.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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.models.ProductLine] - :ivar resource_provider_details: Contains details related to resource provider. - :vartype resource_provider_details: list[~azure.mgmt.edgeorder.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["_models.ResourceProviderDetails"]] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_provider_details: Contains details related to resource provider. - :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.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: 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.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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.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: Any) -> None: - """ """ - super().__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.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.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: 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 server. - - :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". - :vartype billing_type: str or ~azure.mgmt.edgeorder.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.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 ResourceIdentity(_serialization.Model): - """Msi identity details of the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: Identity type. - :vartype type: str - :ivar principal_id: Service Principal Id backing the Msi. - :vartype principal_id: str - :ivar tenant_id: Home Tenant Id. - :vartype tenant_id: str - """ - - _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, *, 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(_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 server. - - :ivar return_address: customer return address. - :vartype return_address: ~azure.mgmt.edgeorder.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.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 server. - - :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.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.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 ShippingDetails(_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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = None - - -class Specification(_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: 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.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.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.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.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.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.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 server. - - :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.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.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_patch.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/__init__.py index 9e856f64458f..acad6cc70de4 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/__init__.py @@ -2,18 +2,32 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._edge_order_management_client_operations import EdgeOrderManagementClientOperationsMixin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import AddressesOperations # type: ignore +from ._operations import OrderItemsOperations # type: ignore +from ._operations import OrdersOperations # type: ignore +from ._operations import ProductsAndConfigurationsOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "EdgeOrderManagementClientOperationsMixin", + "Operations", + "AddressesOperations", + "OrderItemsOperations", + "OrdersOperations", + "ProductsAndConfigurationsOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_operations.py similarity index 57% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_edge_order_management_client_operations.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_operations.py index d58ec28e1841..a6492f36b135 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_edge_order_management_client_operations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_operations.py @@ -1,20 +1,23 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import MatchConditions, PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -30,30 +33,29 @@ 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 +from .. import models as _models, types as _types +from .._configuration import EdgeOrderManagementClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._utils.utils import prep_if_match, prep_if_none_match -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_operations_request(**kwargs: Any) -> HttpRequest: +def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.EdgeOrder/operations") + _url = "/providers/Microsoft.EdgeOrder/operations" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -64,29 +66,27 @@ def build_list_operations_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_addresses_at_subscription_level_request( # pylint: disable=name-too-long - subscription_id: str, *, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any +def build_addresses_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses") + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "addressName": _SERIALIZER.url("address_name", address_name, "str"), } _url: str = _url.format(**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") @@ -94,125 +94,134 @@ def build_list_addresses_at_subscription_level_request( # pylint: disable=name- 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 +def build_addresses_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" - ) + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "addressName": _SERIALIZER.url("address_name", address_name, "str"), } _url: str = _url.format(**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) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_configurations_request( - subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +def build_addresses_update_request( + resource_group_name: str, + address_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" - ) + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "addressName": _SERIALIZER.url("address_name", address_name, "str"), } _url: str = _url.format(**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") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_product_families_metadata_request( # pylint: disable=name-too-long - subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +def build_addresses_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" - ) # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "addressName": _SERIALIZER.url("address_name", address_name, "str"), } _url: str = _url.format(**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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_list_order_at_subscription_level_request( # pylint: disable=name-too-long - subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +def build_addresses_list_by_resource_group_request( # pylint: disable=name-too-long + 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders") + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), } _url: str = _url.format(**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") @@ -220,24 +229,24 @@ def build_list_order_at_subscription_level_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_order_items_at_subscription_level_request( # pylint: disable=name-too-long +def build_addresses_list_by_subscription_request( # pylint: disable=name-too-long 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems") + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses" path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -246,10 +255,10 @@ def build_list_order_items_at_subscription_level_request( # pylint: disable=nam _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") @@ -257,40 +266,29 @@ def build_list_order_items_at_subscription_level_request( # pylint: disable=nam return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_addresses_at_resource_group_level_request( # pylint: disable=name-too-long - resource_group_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any +def build_order_items_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-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 + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), } _url: str = _url.format(**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 expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -298,28 +296,22 @@ def build_list_addresses_at_resource_group_level_request( # pylint: disable=nam 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 +def build_order_items_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-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 + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -328,34 +320,35 @@ def build_get_address_by_name_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_address_request( - address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any +def build_order_items_update_request( + resource_group_name: str, + order_item_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-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 + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -367,32 +360,28 @@ def build_create_address_request( if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", 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 +def build_order_items_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", - ) # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -400,79 +389,84 @@ def build_delete_address_by_name_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_update_address_request( - address_name: str, resource_group_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any +def build_order_items_list_by_resource_group_request( # pylint: disable=name-too-long + 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-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 + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), } _url: str = _url.format(**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 - 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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_order_at_resource_group_level_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any +def build_order_items_list_by_subscription_request( # pylint: disable=name-too-long + 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-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 + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**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") @@ -480,27 +474,20 @@ def build_list_order_at_resource_group_level_request( # pylint: disable=name-to 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 +def build_order_items_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - accept = _headers.pop("Accept", "application/json") - + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}", - ) # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" 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), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -509,83 +496,62 @@ def build_get_order_by_name_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_order_items_at_resource_group_level_request( # pylint: disable=name-too-long - resource_group_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any +def build_order_items_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - accept = _headers.pop("Accept", "application/json") - + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems", - ) # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), } _url: str = _url.format(**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") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", 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 +def build_orders_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-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 + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "orderName": _SERIALIZER.url("order_name", order_name, "str"), } _url: str = _url.format(**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") @@ -593,145 +559,127 @@ def build_get_order_item_by_name_request( 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 +def build_orders_list_by_subscription_request( # pylint: disable=name-too-long + 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-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 + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**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 - 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) + return HttpRequest(method="GET", 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 +def build_orders_list_by_resource_group_request( # pylint: disable=name-too-long + 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-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 + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), } _url: str = _url.format(**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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", 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 +def build_products_and_configurations_list_configurations_request( # pylint: disable=name-too-long + 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-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 + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**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 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) + return HttpRequest(method="POST", 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 +def build_products_and_configurations_list_product_families_request( # pylint: disable=name-too-long + 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) 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 + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**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: @@ -741,61 +689,65 @@ def build_cancel_order_item_request( 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 +def build_products_and_configurations_list_product_families_metadata_request( # pylint: disable=name-too-long + 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01")) 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 + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" 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 - ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**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) -class EdgeOrderManagementClientOperationsMixin( # pylint: disable=too-many-public-methods - EdgeOrderManagementClientMixinABC -): +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.EdgeOrderManagementClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations that are exposed for customer. + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. - :return: An iterator like instance of either Operation or the result of cls(response) + :return: An iterator like instance of Operation :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -806,12 +758,17 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_operations_request( - api_version=api_version, + _request = build_operations_list_request( + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -824,18 +781,29 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -848,36 +816,50 @@ def get_next(next_link=None): 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + +class AddressesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.EdgeOrderManagementClient`'s + :attr:`addresses` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace - def list_addresses_at_subscription_level( - self, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.AddressResource"]: - """Lists all the addresses available under the subscription. + def get(self, resource_group_name: str, address_name: str, **kwargs: Any) -> _models.AddressResource: + """Get information about the specified address. - :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 - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.AddressResource] + :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 + :return: AddressResource. The AddressResource is compatible with MutableMapping + :rtype: ~azure.mgmt.edgeorder.models.AddressResource :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -885,392 +867,589 @@ def list_addresses_at_subscription_level( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_list_addresses_at_subscription_level_request( - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - 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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + _request = build_addresses_get_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - 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) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - 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) - - @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. + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: ~azure.mgmt.edgeorder.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 - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AddressResource, response.json()) - @overload - def list_product_families( - self, - product_families_request: IO[bytes], - 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. + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: IO[bytes] - :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 - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return deserialized # type: ignore - @distributed_trace - def list_product_families( + def _create_initial( self, - product_families_request: Union[_models.ProductFamiliesRequest, IO[bytes]], - expand: Optional[str] = None, - skip_token: Optional[str] = None, + resource_group_name: str, + address_name: str, + address_resource: Union[_models.AddressResource, _types.AddressResource, IO[bytes]], **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[bytes] type. Required. - :type product_families_request: ~azure.mgmt.edgeorder.models.ProductFamiliesRequest or - IO[bytes] - :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 - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type = content_type or "application/json" - _json = None _content = None - if isinstance(product_families_request, (IOBase, bytes)): - _content = product_families_request + if isinstance(address_resource, (IOBase, bytes)): + _content = address_resource else: - _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") + _content = json.dumps(address_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - def prepare_request(next_link=None): - if not next_link: + _request = build_addresses_create_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - 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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + response = pipeline_response.http_response - 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) + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - def get_next(next_link=None): - _request = prepare_request(next_link) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - 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) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return pipeline_response + return deserialized # type: ignore - return ItemPaged(get_next, extract_data) + @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.models.AddressResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ @overload - def list_configurations( + def begin_create( self, - configurations_request: _models.ConfigurationsRequest, - skip_token: Optional[str] = None, + resource_group_name: str, + address_name: str, + address_resource: _types.AddressResource, *, 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. + ) -> 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 configurations_request: Filters for showing the configurations. Required. - :type configurations_request: ~azure.mgmt.edgeorder.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 + :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.types.AddressResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.Configuration] + :return: An instance of LROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def list_configurations( + def begin_create( self, - configurations_request: IO[bytes], - skip_token: Optional[str] = None, + resource_group_name: str, + address_name: str, + address_resource: IO[bytes], *, 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. + ) -> 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 configurations_request: Filters for showing the configurations. Required. - :type configurations_request: IO[bytes] - :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 + :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[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.Configuration] + :return: An instance of LROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def list_configurations( + def begin_create( self, - configurations_request: Union[_models.ConfigurationsRequest, IO[bytes]], - skip_token: Optional[str] = None, + resource_group_name: str, + address_name: str, + address_resource: Union[_models.AddressResource, _types.AddressResource, IO[bytes]], **kwargs: Any - ) -> Iterable["_models.Configuration"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. + ) -> 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 configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO[bytes] type. Required. - :type configurations_request: ~azure.mgmt.edgeorder.models.ConfigurationsRequest or IO[bytes] - :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 - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.Configuration] + :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[bytes] type. Required. + :type address_resource: ~azure.mgmt.edgeorder.models.AddressResource or + ~azure.mgmt.edgeorder.types.AddressResource or IO[bytes] + :return: An instance of LROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Configurations] = kwargs.pop("cls", 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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AddressResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - error_map.update(kwargs.pop("error_map", {}) or {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AddressResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AddressResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, _types.AddressUpdateParameter, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type = content_type or "application/json" - _json = None _content = None - if isinstance(configurations_request, (IOBase, bytes)): - _content = configurations_request + if isinstance(address_update_parameter, (IOBase, bytes)): + _content = address_update_parameter else: - _json = self._serialize.body(configurations_request, "ConfigurationsRequest") + _content = json.dumps(address_update_parameter, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - def prepare_request(next_link=None): - if not next_link: + _request = build_addresses_update_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - 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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + response = pipeline_response.http_response - 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) + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - def get_next(next_link=None): - _request = prepare_request(next_link) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - 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) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return pipeline_response + return deserialized # type: ignore - return ItemPaged(get_next, extract_data) + @overload + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: _models.AddressUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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. Required. + :type address_update_parameter: ~azure.mgmt.edgeorder.models.AddressUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: _types.AddressUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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. Required. + :type address_update_parameter: ~azure.mgmt.edgeorder.types.AddressUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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. Required. + :type address_update_parameter: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def list_product_families_metadata( - 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. Default value is None. - :type skip_token: str - :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamiliesMetadataDetails] + def begin_update( + self, + resource_group_name: str, + address_name: str, + address_update_parameter: Union[_models.AddressUpdateParameter, _types.AddressUpdateParameter, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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[bytes] type. Required. + :type address_update_parameter: ~azure.mgmt.edgeorder.models.AddressUpdateParameter or + ~azure.mgmt.edgeorder.types.AddressUpdateParameter or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AddressResource. The AddressResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) + 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, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AddressResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AddressResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AddressResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, address_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1278,174 +1457,149 @@ def list_product_families_metadata( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_list_product_families_metadata_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - 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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + _request = build_addresses_delete_request( + resource_group_name=resource_group_name, + address_name=address_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - 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) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - 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) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace - def list_order_at_subscription_level( - 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. Default value is None. - :type skip_token: str - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.OrderResource] + 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 + :return: An instance of LROPoller that returns None + :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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + _params = kwargs.pop("params", {}) or {} - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_order_at_subscription_level_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + 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( + resource_group_name=resource_group_name, + address_name=address_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return cls(pipeline_response, None, {}) # type: ignore - def get_next(next_link=None): - _request = prepare_request(next_link) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_order_items_at_subscription_level( + 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"]: - """Lists order item 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 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. 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 - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.OrderItemResource] + ) -> ItemPaged["_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 + :keyword filter: $filter is supported to filter based on shipping address properties. Filter + supports only equals operation. Default value is None. + :paramtype filter: str + :keyword skip_token: $skipToken is supported on Get list of addresses, which provides the next + page in the list of addresses. Default value is None. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of AddressResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AddressResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1456,16 +1610,22 @@ def list_order_items_at_subscription_level( def prepare_request(next_link=None): if not next_link: - _request = build_list_order_items_at_subscription_level_request( + _request = build_addresses_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, - api_version=api_version, + top=top, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -1478,18 +1638,29 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AddressResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -1502,7 +1673,10 @@ def get_next(next_link=None): 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1510,31 +1684,35 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @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 - ) -> Iterable["_models.AddressResource"]: - """Lists all the addresses available under the given resource group. + def list_by_subscription( + self, + *, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.AddressResource"]: + """List all the addresses available under the subscription. - :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 + :keyword 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 address. Default value is None. - :type skip_token: str - :return: An iterator like instance of either AddressResource or the result of cls(response) + :paramtype filter: str + :keyword skip_token: $skipToken is supported on Get list of addresses, which provides the next + page in the list of addresses. Default value is None. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of AddressResource :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AddressResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1545,16 +1723,21 @@ def list_addresses_at_resource_group_level( def prepare_request(next_link=None): if not next_link: - _request = build_list_addresses_at_resource_group_level_request( - resource_group_name=resource_group_name, + _request = build_addresses_list_by_subscription_request( subscription_id=self._config.subscription_id, filter=filter, skip_token=skip_token, - api_version=api_version, + top=top, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -1567,18 +1750,29 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AddressResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -1591,31 +1785,57 @@ def get_next(next_link=None): 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + +class OrderItemsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.EdgeOrderManagementClient`'s + :attr:`order_items` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace - def get_address_by_name( - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.AddressResource: - """Gets information about the specified address. + def get( + self, resource_group_name: str, order_item_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.OrderItemResource: + """Get an order item. - :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 - :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.models.AddressResource + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :keyword 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. + :paramtype expand: str + :return: OrderItemResource. The OrderItemResource is compatible with MutableMapping + :rtype: ~azure.mgmt.edgeorder.models.OrderItemResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1624,22 +1844,26 @@ def get_address_by_name( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) + cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - _request = build_get_address_by_name_request( - address_name=address_name, + _request = build_order_items_get_request( resource_group_name=resource_group_name, + order_item_name=order_item_name, subscription_id=self._config.subscription_id, - api_version=api_version, + expand=expand, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1647,25 +1871,36 @@ def get_address_by_name( response = pipeline_response.http_response if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AddressResource", pipeline_response.http_response) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OrderItemResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_address_initial( + def _create_initial( self, - address_name: str, resource_group_name: str, - address_resource: Union[_models.AddressResource, IO[bytes]], + order_item_name: str, + order_item_resource: Union[_models.OrderItemResource, _types.OrderItemResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1674,32 +1909,32 @@ def _create_address_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" - _json = None _content = None - if isinstance(address_resource, (IOBase, bytes)): - _content = address_resource + if isinstance(order_item_resource, (IOBase, bytes)): + _content = order_item_resource else: - _json = self._serialize.body(address_resource, "AddressResource") + _content = json.dumps(order_item_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_create_address_request( - address_name=address_name, + _request = build_order_items_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, + api_version=self._config.api_version, content=_content, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) _stream = True @@ -1715,119 +1950,149 @@ def _create_address_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def begin_create_address( + def begin_create( self, - address_name: str, resource_group_name: str, - address_resource: _models.AddressResource, + order_item_name: str, + order_item_resource: _models.OrderItemResource, *, 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. + ) -> 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 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: ~azure.mgmt.edgeorder.models.AddressResource + :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.models.OrderItemResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :return: An instance of LROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_address( + def begin_create( self, - address_name: str, resource_group_name: str, - address_resource: IO[bytes], + order_item_name: str, + order_item_resource: _types.OrderItemResource, *, 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. + ) -> 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 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[bytes] + :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.types.OrderItemResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + order_item_name: str, + order_item_resource: IO[bytes], + *, + 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[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :return: An instance of LROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_address( + def begin_create( self, - address_name: str, resource_group_name: str, - address_resource: Union[_models.AddressResource, IO[bytes]], + order_item_name: str, + order_item_resource: Union[_models.OrderItemResource, _types.OrderItemResource, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address can be updated with this - API. + ) -> 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 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[bytes] type. Required. - :type address_resource: ~azure.mgmt.edgeorder.models.AddressResource or IO[bytes] - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :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[bytes] type. Required. + :type order_item_resource: ~azure.mgmt.edgeorder.models.OrderItemResource or + ~azure.mgmt.edgeorder.types.OrderItemResource or IO[bytes] + :return: An instance of LROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", 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_address_initial( - address_name=address_name, + raw_result = self._create_initial( resource_group_name=resource_group_name, - address_resource=address_resource, - api_version=api_version, + order_item_name=order_item_name, + order_item_resource=order_item_resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -1838,54 +2103,90 @@ def begin_create_address( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response.http_response) + response = pipeline_response.http_response + deserialized = _deserialize(_models.OrderItemResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.AddressResource].from_continuation_token( + return LROPoller[_models.OrderItemResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.AddressResource]( + return LROPoller[_models.OrderItemResource]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_address_by_name_initial( - self, address_name: str, resource_group_name: str, **kwargs: Any + def _update_initial( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: Union[ + _models.OrderItemUpdateParameter, _types.OrderItemUpdateParameter, IO[bytes] + ], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_delete_address_by_name_request( - address_name=address_name, + content_type = content_type or "application/json" + _content = None + if isinstance(order_item_update_parameter, (IOBase, bytes)): + _content = order_item_update_parameter + else: + _content = json.dumps(order_item_update_parameter, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_order_items_update_request( resource_group_name=resource_group_name, + order_item_name=order_item_name, subscription_id=self._config.subscription_id, - api_version=api_version, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) _stream = True @@ -1895,52 +2196,185 @@ def _delete_address_by_name_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore + @overload + def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: _models.OrderItemUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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. Required. + :type order_item_update_parameter: ~azure.mgmt.edgeorder.models.OrderItemUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: _types.OrderItemUpdateParameter, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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. Required. + :type order_item_update_parameter: ~azure.mgmt.edgeorder.types.OrderItemUpdateParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.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[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = 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. Required. + :type order_item_update_parameter: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def begin_delete_address_by_name( - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an address. + def begin_update( + self, + resource_group_name: str, + order_item_name: str, + order_item_update_parameter: Union[ + _models.OrderItemUpdateParameter, _types.OrderItemUpdateParameter, IO[bytes] + ], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.OrderItemResource]: + """Update the properties of an existing order item. - :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 - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] + :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[bytes] type. Required. + :type order_item_update_parameter: ~azure.mgmt.edgeorder.models.OrderItemUpdateParameter or + ~azure.mgmt.edgeorder.types.OrderItemUpdateParameter or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns OrderItemResource. The OrderItemResource is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + 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._delete_address_by_name_initial( - address_name=address_name, + raw_result = self._update_initial( resource_group_name=resource_group_name, - api_version=api_version, + order_item_name=order_item_name, + order_item_update_parameter=order_item_update_parameter, + etag=etag, + match_condition=match_condition, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1949,34 +2383,38 @@ def begin_delete_address_by_name( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.OrderItemResource, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.OrderItemResource].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[_models.OrderItemResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _update_address_initial( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def _delete_initial(self, resource_group_name: str, order_item_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1984,34 +2422,23 @@ def _update_address_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_update_parameter, (IOBase, bytes)): - _content = address_update_parameter - else: - _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") - - _request = build_update_address_request( - address_name=address_name, + _request = build_order_items_delete_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, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) _stream = True @@ -2021,137 +2448,54 @@ def _update_address_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - def begin_update_address( - self, - 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. 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: ~azure.mgmt.edgeorder.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 - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: IO[bytes], - 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[bytes] - :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 - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.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[bytes]], - 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 + 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 address_update_parameter: Address update parameters from request body. Is either a - AddressUpdateParameter type or a IO[bytes] type. Required. - :type address_update_parameter: ~azure.mgmt.edgeorder.models.AddressUpdateParameter or - IO[bytes] - :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 - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] + :param order_item_name: The name of the order item. Required. + :type order_item_name: str + :return: An instance of LROPoller that returns None + :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 {}) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", 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._update_address_initial( - address_name=address_name, + raw_result = self._delete_initial( resource_group_name=resource_group_name, - address_update_parameter=address_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, + order_item_name=order_item_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2160,52 +2504,73 @@ def begin_update_address( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.AddressResource].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.AddressResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_order_at_resource_group_level( - self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.OrderResource"]: - """Lists order at resource group level. + 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 + ) -> ItemPaged["_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 skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. Default value is None. - :type skip_token: str - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.OrderResource] + :keyword filter: $filter is supported to filter based on order id and order Item Type. Filter + supports only equals operation. Default value is None. + :paramtype filter: str + :keyword 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. + :paramtype expand: str + :keyword 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. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of OrderItemResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) + cls: ClsType[List[_models.OrderItemResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2216,15 +2581,23 @@ def list_order_at_resource_group_level( def prepare_request(next_link=None): if not next_link: - _request = build_list_order_at_resource_group_level_request( + _request = build_order_items_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, - api_version=api_version, + top=top, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -2237,18 +2610,29 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OrderItemResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -2261,7 +2645,10 @@ def get_next(next_link=None): 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2269,103 +2656,43 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - 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. 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. Required. - :type location: str - :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.models.OrderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OrderResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_order_items_at_resource_group_level( + def list_by_subscription( 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"]: - """Lists order item at resource group level. + ) -> ItemPaged["_models.OrderItemResource"]: + """List order items at subscription 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 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. 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 - :return: An iterator like instance of either OrderItemResource or the result of cls(response) + :keyword filter: $filter is supported to filter based on order id and order Item Type. Filter + supports only equals operation. Default value is None. + :paramtype filter: str + :keyword 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. + :paramtype expand: str + :keyword 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. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of OrderItemResource :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) + cls: ClsType[List[_models.OrderItemResource]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2376,17 +2703,22 @@ def list_order_items_at_resource_group_level( def prepare_request(next_link=None): if not next_link: - _request = build_list_order_items_at_resource_group_level_request( - resource_group_name=resource_group_name, + _request = build_order_items_list_by_subscription_request( subscription_id=self._config.subscription_id, filter=filter, expand=expand, skip_token=skip_token, - api_version=api_version, + top=top, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -2399,18 +2731,29 @@ def prepare_request(next_link=None): ) _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 + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OrderItemResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -2423,35 +2766,121 @@ def get_next(next_link=None): 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) - @distributed_trace - 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. + @overload + def cancel( + 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.models.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: _types.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.types.CancellationReason + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def cancel( + self, + resource_group_name: str, + order_item_name: str, + cancellation_reason: IO[bytes], + *, + 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[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :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, _types.CancellationReason, IO[bytes]], + **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 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. Default value is - None. - :type expand: str - :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.models.OrderItemResource + :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[bytes] type. Required. + :type cancellation_reason: ~azure.mgmt.edgeorder.models.CancellationReason or + ~azure.mgmt.edgeorder.types.CancellationReason or IO[bytes] + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2459,22 +2888,33 @@ def get_order_item_by_name( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_get_order_item_by_name_request( - order_item_name=order_item_name, + content_type = content_type or "application/json" + _content = None + if isinstance(cancellation_reason, (IOBase, bytes)): + _content = cancellation_reason + else: + _content = json.dumps(cancellation_reason, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_order_items_cancel_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access @@ -2483,26 +2923,25 @@ def get_order_item_by_name( response = pipeline_response.http_response - if response.status_code not in [200]: + 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore - def _create_order_item_initial( + def _return_method_initial( self, - order_item_name: str, resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO[bytes]], + order_item_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, _types.ReturnOrderItemDetails, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2511,32 +2950,32 @@ def _create_order_item_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" - _json = None _content = None - if isinstance(order_item_resource, (IOBase, bytes)): - _content = order_item_resource + if isinstance(return_order_item_details, (IOBase, bytes)): + _content = return_order_item_details else: - _json = self._serialize.body(order_item_resource, "OrderItemResource") + _content = json.dumps(return_order_item_details, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_create_order_item_request( - order_item_name=order_item_name, + _request = build_order_items_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, + api_version=self._config.api_version, content=_content, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) _stream = True @@ -2552,113 +2991,141 @@ def _create_order_item_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + response_headers = {} + if response.status_code == 202: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def begin_create_order_item( + 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.models.ReturnOrderItemDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_return_method( + self, resource_group_name: str, - order_item_resource: _models.OrderItemResource, + order_item_name: str, + return_order_item_details: _types.ReturnOrderItemDetails, *, 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. + ) -> 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 order_item_resource: Order item details from request body. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.models.OrderItemResource + :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.types.ReturnOrderItemDetails :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_order_item( + def begin_return_method( self, - order_item_name: str, resource_group_name: str, - order_item_resource: IO[bytes], + order_item_name: str, + return_order_item_details: IO[bytes], *, 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. + ) -> 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 order_item_resource: Order item details from request body. Required. - :type order_item_resource: IO[bytes] + :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[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_order_item( + def begin_return_method( self, - order_item_name: str, resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO[bytes]], + order_item_name: str, + return_order_item_details: Union[_models.ReturnOrderItemDetails, _types.ReturnOrderItemDetails, IO[bytes]], **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. + ) -> 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 order_item_resource: Order item details from request body. Is either a OrderItemResource + :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[bytes] type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.models.OrderItemResource or IO[bytes] - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :type return_order_item_details: ~azure.mgmt.edgeorder.models.ReturnOrderItemDetails or + ~azure.mgmt.edgeorder.types.ReturnOrderItemDetails or IO[bytes] + :return: An instance of LROPoller that returns None + :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 {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", 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._create_order_item_initial( - order_item_name=order_item_name, + raw_result = self._return_method_initial( resource_group_name=resource_group_name, - order_item_resource=order_item_resource, - api_version=api_version, + order_item_name=order_item_name, + return_order_item_details=return_order_item_details, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -2668,33 +3135,65 @@ def begin_create_order_item( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.OrderItemResource].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.OrderItemResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _delete_order_item_by_name_initial( - self, order_item_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + +class OrdersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.EdgeOrderManagementClient`'s + :attr:`orders` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @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 the Azure region. Required. + :type location: str + :param order_name: The name of the order. Required. + :type order_name: str + :return: OrderResource. The OrderResource is compatible with MutableMapping + :rtype: ~azure.mgmt.edgeorder.models.OrderResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2703,39 +3202,49 @@ def _delete_order_item_by_name_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) - _request = build_delete_order_item_by_name_request( - order_item_name=order_item_name, + _request = build_orders_get_request( resource_group_name=resource_group_name, + location=location, + order_name=order_name, subscription_id=self._config.subscription_id, - api_version=api_version, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OrderResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2743,69 +3252,133 @@ def _delete_order_item_by_name_initial( return deserialized # type: ignore @distributed_trace - def begin_delete_order_item_by_name( - 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. 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 - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] + def list_by_subscription( + self, *, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_models.OrderResource"]: + """List orders at subscription level. + + :keyword skip_token: $skipToken is supported on Get list of orders, which provides the next + page in the list of orders. Default value is None. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of OrderResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.OrderResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[List[_models.OrderResource]] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + error_map: MutableMapping = { + 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_orders_list_by_subscription_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OrderResource], + deserialized.get("value", []), + ) if cls: - return cls(pipeline_response, None, {}) # type: ignore + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + response = pipeline_response.http_response - def _update_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_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 + :keyword skip_token: $skipToken is supported on Get list of orders, which provides the next + page in the list of orders. Default value is None. + :paramtype skip_token: str + :keyword 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. + :paramtype top: int + :return: An iterator like instance of OrderResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.OrderResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OrderResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2813,509 +3386,592 @@ def _update_order_item_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + _request = build_orders_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_update_parameter, (IOBase, bytes)): - _content = order_item_update_parameter - else: - _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + return _request - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OrderResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - 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) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + return pipeline_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return ItemPaged(get_next, extract_data) - return deserialized # type: ignore - @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. +class ProductsAndConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :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.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 - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ + Instead, you should access the following operations through + :class:`~azure.mgmt.edgeorder.EdgeOrderManagementClient`'s + :attr:`products_and_configurations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: EdgeOrderManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def begin_update_order_item( + def list_configurations( self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: IO[bytes], - if_match: Optional[str] = None, + configurations_request: _models.ConfigurationsRequest, *, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. + ) -> ItemPaged["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. - :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[bytes] - :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. + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: ~azure.mgmt.edgeorder.models.ConfigurationsRequest + :keyword skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :paramtype 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 - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.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[bytes]], - 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[bytes] type. Required. - :type order_item_update_parameter: ~azure.mgmt.edgeorder.models.OrderItemUpdateParameter or - IO[bytes] - :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 - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] + :return: An iterator like instance of Configuration + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.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: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.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, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - 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[_models.OrderItemResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OrderItemResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) @overload - def cancel_order_item( # pylint: disable=inconsistent-return-statements + def list_configurations( self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: _models.CancellationReason, + configurations_request: _types.ConfigurationsRequest, *, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Cancel order item. + ) -> ItemPaged["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. - :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.models.CancellationReason + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: ~azure.mgmt.edgeorder.types.ConfigurationsRequest + :keyword skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :paramtype 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 - :return: None or the result of cls(response) - :rtype: None + :return: An iterator like instance of Configuration + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def cancel_order_item( # pylint: disable=inconsistent-return-statements + def list_configurations( self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: IO[bytes], + configurations_request: IO[bytes], *, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Cancel order item. + ) -> ItemPaged["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. - :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[bytes] + :param configurations_request: Filters for showing the configurations. Required. + :type configurations_request: IO[bytes] + :keyword skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :paramtype 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 - :return: None or the result of cls(response) - :rtype: None + :return: An iterator like instance of Configuration + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def cancel_order_item( # pylint: disable=inconsistent-return-statements + def list_configurations( self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: Union[_models.CancellationReason, IO[bytes]], + configurations_request: Union[_models.ConfigurationsRequest, _types.ConfigurationsRequest, IO[bytes]], + *, + skip_token: Optional[str] = None, **kwargs: Any - ) -> None: - """Cancel order item. + ) -> ItemPaged["_models.Configuration"]: + """List configurations for the given product family, product line and product for the given + subscription. - :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[bytes] type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.models.CancellationReason or IO[bytes] - :return: None or the result of cls(response) - :rtype: None + :param configurations_request: Filters for showing the configurations. Is either a + ConfigurationsRequest type or a IO[bytes] type. Required. + :type configurations_request: ~azure.mgmt.edgeorder.models.ConfigurationsRequest or + ~azure.mgmt.edgeorder.types.ConfigurationsRequest or IO[bytes] + :keyword skip_token: $skipToken is supported on list of configurations, which provides the next + page in the list of configurations. Default value is None. + :paramtype skip_token: str + :return: An iterator like instance of Configuration + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.Configuration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None _content = None - if isinstance(cancellation_reason, (IOBase, bytes)): - _content = cancellation_reason + if isinstance(configurations_request, (IOBase, bytes)): + _content = configurations_request 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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 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) + _content = json.dumps(configurations_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - if cls: - return cls(pipeline_response, None, {}) # type: ignore + def prepare_request(next_link=None): + if not next_link: - def _return_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + _request = build_products_and_configurations_list_configurations_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + return _request - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(return_order_item_details, (IOBase, bytes)): - _content = return_order_item_details - else: - _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Configuration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - _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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + def get_next(next_link=None): + _request = prepare_request(next_link) - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - 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 - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + return ItemPaged(get_next, extract_data) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + @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 + ) -> ItemPaged["_models.ProductFamily"]: + """List product families for the given subscription. - return deserialized # type: ignore + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: ~azure.mgmt.edgeorder.models.ProductFamiliesRequest + :keyword expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :paramtype expand: str + :keyword 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. + :paramtype 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 + :return: An iterator like instance of ProductFamily + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] + :raises ~azure.core.exceptions.HttpResponseError: + """ @overload - def begin_return_order_item( + def list_product_families( self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: _models.ReturnOrderItemDetails, + product_families_request: _types.ProductFamiliesRequest, *, + expand: Optional[str] = None, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Return order item. + ) -> ItemPaged["_models.ProductFamily"]: + """List product families for the given subscription. - :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: ~azure.mgmt.edgeorder.models.ReturnOrderItemDetails + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: ~azure.mgmt.edgeorder.types.ProductFamiliesRequest + :keyword expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :paramtype expand: str + :keyword 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. + :paramtype 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 - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] + :return: An iterator like instance of ProductFamily + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_return_order_item( + def list_product_families( self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: IO[bytes], + product_families_request: IO[bytes], *, + expand: Optional[str] = None, + skip_token: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Return order item. + ) -> ItemPaged["_models.ProductFamily"]: + """List product families for the given subscription. - :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[bytes] + :param product_families_request: Filters for showing the product families. Required. + :type product_families_request: IO[bytes] + :keyword expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :paramtype expand: str + :keyword 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. + :paramtype 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 - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] + :return: An iterator like instance of ProductFamily + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_return_order_item( + def list_product_families( self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO[bytes]], + product_families_request: Union[_models.ProductFamiliesRequest, _types.ProductFamiliesRequest, IO[bytes]], + *, + expand: Optional[str] = None, + skip_token: Optional[str] = None, **kwargs: Any - ) -> LROPoller[None]: - """Return order item. + ) -> ItemPaged["_models.ProductFamily"]: + """List product families for the given subscription. - :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[bytes] type. Required. - :type return_order_item_details: ~azure.mgmt.edgeorder.models.ReturnOrderItemDetails or - IO[bytes] - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] + :param product_families_request: Filters for showing the product families. Is either a + ProductFamiliesRequest type or a IO[bytes] type. Required. + :type product_families_request: ~azure.mgmt.edgeorder.models.ProductFamiliesRequest or + ~azure.mgmt.edgeorder.types.ProductFamiliesRequest or IO[bytes] + :keyword expand: $expand is supported on configurations parameter for product, which provides + details on the configurations for the product. Default value is None. + :paramtype expand: str + :keyword 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. + :paramtype skip_token: str + :return: An iterator like instance of ProductFamily + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - 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( - order_item_name=order_item_name, - resource_group_name=resource_group_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 + cls: ClsType[List[_models.ProductFamily]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _content = None + if isinstance(product_families_request, (IOBase, bytes)): + _content = product_families_request + else: + _content = json.dumps(product_families_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + def prepare_request(next_link=None): + if not next_link: + + _request = build_products_and_configurations_list_product_families_request( + subscription_id=self._config.subscription_id, + expand=expand, + skip_token=skip_token, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ProductFamily], + deserialized.get("value", []), ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_product_families_metadata( + self, *, skip_token: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.ProductFamiliesMetadataDetails"]: + """List product families metadata for the given subscription. + + :keyword 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. + :paramtype skip_token: str + :return: An iterator like instance of ProductFamiliesMetadataDetails + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamiliesMetadataDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ProductFamiliesMetadataDetails]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 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_products_and_configurations_list_product_families_metadata_request( + subscription_id=self._config.subscription_id, + skip_token=skip_token, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ProductFamiliesMetadataDetails], + deserialized.get("value", []), + ) if cls: - return cls(pipeline_response, None, {}) # type: ignore + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_patch.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/types.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/types.py new file mode 100644 index 000000000000..5a35f9359a86 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/types.py @@ -0,0 +1,2040 @@ +# pylint: disable=line-too-long,useless-suppression,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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from .models._enums import BillingType + +if TYPE_CHECKING: + from .models import ( + ActionStatusEnum, + ActionType, + AddressClassification, + AddressType, + AddressValidationStatus, + AutoProvisioningStatus, + AvailabilityStage, + ChargingType, + ChildConfigurationType, + CreatedByType, + DescriptionType, + DevicePresenceVerificationStatus, + DisabledReason, + DoubleEncryptionStatus, + FulfillmentType, + IdentificationType, + ImageType, + LengthHeightUnit, + LinkType, + MeteringType, + NotificationStageName, + OrderItemCancellationEnum, + OrderItemReturnEnum, + OrderItemType, + OrderMode, + Origin, + ProvisioningState, + ProvisioningSupport, + StageName, + StageStatus, + SupportedFilterTypes, + TermCommitmentType, + TransportShipmentTypes, + WeightMeasurementUnit, + ) + + +class AdditionalConfiguration(TypedDict, total=False): + """Additional Configuration details. + + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the + configuration. Required. + :vartype hierarchy_information: "HierarchyInformation" + :ivar quantity: Quantity of the product. Required. + :vartype quantity: int + :ivar provisioning_details: List Provisioning Details for Devices in Additional Config. + :vartype provisioning_details: list["ProvisioningDetails"] + """ + + hierarchyInformation: Required["HierarchyInformation"] + """Hierarchy of the product which uniquely identifies the configuration. Required.""" + quantity: Required[int] + """Quantity of the product. Required.""" + provisioningDetails: list["ProvisioningDetails"] + """List Provisioning Details for Devices in Additional Config.""" + + +class AddressDetails(TypedDict, total=False): + """Address details for an order item. + + :ivar forward_address: Customer address and contact details. Required. + :vartype forward_address: "AddressProperties" + :ivar return_address: Return shipping address. + :vartype return_address: "AddressProperties" + """ + + forwardAddress: Required["AddressProperties"] + """Customer address and contact details. Required.""" + returnAddress: "AddressProperties" + """Return shipping address.""" + + +class AddressProperties(TypedDict, total=False): + """Address Properties. + + :ivar address_classification: Type of address based on its usage context. Known values are: + "Shipping" and "Site". + :vartype address_classification: Union[str, "AddressClassification"] + :ivar shipping_address: Shipping details for the address. + :vartype shipping_address: "ShippingAddress" + :ivar contact_details: Contact details for the address. + :vartype contact_details: "ContactDetails" + :ivar address_validation_status: Status of address validation. Known values are: "Valid", + "Invalid", and "Ambiguous". + :vartype address_validation_status: Union[str, "AddressValidationStatus"] + :ivar provisioning_state: Provisioning state. Known values are: "Creating", "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: Union[str, "ProvisioningState"] + """ + + addressClassification: Union[str, "AddressClassification"] + """Type of address based on its usage context. Known values are: \"Shipping\" and \"Site\".""" + shippingAddress: "ShippingAddress" + """Shipping details for the address.""" + contactDetails: "ContactDetails" + """Contact details for the address.""" + addressValidationStatus: Union[str, "AddressValidationStatus"] + """Status of address validation. Known values are: \"Valid\", \"Invalid\", and \"Ambiguous\".""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state. Known values are: \"Creating\", \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + +class Resource(TypedDict, total=False): + """Resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class AddressResource(TrackedResource): + """Address Resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Properties of an address. Required. + :vartype properties: "AddressProperties" + """ + + properties: Required["AddressProperties"] + """Properties of an address. Required.""" + + +class AddressUpdateParameter(TypedDict, total=False): + """The Address update parameters. + + :ivar properties: Properties of an address to be updated. + :vartype properties: "AddressUpdateProperties" + :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] + """ + + properties: "AddressUpdateProperties" + """Properties of an address to be updated.""" + tags: dict[str, str] + """The list of key value pairs that describe the resource. These tags can be used in viewing and + grouping this resource (across resource groups).""" + + +class AddressUpdateProperties(TypedDict, total=False): + """Address Update Properties. + + :ivar shipping_address: Shipping details for the address. + :vartype shipping_address: "ShippingAddress" + :ivar contact_details: Contact details for the address. + :vartype contact_details: "ContactDetails" + """ + + shippingAddress: "ShippingAddress" + """Shipping details for the address.""" + contactDetails: "ContactDetails" + """Contact details for the address.""" + + +class AvailabilityInformation(TypedDict, total=False): + """Availability information of a product system. + + :ivar availability_stage: Current availability stage of the product. Known values are: + "Available", "Preview", "Signup", "Discoverable", "ComingSoon", "Unavailable", and + "Deprecated". + :vartype availability_stage: Union[str, "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: Union[str, "DisabledReason"] + :ivar disabled_reason_message: Message for why the product is disabled. + :vartype disabled_reason_message: str + """ + + availabilityStage: Union[str, "AvailabilityStage"] + """Current availability stage of the product. Known values are: \"Available\", \"Preview\", + \"Signup\", \"Discoverable\", \"ComingSoon\", \"Unavailable\", and \"Deprecated\".""" + disabledReason: Union[str, "DisabledReason"] + """Reason why the product is disabled. Known values are: \"None\", \"Country\", \"Region\", + \"Feature\", \"OfferType\", \"NoSubscriptionInfo\", \"NotAvailable\", and \"OutOfStock\".""" + disabledReasonMessage: str + """Message for why the product is disabled.""" + + +class BasicInformation(TypedDict, total=False): + """Basic information for any product system. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: "Description" + :ivar image_information: Image information for the product system. + :vartype image_information: list["ImageInformation"] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: "CostInformation" + :ivar availability_information: Availability information of the product system. + :vartype availability_information: "AvailabilityInformation" + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: "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: Union[str, "FulfillmentType"] + """ + + displayName: str + """Display Name for the product system.""" + description: "Description" + """Description related to the product system.""" + imageInformation: list["ImageInformation"] + """Image information for the product system.""" + costInformation: "CostInformation" + """Cost information for the product system.""" + availabilityInformation: "AvailabilityInformation" + """Availability information of the product system.""" + hierarchyInformation: "HierarchyInformation" + """Hierarchy information of a product.""" + fulfilledBy: Union[str, "FulfillmentType"] + """The entity responsible for fulfillment of the item at the given hierarchy level. Known values + are: \"Microsoft\" and \"External\".""" + + +class BillingMeterDetails(TypedDict, total=False): + """Holds billing meter details for each type of billing. + + :ivar name: Represents Billing type name. + :vartype name: str + :ivar meter_details: Represents MeterDetails. + :vartype meter_details: "MeterDetails" + :ivar metering_type: Represents Metering type (eg one-time or recurrent). Known values are: + "OneTime", "Recurring", and "Adhoc". + :vartype metering_type: Union[str, "MeteringType"] + :ivar frequency: Frequency of recurrence. + :vartype frequency: str + :ivar term_type_details: Represent Term Type details. + :vartype term_type_details: "TermTypeDetails" + """ + + name: str + """Represents Billing type name.""" + meterDetails: "MeterDetails" + """Represents MeterDetails.""" + meteringType: Union[str, "MeteringType"] + """Represents Metering type (eg one-time or recurrent). Known values are: \"OneTime\", + \"Recurring\", and \"Adhoc\".""" + frequency: str + """Frequency of recurrence.""" + termTypeDetails: "TermTypeDetails" + """Represent Term Type details.""" + + +class CancellationReason(TypedDict, total=False): + """Reason for cancellation. + + :ivar reason: Reason for cancellation. Required. + :vartype reason: str + """ + + reason: Required[str] + """Reason for cancellation. Required.""" + + +class CategoryInformation(TypedDict, total=False): + """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["Link"] + """ + + categoryName: str + """Category name of the child configuration.""" + categoryDisplayName: str + """Category display name of the child configuration.""" + description: str + """Description text for the category.""" + links: list["Link"] + """Links for the category.""" + + +class ChildConfiguration(TypedDict, total=False): + """Child configuration object. + + :ivar properties: Properties of child configuration. + :vartype properties: "ChildConfigurationProperties" + """ + + properties: "ChildConfigurationProperties" + """Properties of child configuration.""" + + +class ChildConfigurationFilter(TypedDict, total=False): + """Child configuration filter. + + :ivar hierarchy_informations: The list of child configuration hierarchy customer wants to + filter for the given configuration. + :vartype hierarchy_informations: list["HierarchyInformation"] + :ivar child_configuration_types: Filter to fetch all child configurations belonging to the + given list of configuration types. + :vartype child_configuration_types: list[Union[str, "ChildConfigurationType"]] + """ + + hierarchyInformations: list["HierarchyInformation"] + """The list of child configuration hierarchy customer wants to filter for the given configuration.""" + childConfigurationTypes: list[Union[str, "ChildConfigurationType"]] + """Filter to fetch all child configurations belonging to the given list of configuration types.""" + + +class ChildConfigurationProperties(TypedDict, total=False): + """Properties of child configuration. + + :ivar child_configuration_type: Child configuration type. Known values are: + "DeviceConfiguration" and "AdditionalConfiguration". + :vartype child_configuration_type: Union[str, "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["Specification"] + :ivar dimensions: Dimensions of the configuration. + :vartype dimensions: "Dimensions" + :ivar provisioning_support: Determining nature of provisioning that the configuration supports. + Known values are: "CloudBased" and "Manual". + :vartype provisioning_support: Union[str, "ProvisioningSupport"] + :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[Union[str, "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["GroupedChildConfigurations"] + :ivar supported_term_commitment_durations: The Term Commitment Durations that are supported for + a configuration. + :vartype supported_term_commitment_durations: list[str] + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list["FilterableProperty"] + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: "Description" + :ivar image_information: Image information for the product system. + :vartype image_information: list["ImageInformation"] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: "CostInformation" + :ivar availability_information: Availability information of the product system. + :vartype availability_information: "AvailabilityInformation" + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: "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: Union[str, "FulfillmentType"] + """ + + childConfigurationType: Union[str, "ChildConfigurationType"] + """Child configuration type. Known values are: \"DeviceConfiguration\" and + \"AdditionalConfiguration\".""" + isPartOfBaseConfiguration: bool + """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.""" + minimumQuantity: int + """Minimum quantity a customer can order while choosing this configuration.""" + maximumQuantity: int + """Maximum quantity a customer can order while choosing this configuration.""" + specifications: list["Specification"] + """Specifications of the configuration.""" + dimensions: "Dimensions" + """Dimensions of the configuration.""" + provisioningSupport: Union[str, "ProvisioningSupport"] + """Determining nature of provisioning that the configuration supports. Known values are: + \"CloudBased\" and \"Manual\".""" + childConfigurationTypes: list[Union[str, "ChildConfigurationType"]] + """Different types of child configurations which exist for this configuration, these can be used + to populate the child configuration filter.""" + groupedChildConfigurations: list["GroupedChildConfigurations"] + """Child configurations present for the configuration after applying child configuration filter, + grouped by the category name of the child configuration.""" + supportedTermCommitmentDurations: list[str] + """The Term Commitment Durations that are supported for a configuration.""" + filterableProperties: list["FilterableProperty"] + """List of filters supported for a product.""" + displayName: str + """Display Name for the product system.""" + description: "Description" + """Description related to the product system.""" + imageInformation: list["ImageInformation"] + """Image information for the product system.""" + costInformation: "CostInformation" + """Cost information for the product system.""" + availabilityInformation: "AvailabilityInformation" + """Availability information of the product system.""" + hierarchyInformation: "HierarchyInformation" + """Hierarchy information of a product.""" + fulfilledBy: Union[str, "FulfillmentType"] + """The entity responsible for fulfillment of the item at the given hierarchy level. Known values + are: \"Microsoft\" and \"External\".""" + + +class CommonProperties(BasicInformation): + """Represents common properties across product hierarchy. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: "Description" + :ivar image_information: Image information for the product system. + :vartype image_information: list["ImageInformation"] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: "CostInformation" + :ivar availability_information: Availability information of the product system. + :vartype availability_information: "AvailabilityInformation" + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: "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: Union[str, "FulfillmentType"] + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list["FilterableProperty"] + """ + + filterableProperties: list["FilterableProperty"] + """List of filters supported for a product.""" + + +class Configuration(TypedDict, total=False): + """Configuration object. + + :ivar properties: Properties of configuration. + :vartype properties: "ConfigurationProperties" + """ + + properties: "ConfigurationProperties" + """Properties of configuration.""" + + +class ConfigurationDeviceDetails(TypedDict, total=False): + """Device details for configuration. + + :ivar display_info: Display details of the product. + :vartype display_info: "DisplayInfo" + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the + configuration. + :vartype hierarchy_information: "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: Union[str, "IdentificationType"] + :ivar device_details: List of device details. + :vartype device_details: list["DeviceDetails"] + :ivar term_commitment_information: Term Commitment Information of the Device. + :vartype term_commitment_information: "TermCommitmentInformation" + """ + + displayInfo: "DisplayInfo" + """Display details of the product.""" + hierarchyInformation: "HierarchyInformation" + """Hierarchy of the product which uniquely identifies the configuration.""" + quantity: int + """Quantity of the product.""" + identificationType: Union[str, "IdentificationType"] + """Identification type of the configuration. Known values are: \"NotSupported\" and + \"SerialNumber\".""" + deviceDetails: list["DeviceDetails"] + """List of device details.""" + termCommitmentInformation: "TermCommitmentInformation" + """Term Commitment Information of the Device.""" + + +class ConfigurationFilter(TypedDict, total=False): + """Configuration filters. + + :ivar hierarchy_information: Product hierarchy information. Required. + :vartype hierarchy_information: "HierarchyInformation" + :ivar filterable_property: Filters specific to product. + :vartype filterable_property: list["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: "ChildConfigurationFilter" + """ + + hierarchyInformation: Required["HierarchyInformation"] + """Product hierarchy information. Required.""" + filterableProperty: list["FilterableProperty"] + """Filters specific to product.""" + childConfigurationFilter: "ChildConfigurationFilter" + """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.""" + + +class ConfigurationProperties(CommonProperties): + """Properties of configuration. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: "Description" + :ivar image_information: Image information for the product system. + :vartype image_information: list["ImageInformation"] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: "CostInformation" + :ivar availability_information: Availability information of the product system. + :vartype availability_information: "AvailabilityInformation" + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: "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: Union[str, "FulfillmentType"] + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list["FilterableProperty"] + :ivar specifications: Specifications of the configuration. + :vartype specifications: list["Specification"] + :ivar dimensions: Dimensions of the configuration. + :vartype dimensions: "Dimensions" + :ivar provisioning_support: Determining nature of provisioning that the configuration supports. + Known values are: "CloudBased" and "Manual". + :vartype provisioning_support: Union[str, "ProvisioningSupport"] + :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[Union[str, "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["GroupedChildConfigurations"] + :ivar supported_term_commitment_durations: The Term Commitment Durations that are supported for + a configuration. + :vartype supported_term_commitment_durations: list[str] + """ + + specifications: list["Specification"] + """Specifications of the configuration.""" + dimensions: "Dimensions" + """Dimensions of the configuration.""" + provisioningSupport: Union[str, "ProvisioningSupport"] + """Determining nature of provisioning that the configuration supports. Known values are: + \"CloudBased\" and \"Manual\".""" + childConfigurationTypes: list[Union[str, "ChildConfigurationType"]] + """Different types of child configurations which exist for this configuration, these can be used + to populate the child configuration filter.""" + groupedChildConfigurations: list["GroupedChildConfigurations"] + """Child configurations present for the configuration after applying child configuration filter, + grouped by the category name of the child configuration.""" + supportedTermCommitmentDurations: list[str] + """The Term Commitment Durations that are supported for a configuration.""" + + +class ConfigurationsRequest(TypedDict, total=False): + """Configuration request object. + + :ivar configuration_filter: Holds details about product hierarchy information and filterable + property. + :vartype configuration_filter: "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: "CustomerSubscriptionDetails" + """ + + configurationFilter: "ConfigurationFilter" + """Holds details about product hierarchy information and filterable property.""" + customerSubscriptionDetails: "CustomerSubscriptionDetails" + """Customer subscription properties. Clients can display available products to unregistered + customers by explicitly passing subscription details.""" + + +class ContactDetails(TypedDict, total=False): + """Contact Details. + + :ivar contact_name: Contact name of the person. + :vartype contact_name: str + :ivar phone: Phone number of the contact person. + :vartype phone: str + :ivar phone_extension: Phone extension number of the contact person. + :vartype phone_extension: str + :ivar mobile: Mobile number of the contact person. + :vartype mobile: str + :ivar email_list: List of Email-ids to be notified about job progress. + :vartype email_list: list[str] + """ + + contactName: str + """Contact name of the person.""" + phone: str + """Phone number of the contact person.""" + phoneExtension: str + """Phone extension number of the contact person.""" + mobile: str + """Mobile number of the contact person.""" + emailList: list[str] + """List of Email-ids to be notified about job progress.""" + + +class CostInformation(TypedDict, total=False): + """Cost information for the product system. + + :ivar billing_meter_details: Details on the various billing aspects for the product system. + :vartype billing_meter_details: list["BillingMeterDetails"] + :ivar billing_info_url: Default url to display billing information. + :vartype billing_info_url: str + """ + + billingMeterDetails: list["BillingMeterDetails"] + """Details on the various billing aspects for the product system.""" + billingInfoUrl: str + """Default url to display billing information.""" + + +class CustomerSubscriptionDetails(TypedDict, total=False): + """Holds Customer subscription details. Clients can display available products to unregistered + customers by explicitly passing subscription details. + + :ivar registered_features: List of registered feature flags for subscription. + :vartype registered_features: list["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 + """ + + registeredFeatures: list["CustomerSubscriptionRegisteredFeatures"] + """List of registered feature flags for subscription.""" + locationPlacementId: str + """Location placement Id of a subscription.""" + quotaId: Required[str] + """Quota ID of a subscription. Required.""" + + +class CustomerSubscriptionRegisteredFeatures(TypedDict, total=False): + """Represents subscription registered features. + + :ivar name: Name of subscription registered feature. + :vartype name: str + :ivar state: State of subscription registered feature. + :vartype state: str + """ + + name: str + """Name of subscription registered feature.""" + state: str + """State of subscription registered feature.""" + + +class Description(TypedDict, total=False): + """Description related properties of a product system. + + :ivar description_type: Type of description. "Base" + :vartype description_type: Union[str, "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["Link"] + """ + + descriptionType: Union[str, "DescriptionType"] + """Type of description. \"Base\"""" + shortDescription: str + """Short description of the product system.""" + longDescription: str + """Long description of the product system.""" + keywords: list[str] + """Keywords for the product system.""" + attributes: list[str] + """Attributes for the product system.""" + links: list["Link"] + """Links for the product system.""" + + +class DeviceDetails(TypedDict, total=False): + """Device details. + + :ivar serial_number: Device serial number. + :vartype serial_number: str + :ivar display_serial_number: Device serial number to be displayed. + :vartype display_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 + :ivar provisioning_support: Determining nature of provisioning that the configuration supports. + Known values are: "CloudBased" and "Manual". + :vartype provisioning_support: Union[str, "ProvisioningSupport"] + :ivar provisioning_details: Provisioning Details for the device. + :vartype provisioning_details: "ProvisioningDetails" + """ + + serialNumber: str + """Device serial number.""" + displaySerialNumber: str + """Device serial number to be displayed.""" + managementResourceId: str + """Management Resource Id.""" + managementResourceTenantId: str + """Management Resource Tenant ID.""" + provisioningSupport: Union[str, "ProvisioningSupport"] + """Determining nature of provisioning that the configuration supports. Known values are: + \"CloudBased\" and \"Manual\".""" + provisioningDetails: "ProvisioningDetails" + """Provisioning Details for the device.""" + + +class DevicePresenceVerificationDetails(TypedDict, total=False): + """Proof of possession details. + + :ivar status: Proof of possession status. Known values are: "NotInitiated" and "Completed". + :vartype status: Union[str, "DevicePresenceVerificationStatus"] + :ivar message: Insights on current status. + :vartype message: str + """ + + status: Union[str, "DevicePresenceVerificationStatus"] + """Proof of possession status. Known values are: \"NotInitiated\" and \"Completed\".""" + message: str + """Insights on current status.""" + + +class Dimensions(TypedDict, total=False): + """Dimensions of a configuration. + + :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: Union[str, "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: Union[str, "WeightMeasurementUnit"] + """ + + length: float + """Length of the device.""" + height: float + """Height of the device.""" + width: float + """Width of the device.""" + lengthHeightUnit: Union[str, "LengthHeightUnit"] + """Unit for the dimensions of length, height and width. Known values are: \"IN\" and \"CM\".""" + weight: float + """Weight of the device.""" + depth: float + """Depth of the device.""" + weightUnit: Union[str, "WeightMeasurementUnit"] + """Unit for the dimensions of weight. Known values are: \"LBS\" and \"KGS\".""" + + +class DisplayInfo(TypedDict, total=False): + """Describes product display information. + + :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 + """ + + productFamilyDisplayName: str + """Product family display name.""" + configurationDisplayName: str + """Configuration display name.""" + + +class EncryptionPreferences(TypedDict, total=False): + """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: Union[str, "DoubleEncryptionStatus"] + """ + + doubleEncryptionStatus: Union[str, "DoubleEncryptionStatus"] + """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\".""" + + +class ErrorAdditionalInfo(TypedDict, total=False): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: Any + """ + + type: str + """The additional info type.""" + info: Any + """The additional info.""" + + +class ErrorDetail(TypedDict, total=False): + """The error detail. + + :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["ErrorDetail"] + :ivar additional_info: The error additional info. + :vartype additional_info: list["ErrorAdditionalInfo"] + """ + + code: str + """The error code.""" + message: str + """The error message.""" + target: str + """The error target.""" + details: list["ErrorDetail"] + """The error details.""" + additionalInfo: list["ErrorAdditionalInfo"] + """The error additional info.""" + + +class ErrorResponse(TypedDict, total=False): + """Error response. + + :ivar error: The error object. + :vartype error: "ErrorDetail" + """ + + error: "ErrorDetail" + """The error object.""" + + +class FilterableProperty(TypedDict, total=False): + """Different types of filters supported and its values. + + :ivar type: Type of product filter. Required. Known values are: "ShipToCountries" and + "DoubleEncryptionStatus". + :vartype type: Union[str, "SupportedFilterTypes"] + :ivar supported_values: Values to be filtered. Required. + :vartype supported_values: list[str] + """ + + type: Required[Union[str, "SupportedFilterTypes"]] + """Type of product filter. Required. Known values are: \"ShipToCountries\" and + \"DoubleEncryptionStatus\".""" + supportedValues: Required[list[str]] + """Values to be filtered. Required.""" + + +class ForwardShippingDetails(TypedDict, total=False): + """Forward shipment details. + + :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 + """ + + carrierName: str + """Name of the carrier.""" + carrierDisplayName: str + """Carrier Name for display purpose. Not to be used for any processing.""" + trackingId: str + """TrackingId of the package.""" + trackingUrl: str + """TrackingUrl of the package.""" + + +class GroupedChildConfigurations(TypedDict, total=False): + """Grouped child configuration object. + + :ivar category_information: Category information. + :vartype category_information: "CategoryInformation" + :ivar child_configurations: List of child configurations. + :vartype child_configurations: list["ChildConfiguration"] + """ + + categoryInformation: "CategoryInformation" + """Category information.""" + childConfigurations: list["ChildConfiguration"] + """List of child configurations.""" + + +class HierarchyInformation(TypedDict, total=False): + """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 + :ivar configuration_id_display_name: Represents Model Display Name. + :vartype configuration_id_display_name: str + """ + + productFamilyName: str + """Represents product family name that uniquely identifies product family.""" + productLineName: str + """Represents product line name that uniquely identifies product line.""" + productName: str + """Represents product name that uniquely identifies product.""" + configurationName: str + """Represents configuration name that uniquely identifies configuration.""" + configurationIdDisplayName: str + """Represents Model Display Name.""" + + +class ImageInformation(TypedDict, total=False): + """Image for the product. + + :ivar image_type: Type of the image. Known values are: "MainImage", "BulletImage", and + "GenericImage". + :vartype image_type: Union[str, "ImageType"] + :ivar image_url: Url of the image. + :vartype image_url: str + """ + + imageType: Union[str, "ImageType"] + """Type of the image. Known values are: \"MainImage\", \"BulletImage\", and \"GenericImage\".""" + imageUrl: str + """Url of the image.""" + + +class Link(TypedDict, total=False): + """Returns link related to the product. + + :ivar link_type: Type of link. Known values are: "Generic", "TermsAndConditions", + "Specification", "Documentation", "KnowMore", "SignUp", and "Discoverable". + :vartype link_type: Union[str, "LinkType"] + :ivar link_url: Url of the link. + :vartype link_url: str + """ + + linkType: Union[str, "LinkType"] + """Type of link. Known values are: \"Generic\", \"TermsAndConditions\", \"Specification\", + \"Documentation\", \"KnowMore\", \"SignUp\", and \"Discoverable\".""" + linkUrl: str + """Url of the link.""" + + +class ManagementResourcePreferences(TypedDict, total=False): + """Management resource preference to link device. + + :ivar preferred_management_resource_id: Customer preferred Management resource ARM ID. + :vartype preferred_management_resource_id: str + """ + + preferredManagementResourceId: str + """Customer preferred Management resource ARM ID.""" + + +class NotificationPreference(TypedDict, total=False): + """Notification preference for a job stage. + + :ivar stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". + :vartype stage_name: Union[str, "NotificationStageName"] + :ivar send_notification: Notification is required or not. Required. + :vartype send_notification: bool + """ + + stageName: Required[Union[str, "NotificationStageName"]] + """Name of the stage. Required. Known values are: \"Shipped\" and \"Delivered\".""" + sendNotification: Required[bool] + """Notification is required or not. Required.""" + + +class Operation(TypedDict, total=False): + """REST API Operation. + + :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 Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: "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: Union[str, "Origin"] + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: Union[str, "ActionType"] + """ + + name: str + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + isDataAction: bool + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: "OperationDisplay" + """Localized display information for this particular operation.""" + origin: Union[str, "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\".""" + actionType: Union[str, "ActionType"] + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + +class OperationDisplay(TypedDict, total=False): + """Localized display information for an operation. + + :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 + """ + + provider: str + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: str + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: str + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: str + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class OrderItemDetails(TypedDict, total=False): + """Order item details. + + :ivar product_details: Represents product details. Required. + :vartype product_details: "ProductDetails" + :ivar order_item_type: Order item type. Required. Known values are: "Purchase", "Rental", and + "External". + :vartype order_item_type: Union[str, "OrderItemType"] + :ivar order_item_mode: Defines the mode of the Order item. Known values are: "Default" and + "DoNotFulfill". + :vartype order_item_mode: Union[str, "OrderMode"] + :ivar site_details: Site Related Details. + :vartype site_details: "SiteDetails" + :ivar current_stage: Current Order item Status. + :vartype current_stage: "StageDetails" + :ivar order_item_stage_history: Order item status history. + :vartype order_item_stage_history: list["StageDetails"] + :ivar preferences: Customer notification Preferences. + :vartype preferences: "Preferences" + :ivar forward_shipping_details: Forward Package Shipping details. + :vartype forward_shipping_details: "ForwardShippingDetails" + :ivar reverse_shipping_details: Reverse Package Shipping details. + :vartype reverse_shipping_details: "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: Union[str, "OrderItemCancellationEnum"] + :ivar deletion_status: Describes whether the order item is deletable or not. Known values are: + "Allowed" and "NotAllowed". + :vartype deletion_status: Union[str, "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: Union[str, "OrderItemReturnEnum"] + :ivar management_rp_details_list: List of parent RP details supported for configuration. + :vartype management_rp_details_list: list["ResourceProviderDetails"] + :ivar error: Top level error for the job. + :vartype error: "ErrorDetail" + """ + + productDetails: Required["ProductDetails"] + """Represents product details. Required.""" + orderItemType: Required[Union[str, "OrderItemType"]] + """Order item type. Required. Known values are: \"Purchase\", \"Rental\", and \"External\".""" + orderItemMode: Union[str, "OrderMode"] + """Defines the mode of the Order item. Known values are: \"Default\" and \"DoNotFulfill\".""" + siteDetails: "SiteDetails" + """Site Related Details.""" + currentStage: "StageDetails" + """Current Order item Status.""" + orderItemStageHistory: list["StageDetails"] + """Order item status history.""" + preferences: "Preferences" + """Customer notification Preferences.""" + forwardShippingDetails: "ForwardShippingDetails" + """Forward Package Shipping details.""" + reverseShippingDetails: "ReverseShippingDetails" + """Reverse Package Shipping details.""" + notificationEmailList: list[str] + """Additional notification email list.""" + cancellationReason: str + """Cancellation reason.""" + cancellationStatus: Union[str, "OrderItemCancellationEnum"] + """Describes whether the order item is cancellable or not. Known values are: \"Cancellable\", + \"CancellableWithFee\", and \"NotCancellable\".""" + deletionStatus: Union[str, "ActionStatusEnum"] + """Describes whether the order item is deletable or not. Known values are: \"Allowed\" and + \"NotAllowed\".""" + returnReason: str + """Return reason.""" + returnStatus: Union[str, "OrderItemReturnEnum"] + """Describes whether the order item is returnable or not. Known values are: \"Returnable\", + \"ReturnableWithFee\", and \"NotReturnable\".""" + managementRpDetailsList: list["ResourceProviderDetails"] + """List of parent RP details supported for configuration.""" + error: "ErrorDetail" + """Top level error for the job.""" + + +class OrderItemDetailsUpdateParameter(TypedDict, total=False): + """Order item details Patchable Properties. + + :ivar product_details: Represents product details. + :vartype product_details: "ProductDetailsUpdateParameter" + :ivar site_details: Site Related Details. + :vartype site_details: "SiteDetails" + """ + + productDetails: "ProductDetailsUpdateParameter" + """Represents product details.""" + siteDetails: "SiteDetails" + """Site Related Details.""" + + +class OrderItemProperties(TypedDict, total=False): + """Represents order item properties. + + :ivar order_item_details: Represents order item details. Required. + :vartype order_item_details: "OrderItemDetails" + :ivar address_details: Represents shipping and return address for order item. + :vartype address_details: "AddressDetails" + :ivar start_time: Start time of order item. + :vartype start_time: str + :ivar order_id: Id of the order to which order item belongs to. Required. + :vartype order_id: str + :ivar provisioning_state: Provisioning state. Known values are: "Creating", "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: Union[str, "ProvisioningState"] + """ + + orderItemDetails: Required["OrderItemDetails"] + """Represents order item details. Required.""" + addressDetails: "AddressDetails" + """Represents shipping and return address for order item.""" + startTime: str + """Start time of order item.""" + orderId: Required[str] + """Id of the order to which order item belongs to. Required.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state. Known values are: \"Creating\", \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + +class OrderItemResource(TrackedResource): + """Represents order item resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Order item properties. Required. + :vartype properties: "OrderItemProperties" + :ivar identity: Msi identity of the resource. + :vartype identity: "ResourceIdentity" + """ + + properties: Required["OrderItemProperties"] + """Order item properties. Required.""" + identity: "ResourceIdentity" + """Msi identity of the resource.""" + + +class OrderItemUpdateParameter(TypedDict, total=False): + """Updates order item parameters. + + :ivar properties: Order item update properties. + :vartype properties: "OrderItemUpdateProperties" + :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 identity: Msi identity of the resource. + :vartype identity: "ResourceIdentity" + """ + + properties: "OrderItemUpdateProperties" + """Order item update properties.""" + tags: dict[str, str] + """The list of key value pairs that describe the resource. These tags can be used in viewing and + grouping this resource (across resource groups).""" + identity: "ResourceIdentity" + """Msi identity of the resource.""" + + +class OrderItemUpdateProperties(TypedDict, total=False): + """Order item update properties. + + :ivar forward_address: Updates forward shipping address and contact details. + :vartype forward_address: "AddressProperties" + :ivar preferences: Customer preference. + :vartype preferences: "Preferences" + :ivar notification_email_list: Additional notification email list. + :vartype notification_email_list: list[str] + :ivar order_item_details: Represents order item details. + :vartype order_item_details: "OrderItemDetailsUpdateParameter" + """ + + forwardAddress: "AddressProperties" + """Updates forward shipping address and contact details.""" + preferences: "Preferences" + """Customer preference.""" + notificationEmailList: list[str] + """Additional notification email list.""" + orderItemDetails: "OrderItemDetailsUpdateParameter" + """Represents order item details.""" + + +class OrderProperties(TypedDict, total=False): + """Represents order details. + + :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: "StageDetails" + :ivar order_stage_history: Order status history. + :vartype order_stage_history: list["StageDetails"] + :ivar order_mode: Order mode. Known values are: "Default" and "DoNotFulfill". + :vartype order_mode: Union[str, "OrderMode"] + """ + + orderItemIds: list[str] + """List of order item ARM Ids which are part of an order.""" + currentStage: "StageDetails" + """Order current status.""" + orderStageHistory: list["StageDetails"] + """Order status history.""" + orderMode: Union[str, "OrderMode"] + """Order mode. Known values are: \"Default\" and \"DoNotFulfill\".""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + +class OrderResource(ProxyResource): + """Specifies the properties or parameters for an order. Order is a grouping of one or more order + items. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: Order properties. Required. + :vartype properties: "OrderProperties" + """ + + properties: Required["OrderProperties"] + """Order properties. Required.""" + + +class Pav2MeterDetails(TypedDict, total=False): + """Billing type PAV2 meter details. + + :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: Union[str, "ChargingType"] + :ivar meter_guid: Validation status of requested data center and transport. + :vartype meter_guid: str + :ivar billing_type: Represents billing type. Required. PaV2 billing. + :vartype billing_type: Literal[BillingType.PAV2] + """ + + multiplier: float + """Billing unit applicable for Pav2 billing.""" + chargingType: Union[str, "ChargingType"] + """Charging type. Known values are: \"PerOrder\" and \"PerDevice\".""" + meterGuid: str + """Validation status of requested data center and transport.""" + billingType: Required[Literal[BillingType.PAV2]] + """Represents billing type. Required. PaV2 billing.""" + + +class Preferences(TypedDict, total=False): + """Preferences related to the order. + + :ivar notification_preferences: Notification preferences. + :vartype notification_preferences: list["NotificationPreference"] + :ivar transport_preferences: Preferences related to the shipment logistics of the order. + :vartype transport_preferences: "TransportPreferences" + :ivar encryption_preferences: Preferences related to the Encryption. + :vartype encryption_preferences: "EncryptionPreferences" + :ivar management_resource_preferences: Preferences related to the Management resource. + :vartype management_resource_preferences: "ManagementResourcePreferences" + :ivar term_commitment_preferences: Preferences related to the Term commitment. + :vartype term_commitment_preferences: "TermCommitmentPreferences" + """ + + notificationPreferences: list["NotificationPreference"] + """Notification preferences.""" + transportPreferences: "TransportPreferences" + """Preferences related to the shipment logistics of the order.""" + encryptionPreferences: "EncryptionPreferences" + """Preferences related to the Encryption.""" + managementResourcePreferences: "ManagementResourcePreferences" + """Preferences related to the Management resource.""" + termCommitmentPreferences: "TermCommitmentPreferences" + """Preferences related to the Term commitment.""" + + +class Product(TypedDict, total=False): + """Represents a product. + + :ivar properties: Properties of product. + :vartype properties: "ProductProperties" + """ + + properties: "ProductProperties" + """Properties of product.""" + + +class ProductDetails(TypedDict, total=False): + """Represents product details. + + :ivar display_info: Display details of the product. + :vartype display_info: "DisplayInfo" + :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the product. + Required. + :vartype hierarchy_information: "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: Union[str, "DoubleEncryptionStatus"] + :ivar identification_type: Identification type of the configuration. Known values are: + "NotSupported" and "SerialNumber". + :vartype identification_type: Union[str, "IdentificationType"] + :ivar parent_device_details: Device details of the parent configuration. + :vartype parent_device_details: "DeviceDetails" + :ivar parent_provisioning_details: Device Provisioning Details for Parent. + :vartype parent_provisioning_details: "ProvisioningDetails" + :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["AdditionalConfiguration"] + :ivar child_configuration_device_details: Details of all child configurations that are part of + the order item. + :vartype child_configuration_device_details: list["ConfigurationDeviceDetails"] + :ivar term_commitment_information: Term Commitment Information of the Device. + :vartype term_commitment_information: "TermCommitmentInformation" + """ + + displayInfo: "DisplayInfo" + """Display details of the product.""" + hierarchyInformation: Required["HierarchyInformation"] + """Hierarchy of the product which uniquely identifies the product. Required.""" + productDoubleEncryptionStatus: Union[str, "DoubleEncryptionStatus"] + """Double encryption status of the configuration. Read-only field. Known values are: \"Disabled\" + and \"Enabled\".""" + identificationType: Union[str, "IdentificationType"] + """Identification type of the configuration. Known values are: \"NotSupported\" and + \"SerialNumber\".""" + parentDeviceDetails: "DeviceDetails" + """Device details of the parent configuration.""" + parentProvisioningDetails: "ProvisioningDetails" + """Device Provisioning Details for Parent.""" + optInAdditionalConfigurations: list["AdditionalConfiguration"] + """List of additional configurations customer wants in the order item apart from the ones included + in the base configuration.""" + childConfigurationDeviceDetails: list["ConfigurationDeviceDetails"] + """Details of all child configurations that are part of the order item.""" + termCommitmentInformation: "TermCommitmentInformation" + """Term Commitment Information of the Device.""" + + +class ProductDetailsUpdateParameter(TypedDict, total=False): + """Represents product details patchable properties. + + :ivar parent_provisioning_details: Device Provisioning Details for Parent. + :vartype parent_provisioning_details: "ProvisioningDetails" + """ + + parentProvisioningDetails: "ProvisioningDetails" + """Device Provisioning Details for Parent.""" + + +class ProductFamiliesMetadataDetails(TypedDict, total=False): + """Product families metadata details. + + :ivar properties: Product family properties. + :vartype properties: "ProductFamilyProperties" + """ + + properties: "ProductFamilyProperties" + """Product family properties.""" + + +class ProductFamiliesRequest(TypedDict, total=False): + """The filters for showing the product families. + + :ivar filterable_properties: Dictionary of filterable properties on product family. Required. + :vartype filterable_properties: dict[str, list["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: "CustomerSubscriptionDetails" + """ + + filterableProperties: Required[dict[str, list["FilterableProperty"]]] + """Dictionary of filterable properties on product family. Required.""" + customerSubscriptionDetails: "CustomerSubscriptionDetails" + """Customer subscription properties. Clients can display available products to unregistered + customers by explicitly passing subscription details.""" + + +class ProductFamily(TypedDict, total=False): + """Product Family. + + :ivar properties: Properties of product family. + :vartype properties: "ProductFamilyProperties" + """ + + properties: "ProductFamilyProperties" + """Properties of product family.""" + + +class ProductFamilyProperties(CommonProperties): + """Properties of product family. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: "Description" + :ivar image_information: Image information for the product system. + :vartype image_information: list["ImageInformation"] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: "CostInformation" + :ivar availability_information: Availability information of the product system. + :vartype availability_information: "AvailabilityInformation" + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: "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: Union[str, "FulfillmentType"] + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list["FilterableProperty"] + :ivar product_lines: List of product lines supported in the product family. + :vartype product_lines: list["ProductLine"] + :ivar resource_provider_details: Contains details related to resource provider. + :vartype resource_provider_details: list["ResourceProviderDetails"] + """ + + productLines: list["ProductLine"] + """List of product lines supported in the product family.""" + resourceProviderDetails: list["ResourceProviderDetails"] + """Contains details related to resource provider.""" + + +class ProductLine(TypedDict, total=False): + """Product line. + + :ivar properties: Properties of product line. + :vartype properties: "ProductLineProperties" + """ + + properties: "ProductLineProperties" + """Properties of product line.""" + + +class ProductLineProperties(CommonProperties): + """Properties of product line. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: "Description" + :ivar image_information: Image information for the product system. + :vartype image_information: list["ImageInformation"] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: "CostInformation" + :ivar availability_information: Availability information of the product system. + :vartype availability_information: "AvailabilityInformation" + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: "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: Union[str, "FulfillmentType"] + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list["FilterableProperty"] + :ivar products: List of products in the product line. + :vartype products: list["Product"] + """ + + products: list["Product"] + """List of products in the product line.""" + + +class ProductProperties(CommonProperties): + """Properties of product. + + :ivar display_name: Display Name for the product system. + :vartype display_name: str + :ivar description: Description related to the product system. + :vartype description: "Description" + :ivar image_information: Image information for the product system. + :vartype image_information: list["ImageInformation"] + :ivar cost_information: Cost information for the product system. + :vartype cost_information: "CostInformation" + :ivar availability_information: Availability information of the product system. + :vartype availability_information: "AvailabilityInformation" + :ivar hierarchy_information: Hierarchy information of a product. + :vartype hierarchy_information: "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: Union[str, "FulfillmentType"] + :ivar filterable_properties: List of filters supported for a product. + :vartype filterable_properties: list["FilterableProperty"] + :ivar configurations: List of configurations for the product. + :vartype configurations: list["Configuration"] + """ + + configurations: list["Configuration"] + """List of configurations for the product.""" + + +class ProvisioningDetails(TypedDict, total=False): + """Details Related To Provision Resource. + + :ivar quantity: Quantity of the devices. + :vartype quantity: int + :ivar provisioning_arm_id: Provisioning Resource Arm ID. + :vartype provisioning_arm_id: str + :ivar provisioning_end_point: Provisioning End Point. + :vartype provisioning_end_point: str + :ivar serial_number: Serial Number for the Device. + :vartype serial_number: str + :ivar vendor_name: Vendor Name for the Device , (for 1P devices - Microsoft). + :vartype vendor_name: str + :ivar ready_to_connect_arm_id: Arc Enabled Resource Arm id. + :vartype ready_to_connect_arm_id: str + :ivar management_resource_arm_id: Management Resource ArmId. + :vartype management_resource_arm_id: str + :ivar unique_device_identifier: Unique Identity for a Device. + :vartype unique_device_identifier: str + :ivar auto_provisioning_status: Auto Provisioning Details. Known values are: "Enabled" and + "Disabled". + :vartype auto_provisioning_status: Union[str, "AutoProvisioningStatus"] + :ivar device_presence_verification: Proof of possession details. + :vartype device_presence_verification: "DevicePresenceVerificationDetails" + """ + + quantity: int + """Quantity of the devices.""" + provisioningArmId: str + """Provisioning Resource Arm ID.""" + provisioningEndPoint: str + """Provisioning End Point.""" + serialNumber: str + """Serial Number for the Device.""" + vendorName: str + """Vendor Name for the Device , (for 1P devices - Microsoft).""" + readyToConnectArmId: str + """Arc Enabled Resource Arm id.""" + managementResourceArmId: str + """Management Resource ArmId.""" + uniqueDeviceIdentifier: str + """Unique Identity for a Device.""" + autoProvisioningStatus: Union[str, "AutoProvisioningStatus"] + """Auto Provisioning Details. Known values are: \"Enabled\" and \"Disabled\".""" + devicePresenceVerification: "DevicePresenceVerificationDetails" + """Proof of possession details.""" + + +class PurchaseMeterDetails(TypedDict, total=False): + """Billing type Purchase meter details. + + :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: Union[str, "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 + :ivar billing_type: Represents billing type. Required. Purchase billing. + :vartype billing_type: Literal[BillingType.PURCHASE] + """ + + multiplier: float + """Billing unit applicable for Pav2 billing.""" + chargingType: Union[str, "ChargingType"] + """Charging type. Known values are: \"PerOrder\" and \"PerDevice\".""" + productId: str + """Product Id.""" + skuId: str + """Sku Id.""" + termId: str + """Term Id.""" + billingType: Required[Literal[BillingType.PURCHASE]] + """Represents billing type. Required. Purchase billing.""" + + +class ResourceIdentity(TypedDict, total=False): + """Msi identity details of the resource. + + :ivar type: Identity type. + :vartype type: str + :ivar principal_id: Service Principal Id backing the Msi. + :vartype principal_id: str + :ivar tenant_id: Home Tenant Id. + :vartype tenant_id: str + :ivar user_assigned_identities: User Assigned Identities. + :vartype user_assigned_identities: dict[str, "UserAssignedIdentity"] + """ + + type: str + """Identity type.""" + principalId: str + """Service Principal Id backing the Msi.""" + tenantId: str + """Home Tenant Id.""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """User Assigned Identities.""" + + +class ResourceProviderDetails(TypedDict, total=False): + """Management RP details. + + :ivar resource_provider_namespace: Resource provider namespace. + :vartype resource_provider_namespace: str + """ + + resourceProviderNamespace: str + """Resource provider namespace.""" + + +class ReturnOrderItemDetails(TypedDict, total=False): + """Return order item request body. + + :ivar return_address: Customer return address. + :vartype return_address: "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 + """ + + returnAddress: "AddressProperties" + """Customer return address.""" + returnReason: Required[str] + """Return Reason. Required.""" + serviceTag: str + """Service tag (located on the bottom-right corner of the device).""" + shippingBoxRequired: bool + """Shipping Box required.""" + + +class ReverseShippingDetails(TypedDict, total=False): + """Reverse shipment details. + + :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 + """ + + sasKeyForLabel: str + """SAS key to download the reverse shipment label of the package.""" + carrierName: str + """Name of the carrier.""" + carrierDisplayName: str + """Carrier Name for display purpose. Not to be used for any processing.""" + trackingId: str + """TrackingId of the package.""" + trackingUrl: str + """TrackingUrl of the package.""" + + +class ShippingAddress(TypedDict, total=False): + """Shipping address where customer wishes to receive the device. + + :ivar street_address1: Street Address line 1. + :vartype street_address1: str + :ivar street_address2: Street Address line 2. + :vartype street_address2: str + :ivar street_address3: Street Address line 3. + :vartype street_address3: str + :ivar city: Name of the City. + :vartype city: str + :ivar state_or_province: Name of the State or Province. + :vartype state_or_province: str + :ivar country: 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: Union[str, "AddressType"] + """ + + streetAddress1: str + """Street Address line 1.""" + streetAddress2: str + """Street Address line 2.""" + streetAddress3: str + """Street Address line 3.""" + city: str + """Name of the City.""" + stateOrProvince: str + """Name of the State or Province.""" + country: Required[str] + """Name of the Country. Required.""" + postalCode: str + """Postal code.""" + zipExtendedCode: str + """Extended Zip Code.""" + companyName: str + """Name of the company.""" + addressType: Union[str, "AddressType"] + """Type of address. Known values are: \"None\", \"Residential\", and \"Commercial\".""" + + +class SiteDetails(TypedDict, total=False): + """Represents Site Related Details. + + :ivar site_id: Unique Id, Identifying A Site. Required. + :vartype site_id: str + """ + + siteId: Required[str] + """Unique Id, Identifying A Site. Required.""" + + +class Specification(TypedDict, total=False): + """Specification of the configurations. + + :ivar name: Name of the specification. + :vartype name: str + :ivar value: Value of the specification. + :vartype value: str + """ + + name: str + """Name of the specification.""" + value: str + """Value of the specification.""" + + +class StageDetails(TypedDict, total=False): + """Resource stage details. + + :ivar stage_status: Stage status. Known values are: "None", "InProgress", "Succeeded", + "Failed", "Cancelled", and "Cancelling". + :vartype stage_status: Union[str, "StageStatus"] + :ivar stage_name: Stage name. Known values are: "Placed", "InReview", "Confirmed", + "ReadyToShip", "Shipped", "Delivered", "ReadyToSetup", "InUse", "ReturnInitiated", + "ReturnPickedUp", "ReturnedToMicrosoft", "ReturnCompleted", and "Cancelled". + :vartype stage_name: Union[str, "StageName"] + :ivar display_name: Display name of the resource stage. + :vartype display_name: str + :ivar start_time: Stage start time. + :vartype start_time: str + """ + + stageStatus: Union[str, "StageStatus"] + """Stage status. Known values are: \"None\", \"InProgress\", \"Succeeded\", \"Failed\", + \"Cancelled\", and \"Cancelling\".""" + stageName: Union[str, "StageName"] + """Stage name. Known values are: \"Placed\", \"InReview\", \"Confirmed\", \"ReadyToShip\", + \"Shipped\", \"Delivered\", \"ReadyToSetup\", \"InUse\", \"ReturnInitiated\", + \"ReturnPickedUp\", \"ReturnedToMicrosoft\", \"ReturnCompleted\", and \"Cancelled\".""" + displayName: str + """Display name of the resource stage.""" + startTime: str + """Stage start time.""" + + +class SystemData(TypedDict, total=False): + """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: Union[str, "CreatedByType"] + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: str + :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: Union[str, "CreatedByType"] + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class TermCommitmentInformation(TypedDict, total=False): + """Term Commitment Information. + + :ivar term_commitment_type: Term Commitment Type. Required. Known values are: "None", "Trial", + and "Timed". + :vartype term_commitment_type: Union[str, "TermCommitmentType"] + :ivar term_commitment_type_duration: Term Commitment Duration. Currently Supporting P365D, + P1095D. + :vartype term_commitment_type_duration: str + :ivar pending_days_for_term: Number of Days Pending for Term Commitment. + :vartype pending_days_for_term: int + """ + + termCommitmentType: Required[Union[str, "TermCommitmentType"]] + """Term Commitment Type. Required. Known values are: \"None\", \"Trial\", and \"Timed\".""" + termCommitmentTypeDuration: str + """Term Commitment Duration. Currently Supporting P365D, P1095D.""" + pendingDaysForTerm: int + """Number of Days Pending for Term Commitment.""" + + +class TermCommitmentPreferences(TypedDict, total=False): + """Term Commitment preference received from customer. + + :ivar preferred_term_commitment_type: Term Commitment Type. Required. Known values are: "None", + "Trial", and "Timed". + :vartype preferred_term_commitment_type: Union[str, "TermCommitmentType"] + :ivar preferred_term_commitment_duration: Customer preferred Term Duration. + :vartype preferred_term_commitment_duration: str + """ + + preferredTermCommitmentType: Required[Union[str, "TermCommitmentType"]] + """Term Commitment Type. Required. Known values are: \"None\", \"Trial\", and \"Timed\".""" + preferredTermCommitmentDuration: str + """Customer preferred Term Duration.""" + + +class TermTypeDetails(TypedDict, total=False): + """Holds details about term type and duration. + + :ivar term_type: Term Commitment Type. Required. Known values are: "None", "Trial", and + "Timed". + :vartype term_type: Union[str, "TermCommitmentType"] + :ivar term_type_duration: Duration for the term type. Required. + :vartype term_type_duration: str + """ + + termType: Required[Union[str, "TermCommitmentType"]] + """Term Commitment Type. Required. Known values are: \"None\", \"Trial\", and \"Timed\".""" + termTypeDuration: Required[str] + """Duration for the term type. Required.""" + + +class TransportPreferences(TypedDict, total=False): + """Preferences related to the shipment logistics of the sku. + + :ivar preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. + Required. Known values are: "CustomerManaged" and "MicrosoftManaged". + :vartype preferred_shipment_type: Union[str, "TransportShipmentTypes"] + """ + + preferredShipmentType: Required[Union[str, "TransportShipmentTypes"]] + """Indicates Shipment Logistics type that the customer preferred. Required. Known values are: + \"CustomerManaged\" and \"MicrosoftManaged\".""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" + + +MeterDetails = Union[Pav2MeterDetails, PurchaseMeterDetails] 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 index a4750c91be8d..fcb572b7a2a8 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/cancel_order_item.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/cancel_order_item.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,16 +27,16 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - client.cancel_order_item( - order_item_name="TestOrderItemName3", + client.order_items.cancel( resource_group_name="YourResourceGroupName", + order_item_name="TestOrderItemName3", cancellation_reason={"reason": "Order cancelled"}, ) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CancelOrderItem.json +# x-ms-original-file: 2024-02-01/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 index 49ccd2aac278..2eeb87f229bd 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_address.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_address.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,15 +27,16 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.begin_create_address( - address_name="TestAddressName2", + response = client.addresses.begin_create( resource_group_name="YourResourceGroupName", + address_name="TestAddressName2", address_resource={ "location": "eastus", "properties": { + "addressClassification": "Shipping", "contactDetails": { "contactName": "XXXX XXXX", "emailList": ["xxxx@xxxx.xxx"], @@ -58,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CreateAddress.json +# x-ms-original-file: 2024-02-01/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 index db06228292e5..d7fcc05c0160 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_order_item.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_order_item.py @@ -1,8 +1,9 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,12 +28,12 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.begin_create_order_item( - order_item_name="TestOrderItemName2", + response = client.order_items.begin_create( resource_group_name="YourResourceGroupName", + order_item_name="TestOrderItemName2", order_item_resource={ "location": "eastus", "properties": { @@ -56,7 +57,7 @@ def main(): }, } }, - "orderId": "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2", + "orderId": "/subscriptions/eb5dc900-6186-49d8-b7d7-febd866fdc1d/resourceGroups/YourResourceGroupName/providers/Microsoft.EdgeOrder/locations/eastus/orders/TestOrderName2", "orderItemDetails": { "orderItemType": "Purchase", "preferences": {"transportPreferences": {"preferredShipmentType": "MicrosoftManaged"}}, @@ -75,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CreateOrderItem.json +# x-ms-original-file: 2024-02-01/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 index b46f5823b729..afbd9adc711b 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,15 +27,15 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - client.begin_delete_address_by_name( - address_name="TestAddressName1", + client.addresses.begin_delete( resource_group_name="YourResourceGroupName", + address_name="TestAddressName1", ).result() -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteAddressByName.json +# x-ms-original-file: 2024-02-01/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 index e58f9397efb7..c366b0ec5087 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,15 +27,15 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - client.begin_delete_order_item_by_name( - order_item_name="TestOrderItemName3", + client.order_items.begin_delete( resource_group_name="YourResourceGroupName", + order_item_name="TestOrderItemName3", ).result() -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteOrderItemByName.json +# x-ms-original-file: 2024-02-01/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 index b840f49ed598..d3a9e9863a37 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,16 +27,16 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.get_address_by_name( - address_name="TestAddressName1", + response = client.addresses.get( resource_group_name="YourResourceGroupName", + address_name="TestAddressName1", ) print(response) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetAddressByName.json +# x-ms-original-file: 2024-02-01/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 index a90f586ec7cf..e75d4504e0dd 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,17 +27,17 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.get_order_by_name( - order_name="TestOrderName3", + response = client.orders.get( resource_group_name="YourResourceGroupName", location="eastus", + order_name="TestOrderName3", ) print(response) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetOrderByName.json +# x-ms-original-file: 2024-02-01/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 index 4e40069d6b83..67daf01682ae 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,16 +27,16 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.get_order_item_by_name( - order_item_name="TestOrderItemName1", + response = client.order_items.get( resource_group_name="YourResourceGroupName", + order_item_name="TestOrderItemName1", ) print(response) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/GetOrderItemByName.json +# x-ms-original-file: 2024-02-01/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 index 836564b56ac6..bfa81873f27e 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,16 +27,16 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.list_addresses_at_resource_group_level( + response = client.addresses.list_by_resource_group( 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 +# x-ms-original-file: 2024-02-01/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 index b92994338c93..fe12fd15e3d0 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,14 +27,14 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.list_addresses_at_subscription_level() + response = client.addresses.list_by_subscription() for item in response: print(item) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListAddressesAtSubscriptionLevel.json +# x-ms-original-file: 2024-02-01/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 index b3b33363334f..d63b2ee26f90 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_configurations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_configurations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,27 +27,25 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.list_configurations( + response = client.products_and_configurations.list_configurations( configurations_request={ - "configurationFilters": [ - { - "filterableProperty": [{"supportedValues": ["US"], "type": "ShipToCountries"}], - "hierarchyInformation": { - "productFamilyName": "azurestackedge", - "productLineName": "azurestackedge", - "productName": "azurestackedgegpu", - }, - } - ] + "configurationFilter": { + "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 +# x-ms-original-file: 2024-02-01/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 index 1cb12208f727..9d0f74fed7e5 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_operations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -30,11 +30,11 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.list_operations() + response = client.operations.list() for item in response: print(item) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOperations.json +# x-ms-original-file: 2024-02-01/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 index e4a5b595cd89..e2865cbf31e6 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,16 +27,16 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.list_order_at_resource_group_level( + response = client.orders.list_by_resource_group( 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 +# x-ms-original-file: 2024-02-01/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 index ba5a88c171e8..39cad4535c45 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,14 +27,14 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.list_order_at_subscription_level() + response = client.orders.list_by_subscription() for item in response: print(item) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOrderAtSubscriptionLevel.json +# x-ms-original-file: 2024-02-01/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 index a8b07983bfd1..8da8011dae7a 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,16 +27,16 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.list_order_items_at_resource_group_level( + response = client.order_items.list_by_resource_group( 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 +# x-ms-original-file: 2024-02-01/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 index 63aa57d2d7a7..49b1c22d6f88 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,14 +27,14 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.list_order_items_at_subscription_level() + response = client.order_items.list_by_subscription() for item in response: print(item) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListOrderItemsAtSubscriptionLevel.json +# x-ms-original-file: 2024-02-01/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 index f50795ca837e..9bd6b35f4dfb 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_product_families.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_product_families.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,10 +27,10 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.list_product_families( + response = client.products_and_configurations.list_product_families( product_families_request={ "filterableProperties": {"azurestackedge": [{"supportedValues": ["US"], "type": "ShipToCountries"}]} }, @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ListProductFamilies.json +# x-ms-original-file: 2024-02-01/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 index 819b90d502cd..02676db07e72 100644 --- 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 @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,14 +27,14 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.list_product_families_metadata() + response = client.products_and_configurations.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 +# x-ms-original-file: 2024-02-01/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 index 04ec971ac22c..50e1408a29cf 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/return_order_item.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/return_order_item.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,16 +27,16 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - client.begin_return_order_item( - order_item_name="TestOrderName4", + client.order_items.begin_return_method( resource_group_name="YourResourceGroupName", + order_item_name="TestOrderName4", return_order_item_details={"returnReason": "Order returned"}, ).result() -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ReturnOrderItem.json +# x-ms-original-file: 2024-02-01/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 index 5b062f78f288..355e04b06f75 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_address.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_address.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,12 +27,12 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.begin_update_address( - address_name="TestAddressName2", + response = client.addresses.begin_update( resource_group_name="YourResourceGroupName", + address_name="TestAddressName2", address_update_parameter={ "properties": { "contactDetails": { @@ -58,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/UpdateAddress.json +# x-ms-original-file: 2024-02-01/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 index 06492c46b840..7f68440cafd6 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_order_item.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_order_item.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,12 +27,12 @@ def main(): client = EdgeOrderManagementClient( credential=DefaultAzureCredential(), - subscription_id="YourSubscriptionId", + subscription_id="SUBSCRIPTION_ID", ) - response = client.begin_update_order_item( - order_item_name="TestOrderItemName3", + response = client.order_items.begin_update( resource_group_name="YourResourceGroupName", + order_item_name="TestOrderItemName3", order_item_update_parameter={ "properties": {"preferences": {"transportPreferences": {"preferredShipmentType": "CustomerManaged"}}} }, @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/UpdateOrderItem.json +# x-ms-original-file: 2024-02-01/UpdateOrderItem.json if __name__ == "__main__": main() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/conftest.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/conftest.py index 6437dcff6284..a2f409a55a88 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/conftest.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/conftest.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): edgeordermanagement_subscription_id = os.environ.get( diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management.py deleted file mode 100644 index 8749498417a5..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management.py +++ /dev/null @@ -1,526 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.edgeorder import EdgeOrderManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestEdgeOrderManagement(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(EdgeOrderManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_operations(self, resource_group): - response = self.client.list_operations( - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_addresses_at_subscription_level(self, resource_group): - response = self.client.list_addresses_at_subscription_level( - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_product_families(self, resource_group): - response = self.client.list_product_families( - product_families_request={ - "filterableProperties": {"str": [{"supportedValues": ["str"], "type": "str"}]}, - "customerSubscriptionDetails": { - "quotaId": "str", - "locationPlacementId": "str", - "registeredFeatures": [{"name": "str", "state": "str"}], - }, - }, - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_configurations(self, resource_group): - response = self.client.list_configurations( - configurations_request={ - "configurationFilters": [ - { - "hierarchyInformation": { - "configurationName": "str", - "productFamilyName": "str", - "productLineName": "str", - "productName": "str", - }, - "filterableProperty": [{"supportedValues": ["str"], "type": "str"}], - } - ], - "customerSubscriptionDetails": { - "quotaId": "str", - "locationPlacementId": "str", - "registeredFeatures": [{"name": "str", "state": "str"}], - }, - }, - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_product_families_metadata(self, resource_group): - response = self.client.list_product_families_metadata( - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_order_at_subscription_level(self, resource_group): - response = self.client.list_order_at_subscription_level( - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_order_items_at_subscription_level(self, resource_group): - response = self.client.list_order_items_at_subscription_level( - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_addresses_at_resource_group_level(self, resource_group): - response = self.client.list_addresses_at_resource_group_level( - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get_address_by_name(self, resource_group): - response = self.client.get_address_by_name( - address_name="str", - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create_address(self, resource_group): - response = self.client.begin_create_address( - address_name="str", - resource_group_name=resource_group.name, - address_resource={ - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "location": "str", - "addressValidationStatus": "str", - "id": "str", - "name": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2021-12-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete_address_by_name(self, resource_group): - response = self.client.begin_delete_address_by_name( - address_name="str", - resource_group_name=resource_group.name, - api_version="2021-12-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_update_address(self, resource_group): - response = self.client.begin_update_address( - address_name="str", - resource_group_name=resource_group.name, - address_update_parameter={ - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - "tags": {"str": "str"}, - }, - api_version="2021-12-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_order_at_resource_group_level(self, resource_group): - response = self.client.list_order_at_resource_group_level( - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get_order_by_name(self, resource_group): - response = self.client.get_order_by_name( - order_name="str", - resource_group_name=resource_group.name, - location="str", - api_version="2021-12-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_order_items_at_resource_group_level(self, resource_group): - response = self.client.list_order_items_at_resource_group_level( - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get_order_item_by_name(self, resource_group): - response = self.client.get_order_item_by_name( - order_item_name="str", - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create_order_item(self, resource_group): - response = self.client.begin_create_order_item( - order_item_name="str", - resource_group_name=resource_group.name, - order_item_resource={ - "addressDetails": { - "forwardAddress": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "addressValidationStatus": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - }, - "returnAddress": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "addressValidationStatus": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - }, - }, - "location": "str", - "orderId": "str", - "orderItemDetails": { - "orderItemType": "str", - "productDetails": { - "hierarchyInformation": { - "configurationName": "str", - "productFamilyName": "str", - "productLineName": "str", - "productName": "str", - }, - "count": 0, - "deviceDetails": [ - {"managementResourceId": "str", "managementResourceTenantId": "str", "serialNumber": "str"} - ], - "displayInfo": {"configurationDisplayName": "str", "productFamilyDisplayName": "str"}, - "productDoubleEncryptionStatus": "str", - }, - "cancellationReason": "str", - "cancellationStatus": "str", - "currentStage": { - "displayName": "str", - "stageName": "str", - "stageStatus": "str", - "startTime": "2020-02-20 00:00:00", - }, - "deletionStatus": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "forwardShippingDetails": { - "carrierDisplayName": "str", - "carrierName": "str", - "trackingId": "str", - "trackingUrl": "str", - }, - "managementRpDetails": {"resourceProviderNamespace": "str"}, - "managementRpDetailsList": [{"resourceProviderNamespace": "str"}], - "notificationEmailList": ["str"], - "orderItemStageHistory": [ - { - "displayName": "str", - "stageName": "str", - "stageStatus": "str", - "startTime": "2020-02-20 00:00:00", - } - ], - "preferences": { - "encryptionPreferences": {"doubleEncryptionStatus": "str"}, - "managementResourcePreferences": {"preferredManagementResourceId": "str"}, - "notificationPreferences": [{"sendNotification": bool, "stageName": "str"}], - "transportPreferences": {"preferredShipmentType": "str"}, - }, - "returnReason": "str", - "returnStatus": "str", - "reverseShippingDetails": { - "carrierDisplayName": "str", - "carrierName": "str", - "sasKeyForLabel": "str", - "trackingId": "str", - "trackingUrl": "str", - }, - }, - "id": "str", - "name": "str", - "startTime": "2020-02-20 00:00:00", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2021-12-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete_order_item_by_name(self, resource_group): - response = self.client.begin_delete_order_item_by_name( - order_item_name="str", - resource_group_name=resource_group.name, - api_version="2021-12-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_update_order_item(self, resource_group): - response = self.client.begin_update_order_item( - order_item_name="str", - resource_group_name=resource_group.name, - order_item_update_parameter={ - "forwardAddress": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "addressValidationStatus": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - }, - "notificationEmailList": ["str"], - "preferences": { - "encryptionPreferences": {"doubleEncryptionStatus": "str"}, - "managementResourcePreferences": {"preferredManagementResourceId": "str"}, - "notificationPreferences": [{"sendNotification": bool, "stageName": "str"}], - "transportPreferences": {"preferredShipmentType": "str"}, - }, - "tags": {"str": "str"}, - }, - api_version="2021-12-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cancel_order_item(self, resource_group): - response = self.client.cancel_order_item( - order_item_name="str", - resource_group_name=resource_group.name, - cancellation_reason={"reason": "str"}, - api_version="2021-12-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_return_order_item(self, resource_group): - response = self.client.begin_return_order_item( - order_item_name="str", - resource_group_name=resource_group.name, - return_order_item_details={ - "returnReason": "str", - "returnAddress": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "addressValidationStatus": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - }, - "serviceTag": "str", - "shippingBoxRequired": False, - }, - api_version="2021-12-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_addresses_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_addresses_operations.py new file mode 100644 index 000000000000..98cef238c779 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_addresses_operations.py @@ -0,0 +1,144 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementAddressesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_addresses_get(self, resource_group): + response = self.client.addresses.get( + resource_group_name=resource_group.name, + address_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_addresses_begin_create(self, resource_group): + response = self.client.addresses.begin_create( + resource_group_name=resource_group.name, + address_name="str", + address_resource={ + "location": "str", + "properties": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_addresses_begin_update(self, resource_group): + response = self.client.addresses.begin_update( + resource_group_name=resource_group.name, + address_name="str", + address_update_parameter={ + "properties": { + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_addresses_begin_delete(self, resource_group): + response = self.client.addresses.begin_delete( + resource_group_name=resource_group.name, + address_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_addresses_list_by_resource_group(self, resource_group): + response = self.client.addresses.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_addresses_list_by_subscription(self, resource_group): + response = self.client.addresses.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_addresses_operations_async.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_addresses_operations_async.py new file mode 100644 index 000000000000..f60389d057bf --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_addresses_operations_async.py @@ -0,0 +1,151 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder.aio import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementAddressesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_addresses_get(self, resource_group): + response = await self.client.addresses.get( + resource_group_name=resource_group.name, + address_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_addresses_begin_create(self, resource_group): + response = await ( + await self.client.addresses.begin_create( + resource_group_name=resource_group.name, + address_name="str", + address_resource={ + "location": "str", + "properties": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_addresses_begin_update(self, resource_group): + response = await ( + await self.client.addresses.begin_update( + resource_group_name=resource_group.name, + address_name="str", + address_update_parameter={ + "properties": { + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_addresses_begin_delete(self, resource_group): + response = await ( + await self.client.addresses.begin_delete( + resource_group_name=resource_group.name, + address_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_addresses_list_by_resource_group(self, resource_group): + response = self.client.addresses.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_addresses_list_by_subscription(self, resource_group): + response = self.client.addresses.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_async.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_async.py deleted file mode 100644 index 480370133205..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_async.py +++ /dev/null @@ -1,545 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.edgeorder.aio import EdgeOrderManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestEdgeOrderManagementAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(EdgeOrderManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_operations(self, resource_group): - response = self.client.list_operations( - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_addresses_at_subscription_level(self, resource_group): - response = self.client.list_addresses_at_subscription_level( - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_product_families(self, resource_group): - response = self.client.list_product_families( - product_families_request={ - "filterableProperties": {"str": [{"supportedValues": ["str"], "type": "str"}]}, - "customerSubscriptionDetails": { - "quotaId": "str", - "locationPlacementId": "str", - "registeredFeatures": [{"name": "str", "state": "str"}], - }, - }, - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_configurations(self, resource_group): - response = self.client.list_configurations( - configurations_request={ - "configurationFilters": [ - { - "hierarchyInformation": { - "configurationName": "str", - "productFamilyName": "str", - "productLineName": "str", - "productName": "str", - }, - "filterableProperty": [{"supportedValues": ["str"], "type": "str"}], - } - ], - "customerSubscriptionDetails": { - "quotaId": "str", - "locationPlacementId": "str", - "registeredFeatures": [{"name": "str", "state": "str"}], - }, - }, - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_product_families_metadata(self, resource_group): - response = self.client.list_product_families_metadata( - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_order_at_subscription_level(self, resource_group): - response = self.client.list_order_at_subscription_level( - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_order_items_at_subscription_level(self, resource_group): - response = self.client.list_order_items_at_subscription_level( - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_addresses_at_resource_group_level(self, resource_group): - response = self.client.list_addresses_at_resource_group_level( - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get_address_by_name(self, resource_group): - response = await self.client.get_address_by_name( - address_name="str", - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create_address(self, resource_group): - response = await ( - await self.client.begin_create_address( - address_name="str", - resource_group_name=resource_group.name, - address_resource={ - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "location": "str", - "addressValidationStatus": "str", - "id": "str", - "name": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2021-12-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_delete_address_by_name(self, resource_group): - response = await ( - await self.client.begin_delete_address_by_name( - address_name="str", - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_update_address(self, resource_group): - response = await ( - await self.client.begin_update_address( - address_name="str", - resource_group_name=resource_group.name, - address_update_parameter={ - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - "tags": {"str": "str"}, - }, - api_version="2021-12-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_order_at_resource_group_level(self, resource_group): - response = self.client.list_order_at_resource_group_level( - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get_order_by_name(self, resource_group): - response = await self.client.get_order_by_name( - order_name="str", - resource_group_name=resource_group.name, - location="str", - api_version="2021-12-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_order_items_at_resource_group_level(self, resource_group): - response = self.client.list_order_items_at_resource_group_level( - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get_order_item_by_name(self, resource_group): - response = await self.client.get_order_item_by_name( - order_item_name="str", - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create_order_item(self, resource_group): - response = await ( - await self.client.begin_create_order_item( - order_item_name="str", - resource_group_name=resource_group.name, - order_item_resource={ - "addressDetails": { - "forwardAddress": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "addressValidationStatus": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - }, - "returnAddress": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "addressValidationStatus": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - }, - }, - "location": "str", - "orderId": "str", - "orderItemDetails": { - "orderItemType": "str", - "productDetails": { - "hierarchyInformation": { - "configurationName": "str", - "productFamilyName": "str", - "productLineName": "str", - "productName": "str", - }, - "count": 0, - "deviceDetails": [ - { - "managementResourceId": "str", - "managementResourceTenantId": "str", - "serialNumber": "str", - } - ], - "displayInfo": {"configurationDisplayName": "str", "productFamilyDisplayName": "str"}, - "productDoubleEncryptionStatus": "str", - }, - "cancellationReason": "str", - "cancellationStatus": "str", - "currentStage": { - "displayName": "str", - "stageName": "str", - "stageStatus": "str", - "startTime": "2020-02-20 00:00:00", - }, - "deletionStatus": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "forwardShippingDetails": { - "carrierDisplayName": "str", - "carrierName": "str", - "trackingId": "str", - "trackingUrl": "str", - }, - "managementRpDetails": {"resourceProviderNamespace": "str"}, - "managementRpDetailsList": [{"resourceProviderNamespace": "str"}], - "notificationEmailList": ["str"], - "orderItemStageHistory": [ - { - "displayName": "str", - "stageName": "str", - "stageStatus": "str", - "startTime": "2020-02-20 00:00:00", - } - ], - "preferences": { - "encryptionPreferences": {"doubleEncryptionStatus": "str"}, - "managementResourcePreferences": {"preferredManagementResourceId": "str"}, - "notificationPreferences": [{"sendNotification": bool, "stageName": "str"}], - "transportPreferences": {"preferredShipmentType": "str"}, - }, - "returnReason": "str", - "returnStatus": "str", - "reverseShippingDetails": { - "carrierDisplayName": "str", - "carrierName": "str", - "sasKeyForLabel": "str", - "trackingId": "str", - "trackingUrl": "str", - }, - }, - "id": "str", - "name": "str", - "startTime": "2020-02-20 00:00:00", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2021-12-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_delete_order_item_by_name(self, resource_group): - response = await ( - await self.client.begin_delete_order_item_by_name( - order_item_name="str", - resource_group_name=resource_group.name, - api_version="2021-12-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_update_order_item(self, resource_group): - response = await ( - await self.client.begin_update_order_item( - order_item_name="str", - resource_group_name=resource_group.name, - order_item_update_parameter={ - "forwardAddress": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "addressValidationStatus": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - }, - "notificationEmailList": ["str"], - "preferences": { - "encryptionPreferences": {"doubleEncryptionStatus": "str"}, - "managementResourcePreferences": {"preferredManagementResourceId": "str"}, - "notificationPreferences": [{"sendNotification": bool, "stageName": "str"}], - "transportPreferences": {"preferredShipmentType": "str"}, - }, - "tags": {"str": "str"}, - }, - api_version="2021-12-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cancel_order_item(self, resource_group): - response = await self.client.cancel_order_item( - order_item_name="str", - resource_group_name=resource_group.name, - cancellation_reason={"reason": "str"}, - api_version="2021-12-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_return_order_item(self, resource_group): - response = await ( - await self.client.begin_return_order_item( - order_item_name="str", - resource_group_name=resource_group.name, - return_order_item_details={ - "returnReason": "str", - "returnAddress": { - "contactDetails": { - "contactName": "str", - "emailList": ["str"], - "phone": "str", - "mobile": "str", - "phoneExtension": "str", - }, - "addressValidationStatus": "str", - "shippingAddress": { - "country": "str", - "streetAddress1": "str", - "addressType": "str", - "city": "str", - "companyName": "str", - "postalCode": "str", - "stateOrProvince": "str", - "streetAddress2": "str", - "streetAddress3": "str", - "zipExtendedCode": "str", - }, - }, - "serviceTag": "str", - "shippingBoxRequired": False, - }, - api_version="2021-12-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_operations.py new file mode 100644 index 000000000000..a60fe5044f43 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_operations.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_operations_async.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_operations_async.py new file mode 100644 index 000000000000..7a18ee631859 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_operations_async.py @@ -0,0 +1,28 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder.aio import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_order_items_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_order_items_operations.py new file mode 100644 index 000000000000..30a9dc5068dd --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_order_items_operations.py @@ -0,0 +1,445 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementOrderItemsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_order_items_get(self, resource_group): + response = self.client.order_items.get( + resource_group_name=resource_group.name, + order_item_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_order_items_begin_create(self, resource_group): + response = self.client.order_items.begin_create( + resource_group_name=resource_group.name, + order_item_name="str", + order_item_resource={ + "location": "str", + "properties": { + "orderId": "str", + "orderItemDetails": { + "orderItemType": "str", + "productDetails": { + "hierarchyInformation": { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + }, + "childConfigurationDeviceDetails": [ + { + "deviceDetails": [ + { + "displaySerialNumber": "str", + "managementResourceId": "str", + "managementResourceTenantId": "str", + "provisioningDetails": { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + }, + "provisioningSupport": "str", + "serialNumber": "str", + } + ], + "displayInfo": { + "configurationDisplayName": "str", + "productFamilyDisplayName": "str", + }, + "hierarchyInformation": { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + }, + "identificationType": "str", + "quantity": 0, + "termCommitmentInformation": { + "termCommitmentType": "str", + "pendingDaysForTerm": 0, + "termCommitmentTypeDuration": "1 day, 0:00:00", + }, + } + ], + "displayInfo": {"configurationDisplayName": "str", "productFamilyDisplayName": "str"}, + "identificationType": "str", + "optInAdditionalConfigurations": [ + { + "hierarchyInformation": { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + }, + "quantity": 0, + "provisioningDetails": [ + { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + } + ], + } + ], + "parentDeviceDetails": { + "displaySerialNumber": "str", + "managementResourceId": "str", + "managementResourceTenantId": "str", + "provisioningDetails": { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + }, + "provisioningSupport": "str", + "serialNumber": "str", + }, + "parentProvisioningDetails": { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + }, + "productDoubleEncryptionStatus": "str", + "termCommitmentInformation": { + "termCommitmentType": "str", + "pendingDaysForTerm": 0, + "termCommitmentTypeDuration": "1 day, 0:00:00", + }, + }, + "cancellationReason": "str", + "cancellationStatus": "str", + "currentStage": { + "displayName": "str", + "stageName": "str", + "stageStatus": "str", + "startTime": "2020-02-20 00:00:00", + }, + "deletionStatus": "str", + "error": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + }, + "forwardShippingDetails": { + "carrierDisplayName": "str", + "carrierName": "str", + "trackingId": "str", + "trackingUrl": "str", + }, + "managementRpDetailsList": [{"resourceProviderNamespace": "str"}], + "notificationEmailList": ["str"], + "orderItemMode": "str", + "orderItemStageHistory": [ + { + "displayName": "str", + "stageName": "str", + "stageStatus": "str", + "startTime": "2020-02-20 00:00:00", + } + ], + "preferences": { + "encryptionPreferences": {"doubleEncryptionStatus": "str"}, + "managementResourcePreferences": {"preferredManagementResourceId": "str"}, + "notificationPreferences": [{"sendNotification": bool, "stageName": "str"}], + "termCommitmentPreferences": { + "preferredTermCommitmentType": "str", + "preferredTermCommitmentDuration": "1 day, 0:00:00", + }, + "transportPreferences": {"preferredShipmentType": "str"}, + }, + "returnReason": "str", + "returnStatus": "str", + "reverseShippingDetails": { + "carrierDisplayName": "str", + "carrierName": "str", + "sasKeyForLabel": "str", + "trackingId": "str", + "trackingUrl": "str", + }, + "siteDetails": {"siteId": "str"}, + }, + "addressDetails": { + "forwardAddress": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "returnAddress": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + }, + "provisioningState": "str", + "startTime": "2020-02-20 00:00:00", + }, + "id": "str", + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_order_items_begin_update(self, resource_group): + response = self.client.order_items.begin_update( + resource_group_name=resource_group.name, + order_item_name="str", + order_item_update_parameter={ + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "forwardAddress": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "notificationEmailList": ["str"], + "orderItemDetails": { + "productDetails": { + "parentProvisioningDetails": { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + } + }, + "siteDetails": {"siteId": "str"}, + }, + "preferences": { + "encryptionPreferences": {"doubleEncryptionStatus": "str"}, + "managementResourcePreferences": {"preferredManagementResourceId": "str"}, + "notificationPreferences": [{"sendNotification": bool, "stageName": "str"}], + "termCommitmentPreferences": { + "preferredTermCommitmentType": "str", + "preferredTermCommitmentDuration": "1 day, 0:00:00", + }, + "transportPreferences": {"preferredShipmentType": "str"}, + }, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_order_items_begin_delete(self, resource_group): + response = self.client.order_items.begin_delete( + resource_group_name=resource_group.name, + order_item_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_order_items_list_by_resource_group(self, resource_group): + response = self.client.order_items.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_order_items_list_by_subscription(self, resource_group): + response = self.client.order_items.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_order_items_cancel(self, resource_group): + response = self.client.order_items.cancel( + resource_group_name=resource_group.name, + order_item_name="str", + cancellation_reason={"reason": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_order_items_begin_return_method(self, resource_group): + response = self.client.order_items.begin_return_method( + resource_group_name=resource_group.name, + order_item_name="str", + return_order_item_details={ + "returnReason": "str", + "returnAddress": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "serviceTag": "str", + "shippingBoxRequired": bool, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_order_items_operations_async.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_order_items_operations_async.py new file mode 100644 index 000000000000..a67b789b6f67 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_order_items_operations_async.py @@ -0,0 +1,454 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder.aio import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementOrderItemsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_order_items_get(self, resource_group): + response = await self.client.order_items.get( + resource_group_name=resource_group.name, + order_item_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_order_items_begin_create(self, resource_group): + response = await ( + await self.client.order_items.begin_create( + resource_group_name=resource_group.name, + order_item_name="str", + order_item_resource={ + "location": "str", + "properties": { + "orderId": "str", + "orderItemDetails": { + "orderItemType": "str", + "productDetails": { + "hierarchyInformation": { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + }, + "childConfigurationDeviceDetails": [ + { + "deviceDetails": [ + { + "displaySerialNumber": "str", + "managementResourceId": "str", + "managementResourceTenantId": "str", + "provisioningDetails": { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + }, + "provisioningSupport": "str", + "serialNumber": "str", + } + ], + "displayInfo": { + "configurationDisplayName": "str", + "productFamilyDisplayName": "str", + }, + "hierarchyInformation": { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + }, + "identificationType": "str", + "quantity": 0, + "termCommitmentInformation": { + "termCommitmentType": "str", + "pendingDaysForTerm": 0, + "termCommitmentTypeDuration": "1 day, 0:00:00", + }, + } + ], + "displayInfo": {"configurationDisplayName": "str", "productFamilyDisplayName": "str"}, + "identificationType": "str", + "optInAdditionalConfigurations": [ + { + "hierarchyInformation": { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + }, + "quantity": 0, + "provisioningDetails": [ + { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + } + ], + } + ], + "parentDeviceDetails": { + "displaySerialNumber": "str", + "managementResourceId": "str", + "managementResourceTenantId": "str", + "provisioningDetails": { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + }, + "provisioningSupport": "str", + "serialNumber": "str", + }, + "parentProvisioningDetails": { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + }, + "productDoubleEncryptionStatus": "str", + "termCommitmentInformation": { + "termCommitmentType": "str", + "pendingDaysForTerm": 0, + "termCommitmentTypeDuration": "1 day, 0:00:00", + }, + }, + "cancellationReason": "str", + "cancellationStatus": "str", + "currentStage": { + "displayName": "str", + "stageName": "str", + "stageStatus": "str", + "startTime": "2020-02-20 00:00:00", + }, + "deletionStatus": "str", + "error": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + }, + "forwardShippingDetails": { + "carrierDisplayName": "str", + "carrierName": "str", + "trackingId": "str", + "trackingUrl": "str", + }, + "managementRpDetailsList": [{"resourceProviderNamespace": "str"}], + "notificationEmailList": ["str"], + "orderItemMode": "str", + "orderItemStageHistory": [ + { + "displayName": "str", + "stageName": "str", + "stageStatus": "str", + "startTime": "2020-02-20 00:00:00", + } + ], + "preferences": { + "encryptionPreferences": {"doubleEncryptionStatus": "str"}, + "managementResourcePreferences": {"preferredManagementResourceId": "str"}, + "notificationPreferences": [{"sendNotification": bool, "stageName": "str"}], + "termCommitmentPreferences": { + "preferredTermCommitmentType": "str", + "preferredTermCommitmentDuration": "1 day, 0:00:00", + }, + "transportPreferences": {"preferredShipmentType": "str"}, + }, + "returnReason": "str", + "returnStatus": "str", + "reverseShippingDetails": { + "carrierDisplayName": "str", + "carrierName": "str", + "sasKeyForLabel": "str", + "trackingId": "str", + "trackingUrl": "str", + }, + "siteDetails": {"siteId": "str"}, + }, + "addressDetails": { + "forwardAddress": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "returnAddress": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + }, + "provisioningState": "str", + "startTime": "2020-02-20 00:00:00", + }, + "id": "str", + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_order_items_begin_update(self, resource_group): + response = await ( + await self.client.order_items.begin_update( + resource_group_name=resource_group.name, + order_item_name="str", + order_item_update_parameter={ + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "forwardAddress": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "notificationEmailList": ["str"], + "orderItemDetails": { + "productDetails": { + "parentProvisioningDetails": { + "autoProvisioningStatus": "str", + "devicePresenceVerification": {"message": "str", "status": "str"}, + "managementResourceArmId": "str", + "provisioningArmId": "str", + "provisioningEndPoint": "str", + "quantity": 0, + "readyToConnectArmId": "str", + "serialNumber": "str", + "uniqueDeviceIdentifier": "str", + "vendorName": "str", + } + }, + "siteDetails": {"siteId": "str"}, + }, + "preferences": { + "encryptionPreferences": {"doubleEncryptionStatus": "str"}, + "managementResourcePreferences": {"preferredManagementResourceId": "str"}, + "notificationPreferences": [{"sendNotification": bool, "stageName": "str"}], + "termCommitmentPreferences": { + "preferredTermCommitmentType": "str", + "preferredTermCommitmentDuration": "1 day, 0:00:00", + }, + "transportPreferences": {"preferredShipmentType": "str"}, + }, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_order_items_begin_delete(self, resource_group): + response = await ( + await self.client.order_items.begin_delete( + resource_group_name=resource_group.name, + order_item_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_order_items_list_by_resource_group(self, resource_group): + response = self.client.order_items.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_order_items_list_by_subscription(self, resource_group): + response = self.client.order_items.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_order_items_cancel(self, resource_group): + response = await self.client.order_items.cancel( + resource_group_name=resource_group.name, + order_item_name="str", + cancellation_reason={"reason": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_order_items_begin_return_method(self, resource_group): + response = await ( + await self.client.order_items.begin_return_method( + resource_group_name=resource_group.name, + order_item_name="str", + return_order_item_details={ + "returnReason": "str", + "returnAddress": { + "addressClassification": "str", + "addressValidationStatus": "str", + "contactDetails": { + "contactName": "str", + "emailList": ["str"], + "mobile": "str", + "phone": "str", + "phoneExtension": "str", + }, + "provisioningState": "str", + "shippingAddress": { + "country": "str", + "addressType": "str", + "city": "str", + "companyName": "str", + "postalCode": "str", + "stateOrProvince": "str", + "streetAddress1": "str", + "streetAddress2": "str", + "streetAddress3": "str", + "zipExtendedCode": "str", + }, + }, + "serviceTag": "str", + "shippingBoxRequired": bool, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_orders_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_orders_operations.py new file mode 100644 index 000000000000..6d89801a6345 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_orders_operations.py @@ -0,0 +1,49 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementOrdersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_orders_get(self, resource_group): + response = self.client.orders.get( + resource_group_name=resource_group.name, + location="str", + order_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_orders_list_by_subscription(self, resource_group): + response = self.client.orders.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_orders_list_by_resource_group(self, resource_group): + response = self.client.orders.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_orders_operations_async.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_orders_operations_async.py new file mode 100644 index 000000000000..fa117e50be85 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_orders_operations_async.py @@ -0,0 +1,50 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder.aio import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementOrdersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_orders_get(self, resource_group): + response = await self.client.orders.get( + resource_group_name=resource_group.name, + location="str", + order_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_orders_list_by_subscription(self, resource_group): + response = self.client.orders.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_orders_list_by_resource_group(self, resource_group): + response = self.client.orders.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_products_and_configurations_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_products_and_configurations_operations.py new file mode 100644 index 000000000000..59b00c41cf0d --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_products_and_configurations_operations.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementProductsAndConfigurationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_products_and_configurations_list_configurations(self, resource_group): + response = self.client.products_and_configurations.list_configurations( + configurations_request={ + "configurationFilter": { + "hierarchyInformation": { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + }, + "childConfigurationFilter": { + "childConfigurationTypes": ["str"], + "hierarchyInformations": [ + { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + } + ], + }, + "filterableProperty": [{"supportedValues": ["str"], "type": "str"}], + }, + "customerSubscriptionDetails": { + "quotaId": "str", + "locationPlacementId": "str", + "registeredFeatures": [{"name": "str", "state": "str"}], + }, + }, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_products_and_configurations_list_product_families(self, resource_group): + response = self.client.products_and_configurations.list_product_families( + product_families_request={ + "filterableProperties": {"str": [{"supportedValues": ["str"], "type": "str"}]}, + "customerSubscriptionDetails": { + "quotaId": "str", + "locationPlacementId": "str", + "registeredFeatures": [{"name": "str", "state": "str"}], + }, + }, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_products_and_configurations_list_product_families_metadata(self, resource_group): + response = self.client.products_and_configurations.list_product_families_metadata() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_products_and_configurations_operations_async.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_products_and_configurations_operations_async.py new file mode 100644 index 000000000000..fb31b8cbc975 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_products_and_configurations_operations_async.py @@ -0,0 +1,83 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.edgeorder.aio import EdgeOrderManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestEdgeOrderManagementProductsAndConfigurationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(EdgeOrderManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_products_and_configurations_list_configurations(self, resource_group): + response = self.client.products_and_configurations.list_configurations( + configurations_request={ + "configurationFilter": { + "hierarchyInformation": { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + }, + "childConfigurationFilter": { + "childConfigurationTypes": ["str"], + "hierarchyInformations": [ + { + "configurationIdDisplayName": "str", + "configurationName": "str", + "productFamilyName": "str", + "productLineName": "str", + "productName": "str", + } + ], + }, + "filterableProperty": [{"supportedValues": ["str"], "type": "str"}], + }, + "customerSubscriptionDetails": { + "quotaId": "str", + "locationPlacementId": "str", + "registeredFeatures": [{"name": "str", "state": "str"}], + }, + }, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_products_and_configurations_list_product_families(self, resource_group): + response = self.client.products_and_configurations.list_product_families( + product_families_request={ + "filterableProperties": {"str": [{"supportedValues": ["str"], "type": "str"}]}, + "customerSubscriptionDetails": { + "quotaId": "str", + "locationPlacementId": "str", + "registeredFeatures": [{"name": "str", "state": "str"}], + }, + }, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_products_and_configurations_list_product_families_metadata(self, resource_group): + response = self.client.products_and_configurations.list_product_families_metadata() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/pyproject.toml b/sdk/edgeorder/azure-mgmt-edgeorder/pyproject.toml index 540da07d41af..4d8ada40e837 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/pyproject.toml +++ b/sdk/edgeorder/azure-mgmt-edgeorder/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-edgeorder" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Edgeorder Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +requires-python = ">=3.10" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.edgeorder._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false pyright = false type_check_samples = false verifytypes = false + +[packaging] +package_name = "azure-mgmt-edgeorder" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Edge Order Management" +package_doc_id = "" +is_stable = false +is_arm = true +title = "EdgeOrderManagementClient" +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/sdk_packaging.toml b/sdk/edgeorder/azure-mgmt-edgeorder/sdk_packaging.toml deleted file mode 100644 index 8f3ee155c64b..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/sdk_packaging.toml +++ /dev/null @@ -1,8 +0,0 @@ -[packaging] -package_name = "azure-mgmt-edgeorder" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Edge Order Management" -package_doc_id = "" -is_stable = true -is_arm = true -title = "EdgeOrderManagementClient" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/setup.py b/sdk/edgeorder/azure-mgmt-edgeorder/setup.py deleted file mode 100644 index d8e8e20c30f7..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/setup.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-edgeorder" -PACKAGE_PPRINT_NAME = "Edge Order Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - ( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py") - ), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", - ], - python_requires=">=3.8", -) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/tsp-location.yaml b/sdk/edgeorder/azure-mgmt-edgeorder/tsp-location.yaml new file mode 100644 index 000000000000..d94cc20e72e1 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/EdgeOrder +commit: 3d1de464b5576fa149aed429795f6030313e31bb +repo: Azure/azure-rest-api-specs +additionalDirectories: From 8b0441d782f19a91cdfde6b6f5cb08b739461653 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 6 Jul 2026 16:33:34 +0800 Subject: [PATCH 2/3] Optimize changelog for azure-mgmt-edgeorder Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-mgmt-edgeorder/CHANGELOG.md | 101 ++++-------------- 1 file changed, 20 insertions(+), 81 deletions(-) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md index 0d17194753a7..c51b02586783 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md +++ b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md @@ -13,8 +13,6 @@ - Client `EdgeOrderManagementClient` added operation group `products_and_configurations` - Model `AddressProperties` added property `address_classification` - Model `AddressProperties` added property `provisioning_state` - - Model `AddressResource` added property `properties` - - Model `AddressUpdateParameter` added property `properties` - Enum `AvailabilityStage` added member `DISCOVERABLE` - Model `BasicInformation` added property `fulfilled_by` - Model `BillingMeterDetails` added property `term_type_details` @@ -24,7 +22,6 @@ - Model `ConfigurationProperties` added property `grouped_child_configurations` - Model `ConfigurationProperties` added property `supported_term_commitment_durations` - Model `ConfigurationProperties` added property `fulfilled_by` - - Model `ConfigurationsRequest` added property `configuration_filter` - Model `DeviceDetails` added property `display_serial_number` - Model `DeviceDetails` added property `provisioning_support` - Model `DeviceDetails` added property `provisioning_details` @@ -32,12 +29,9 @@ - Enum `LinkType` added member `DISCOVERABLE` - Model `OrderItemDetails` added property `order_item_mode` - Model `OrderItemDetails` added property `site_details` - - Model `OrderItemResource` added property `properties` - Model `OrderItemResource` added property `identity` - Enum `OrderItemType` added member `EXTERNAL` - - Model `OrderItemUpdateParameter` added property `properties` - Model `OrderItemUpdateParameter` added property `identity` - - Model `OrderResource` added property `properties` - Model `Preferences` added property `term_commitment_preferences` - Model `ProductDetails` added property `identification_type` - Model `ProductDetails` added property `parent_device_details` @@ -55,7 +49,6 @@ - Model `TrackedResource` added property `system_data` - Added model `AdditionalConfiguration` - Added enum `AddressClassification` - - Added model `AddressUpdateProperties` - Added enum `AutoProvisioningStatus` - Added model `CategoryInformation` - Added model `ChildConfiguration` @@ -63,17 +56,13 @@ - Added model `ChildConfigurationProperties` - Added enum `ChildConfigurationType` - Added model `ConfigurationDeviceDetails` - - Added model `ConfigurationFilter` - Added model `DevicePresenceVerificationDetails` - Added enum `DevicePresenceVerificationStatus` - Added enum `FulfillmentType` - Added model `GroupedChildConfigurations` - Added enum `IdentificationType` - Added model `OrderItemDetailsUpdateParameter` - - Added model `OrderItemProperties` - - Added model `OrderItemUpdateProperties` - Added enum `OrderMode` - - Added model `OrderProperties` - Added model `ProductDetailsUpdateParameter` - Added model `ProvisioningDetails` - Added enum `ProvisioningState` @@ -87,6 +76,7 @@ ### Breaking Changes + - This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration. - Deleted or renamed client method `EdgeOrderManagementClient.begin_create_address` - Deleted or renamed client method `EdgeOrderManagementClient.begin_create_order_item` - Deleted or renamed client method `EdgeOrderManagementClient.begin_delete_address_by_name` @@ -108,78 +98,27 @@ - Deleted or renamed client method `EdgeOrderManagementClient.list_order_items_at_subscription_level` - Deleted or renamed client method `EdgeOrderManagementClient.list_product_families` - Deleted or renamed client method `EdgeOrderManagementClient.list_product_families_metadata` - - Model `AddressResource` deleted or renamed its instance variable `shipping_address` - - Model `AddressResource` deleted or renamed its instance variable `contact_details` - - Model `AddressResource` deleted or renamed its instance variable `address_validation_status` - - Model `AddressUpdateParameter` deleted or renamed its instance variable `shipping_address` - - Model `AddressUpdateParameter` deleted or renamed its instance variable `contact_details` - - Model `Configuration` deleted or renamed its instance variable `display_name` - - Model `Configuration` deleted or renamed its instance variable `description` - - Model `Configuration` deleted or renamed its instance variable `image_information` - - Model `Configuration` deleted or renamed its instance variable `cost_information` - - Model `Configuration` deleted or renamed its instance variable `availability_information` - - Model `Configuration` deleted or renamed its instance variable `hierarchy_information` - - Model `Configuration` deleted or renamed its instance variable `filterable_properties` - - Model `Configuration` deleted or renamed its instance variable `specifications` - - Model `Configuration` deleted or renamed its instance variable `dimensions` - - Model `ConfigurationsRequest` deleted or renamed its instance variable `configuration_filters` - - Model `OrderItemDetails` deleted or renamed its instance variable `management_rp_details` - - Model `OrderItemResource` deleted or renamed its instance variable `order_item_details` - - Model `OrderItemResource` deleted or renamed its instance variable `address_details` - - Model `OrderItemResource` deleted or renamed its instance variable `start_time` - - Model `OrderItemResource` deleted or renamed its instance variable `order_id` - - Model `OrderItemUpdateParameter` deleted or renamed its instance variable `forward_address` - - Model `OrderItemUpdateParameter` deleted or renamed its instance variable `preferences` - - Model `OrderItemUpdateParameter` deleted or renamed its instance variable `notification_email_list` - - Model `OrderResource` deleted or renamed its instance variable `order_item_ids` - - Model `OrderResource` deleted or renamed its instance variable `current_stage` - - Model `OrderResource` deleted or renamed its instance variable `order_stage_history` - - Model `Product` deleted or renamed its instance variable `display_name` - - Model `Product` deleted or renamed its instance variable `description` - - Model `Product` deleted or renamed its instance variable `image_information` - - Model `Product` deleted or renamed its instance variable `cost_information` - - Model `Product` deleted or renamed its instance variable `availability_information` - - Model `Product` deleted or renamed its instance variable `hierarchy_information` - - Model `Product` deleted or renamed its instance variable `filterable_properties` - - Model `Product` deleted or renamed its instance variable `configurations` + - Model `AddressResource` moved instance variable `shipping_address`, `contact_details` and `address_validation_status` under property `properties` whose type is `AddressProperties` + - Model `AddressUpdateParameter` moved instance variable `shipping_address` and `contact_details` under property `properties` whose type is `AddressUpdateProperties` + - Model `Configuration` moved instance variable `display_name`, `description`, `image_information`, `cost_information`, `availability_information`, `hierarchy_information`, `filterable_properties`, `specifications` and `dimensions` under property `properties` whose type is `ConfigurationProperties` + - Model `ConfigurationsRequest` renamed its instance variable `configuration_filters` to `configuration_filter` + - Renamed model `ConfigurationFilters` to `ConfigurationFilter` + - Model `OrderItemDetails` renamed its instance variable `management_rp_details` to `management_rp_details_list` + - Model `OrderItemResource` moved instance variable `order_item_details`, `address_details`, `start_time` and `order_id` under property `properties` whose type is `OrderItemProperties` + - Model `OrderItemUpdateParameter` moved instance variable `forward_address`, `preferences` and `notification_email_list` under property `properties` whose type is `OrderItemUpdateProperties` + - Model `OrderResource` moved instance variable `order_item_ids`, `current_stage` and `order_stage_history` under property `properties` whose type is `OrderProperties` + - Model `Product` moved instance variable `display_name`, `description`, `image_information`, `cost_information`, `availability_information`, `hierarchy_information`, `filterable_properties` and `configurations` under property `properties` whose type is `ProductProperties` - Model `ProductDetails` deleted or renamed its instance variable `count` - Model `ProductDetails` deleted or renamed its instance variable `device_details` - - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `display_name` - - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `description` - - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `image_information` - - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `cost_information` - - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `availability_information` - - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `hierarchy_information` - - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `filterable_properties` - - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `product_lines` - - Model `ProductFamiliesMetadataDetails` deleted or renamed its instance variable `resource_provider_details` - - Model `ProductFamily` deleted or renamed its instance variable `display_name` - - Model `ProductFamily` deleted or renamed its instance variable `description` - - Model `ProductFamily` deleted or renamed its instance variable `image_information` - - Model `ProductFamily` deleted or renamed its instance variable `cost_information` - - Model `ProductFamily` deleted or renamed its instance variable `availability_information` - - Model `ProductFamily` deleted or renamed its instance variable `hierarchy_information` - - Model `ProductFamily` deleted or renamed its instance variable `filterable_properties` - - Model `ProductFamily` deleted or renamed its instance variable `product_lines` - - Model `ProductFamily` deleted or renamed its instance variable `resource_provider_details` - - Model `ProductLine` deleted or renamed its instance variable `display_name` - - Model `ProductLine` deleted or renamed its instance variable `description` - - Model `ProductLine` deleted or renamed its instance variable `image_information` - - Model `ProductLine` deleted or renamed its instance variable `cost_information` - - Model `ProductLine` deleted or renamed its instance variable `availability_information` - - Model `ProductLine` deleted or renamed its instance variable `hierarchy_information` - - Model `ProductLine` deleted or renamed its instance variable `filterable_properties` - - Model `ProductLine` deleted or renamed its instance variable `products` - - Deleted or renamed model `AddressResourceList` - - Deleted or renamed model `ConfigurationFilters` - - Deleted or renamed model `Configurations` - - Deleted or renamed model `OperationListResult` - - Deleted or renamed model `OrderItemResourceList` - - Deleted or renamed model `OrderResourceList` - - Deleted or renamed model `ProductFamilies` - - Deleted or renamed model `ProductFamiliesMetadata` - - Deleted or renamed model `ShippingDetails` - - Deleted or renamed model `EdgeOrderManagementClientOperationsMixin` + - Model `ProductFamiliesMetadataDetails` moved instance variable `display_name`, `description`, `image_information`, `cost_information`, `availability_information`, `hierarchy_information`, `filterable_properties`, `product_lines` and `resource_provider_details` under property `properties` whose type is `ProductFamilyProperties` + - Model `ProductFamily` moved instance variable `display_name`, `description`, `image_information`, `cost_information`, `availability_information`, `hierarchy_information`, `filterable_properties`, `product_lines` and `resource_provider_details` under property `properties` whose type is `ProductFamilyProperties` + - Model `ProductLine` moved instance variable `display_name`, `description`, `image_information`, `cost_information`, `availability_information`, `hierarchy_information`, `filterable_properties` and `products` under property `properties` whose type is `ProductLineProperties` + +### Other Changes + + - Deleted model `AddressResourceList`/`Configurations`/`OperationListResult`/`OrderItemResourceList`/`OrderResourceList`/`ProductFamilies`/`ProductFamiliesMetadata` which actually were not used by SDK users + - Deleted model `ShippingDetails` which actually was not used by SDK users + - Deleted operation group `EdgeOrderManagementClientOperationsMixin` which actually was not used by SDK users ## 2.0.0 (2024-10-30) From 98a4f573df5c708f102c323b3106494c7c6ba44f Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 6 Jul 2026 17:26:06 +0800 Subject: [PATCH 3/3] Optimize CHANGELOG: clarify client method moves to operation groups for azure-mgmt-edgeorder Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-mgmt-edgeorder/CHANGELOG.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md index c51b02586783..9af7b5dee8a9 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md +++ b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md @@ -77,27 +77,27 @@ ### Breaking Changes - This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration. - - Deleted or renamed client method `EdgeOrderManagementClient.begin_create_address` - - Deleted or renamed client method `EdgeOrderManagementClient.begin_create_order_item` - - Deleted or renamed client method `EdgeOrderManagementClient.begin_delete_address_by_name` - - Deleted or renamed client method `EdgeOrderManagementClient.begin_delete_order_item_by_name` - - Deleted or renamed client method `EdgeOrderManagementClient.begin_return_order_item` - - Deleted or renamed client method `EdgeOrderManagementClient.begin_update_address` - - Deleted or renamed client method `EdgeOrderManagementClient.begin_update_order_item` - - Deleted or renamed client method `EdgeOrderManagementClient.cancel_order_item` - - Deleted or renamed client method `EdgeOrderManagementClient.get_address_by_name` - - Deleted or renamed client method `EdgeOrderManagementClient.get_order_by_name` - - Deleted or renamed client method `EdgeOrderManagementClient.get_order_item_by_name` - - Deleted or renamed client method `EdgeOrderManagementClient.list_addresses_at_resource_group_level` - - Deleted or renamed client method `EdgeOrderManagementClient.list_addresses_at_subscription_level` - - Deleted or renamed client method `EdgeOrderManagementClient.list_configurations` - - Deleted or renamed client method `EdgeOrderManagementClient.list_operations` - - Deleted or renamed client method `EdgeOrderManagementClient.list_order_at_resource_group_level` - - Deleted or renamed client method `EdgeOrderManagementClient.list_order_at_subscription_level` - - Deleted or renamed client method `EdgeOrderManagementClient.list_order_items_at_resource_group_level` - - Deleted or renamed client method `EdgeOrderManagementClient.list_order_items_at_subscription_level` - - Deleted or renamed client method `EdgeOrderManagementClient.list_product_families` - - Deleted or renamed client method `EdgeOrderManagementClient.list_product_families_metadata` + - Client method `begin_create_address` was moved to operation group `addresses` and renamed to `begin_create`, so update code from `EdgeOrderManagementClient(...).begin_create_address(...)` to `EdgeOrderManagementClient(...).addresses.begin_create(...)` + - Client method `begin_delete_address_by_name` was moved to operation group `addresses` and renamed to `begin_delete`, so update code from `EdgeOrderManagementClient(...).begin_delete_address_by_name(...)` to `EdgeOrderManagementClient(...).addresses.begin_delete(...)` + - Client method `begin_update_address` was moved to operation group `addresses` and renamed to `begin_update`, so update code from `EdgeOrderManagementClient(...).begin_update_address(...)` to `EdgeOrderManagementClient(...).addresses.begin_update(...)` + - Client method `get_address_by_name` was moved to operation group `addresses` and renamed to `get`, so update code from `EdgeOrderManagementClient(...).get_address_by_name(...)` to `EdgeOrderManagementClient(...).addresses.get(...)` + - Client method `list_addresses_at_resource_group_level` was moved to operation group `addresses` and renamed to `list_by_resource_group`, so update code from `EdgeOrderManagementClient(...).list_addresses_at_resource_group_level(...)` to `EdgeOrderManagementClient(...).addresses.list_by_resource_group(...)` + - Client method `list_addresses_at_subscription_level` was moved to operation group `addresses` and renamed to `list_by_subscription`, so update code from `EdgeOrderManagementClient(...).list_addresses_at_subscription_level(...)` to `EdgeOrderManagementClient(...).addresses.list_by_subscription(...)` + - Client method `begin_create_order_item` was moved to operation group `order_items` and renamed to `begin_create`, so update code from `EdgeOrderManagementClient(...).begin_create_order_item(...)` to `EdgeOrderManagementClient(...).order_items.begin_create(...)` + - Client method `begin_delete_order_item_by_name` was moved to operation group `order_items` and renamed to `begin_delete`, so update code from `EdgeOrderManagementClient(...).begin_delete_order_item_by_name(...)` to `EdgeOrderManagementClient(...).order_items.begin_delete(...)` + - Client method `begin_return_order_item` was moved to operation group `order_items` and renamed to `begin_return_method`, so update code from `EdgeOrderManagementClient(...).begin_return_order_item(...)` to `EdgeOrderManagementClient(...).order_items.begin_return_method(...)` + - Client method `begin_update_order_item` was moved to operation group `order_items` and renamed to `begin_update`, so update code from `EdgeOrderManagementClient(...).begin_update_order_item(...)` to `EdgeOrderManagementClient(...).order_items.begin_update(...)` + - Client method `cancel_order_item` was moved to operation group `order_items` and renamed to `cancel`, so update code from `EdgeOrderManagementClient(...).cancel_order_item(...)` to `EdgeOrderManagementClient(...).order_items.cancel(...)` + - Client method `get_order_item_by_name` was moved to operation group `order_items` and renamed to `get`, so update code from `EdgeOrderManagementClient(...).get_order_item_by_name(...)` to `EdgeOrderManagementClient(...).order_items.get(...)` + - Client method `list_order_items_at_resource_group_level` was moved to operation group `order_items` and renamed to `list_by_resource_group`, so update code from `EdgeOrderManagementClient(...).list_order_items_at_resource_group_level(...)` to `EdgeOrderManagementClient(...).order_items.list_by_resource_group(...)` + - Client method `list_order_items_at_subscription_level` was moved to operation group `order_items` and renamed to `list_by_subscription`, so update code from `EdgeOrderManagementClient(...).list_order_items_at_subscription_level(...)` to `EdgeOrderManagementClient(...).order_items.list_by_subscription(...)` + - Client method `get_order_by_name` was moved to operation group `orders` and renamed to `get`, so update code from `EdgeOrderManagementClient(...).get_order_by_name(...)` to `EdgeOrderManagementClient(...).orders.get(...)` + - Client method `list_order_at_resource_group_level` was moved to operation group `orders` and renamed to `list_by_resource_group`, so update code from `EdgeOrderManagementClient(...).list_order_at_resource_group_level(...)` to `EdgeOrderManagementClient(...).orders.list_by_resource_group(...)` + - Client method `list_order_at_subscription_level` was moved to operation group `orders` and renamed to `list_by_subscription`, so update code from `EdgeOrderManagementClient(...).list_order_at_subscription_level(...)` to `EdgeOrderManagementClient(...).orders.list_by_subscription(...)` + - Client method `list_configurations` was moved to operation group `products_and_configurations` (method name unchanged), so update code from `EdgeOrderManagementClient(...).list_configurations(...)` to `EdgeOrderManagementClient(...).products_and_configurations.list_configurations(...)` + - Client method `list_product_families` was moved to operation group `products_and_configurations` (method name unchanged), so update code from `EdgeOrderManagementClient(...).list_product_families(...)` to `EdgeOrderManagementClient(...).products_and_configurations.list_product_families(...)` + - Client method `list_product_families_metadata` was moved to operation group `products_and_configurations` (method name unchanged), so update code from `EdgeOrderManagementClient(...).list_product_families_metadata(...)` to `EdgeOrderManagementClient(...).products_and_configurations.list_product_families_metadata(...)` + - Client method `list_operations` was moved to operation group `operations` and renamed to `list`, so update code from `EdgeOrderManagementClient(...).list_operations(...)` to `EdgeOrderManagementClient(...).operations.list(...)` - Model `AddressResource` moved instance variable `shipping_address`, `contact_details` and `address_validation_status` under property `properties` whose type is `AddressProperties` - Model `AddressUpdateParameter` moved instance variable `shipping_address` and `contact_details` under property `properties` whose type is `AddressUpdateProperties` - Model `Configuration` moved instance variable `display_name`, `description`, `image_information`, `cost_information`, `availability_information`, `hierarchy_information`, `filterable_properties`, `specifications` and `dimensions` under property `properties` whose type is `ConfigurationProperties`